What is Intersection over Union (IoU) for object detection?

You have two overlapping bounding boxes. You calculate the intersection of boxes, which is the area of overlap. You compute the union of the overlapping box, which is the sum of the areas of the entire box that subtract the area of the overlap. Then you divide the inner journey by union.