1.
1. first sort the scores from highest to lowest and get indices 2. for the bbox of first index, get the overlap between this box and the remaining bboxes put the first index to result buffer 3. update the indices by keeping those bboxes with overlap less than thresh 4. repeat 2 and 3 until the indices are empty
score tensor
box tensor, with the size N*4
overlap thresh
buffer to store indices after nms
whether the scores are sorted
the length of indices after nms
Non-Maximum Suppression (nms) for Object Detection The goal of nms is to solve the problem that groups of several detections near the real location, ideally obtaining only one detection per object