A detector looks for things in a photo and draws a box around each. Write overlap(box, truth): given the detector’s box and the true box, both as [left, top, right, bottom] in squares from the photo’s top-left corner, say how good the box is: 1 when it’s spot on, 0 when it misses completely.
A detector draws boxes where it thinks the dog is; the dashed box is where the dog really is. Did it hit? Counting the dog’s squares inside each box? Both get fooled. The goal is a score like the bars it ends on: top for spot on, low for a sloppy box. Your overlap(box, truth) gets the detector’s box and the true box.
overlap(box, truth)| box | the detector's box, [left, top, right, bottom] in squares from the photo's top-left corner | e.g. [5, 4, 11, 8] |
| truth | the true box around the thing, the same way | e.g. [4, 4, 10, 8] |
| returns | how good the box is: 1 when it's spot on, 0 when it misses completely | |