A face detector fires several boxes on every face, each with a score: how sure it is. Write keep(scores, overlap): given the scores of one photo’s boxes and overlap[i][j], how much boxes i and j overlap (from 0 to 1, as in Did the box hit?), say which boxes to keep so that every face ends up with one box, its surest. Boxes on the same face overlap by more than 0.5.
A photo booth’s strip of four photos, and the boxes a face detector fires on every face, each with how sure it is. Keeping every box, or only the surest one, both go wrong. The goal is one box on every face, like photos 1 to 3 at the end. Your keep(scores, overlap) gets one photo’s boxes.
keep(scores, overlap)| scores | how sure the detector is of each box, e.g. [0.6, 0.9, 0.7, 0.8] | e.g. [0.6, 0.9, 0.7, 0.8] |
| overlap | overlap[i][j] is how much boxes i and j overlap, from 0 to 1 (boxes on the same face: more than 0.5) | e.g. [[1, 0.73, 0.59, 0.65], [0.73, 1, 0.75, 0.… |
| returns | one True or False per box, in the same order as scores: True to keep the box | |