Work out iou (object detection) instantly with clear inputs, formula shown and shareable results.
Intersection over union divides the overlapping area of two boxes by the area they jointly cover, so it rewards both correct position and correct size. Detection benchmarks turn IoU into a binary match using a threshold: PASCAL VOC used 0.5, while COCO averages over thresholds from 0.5 to 0.95 in steps of 0.05 to reward tighter localisation.
IoU
IoU = intersection / (area A + area B - intersection)
IoU falls quickly with size mismatch. A prediction twice the area of the ground truth caps at 0.5 even when perfectly centred.
It is the mean average precision averaged over ten IoU thresholds from 0.50 to 0.95, so a model must localise tightly, not just find the object.