All problems
NMS Suppressed Indices
Problem
Run greedy non-maximum suppression and report which boxes were suppressed.
Process boxes by descending score (ties by smaller index) and suppress a box when its IoU with an already kept box is strictly greater than iou_threshold. Return the suppressed box indices sorted ascending.
Test cases
case 1
in: [[[0,0,2,2],[1,1,3,3],[10,10,12,12]],[0.9,0.8,0.7],0.1]
expected: [1]
case 2
in: [[[0,0,2,2],[1,1,3,3],[10,10,12,12]],[0.9,0.8,0.7],0.9]
expected: []
case 3
in: [[[0,0,2,2],[0,0,2,2],[0,0,2,2]],[0.9,0.8,0.7],0.5]
expected: [1,2]
case 4
in: [[],[],0.5]
expected: []
Starter codePython
def nms_suppressed(boxes, scores, iou_threshold):
# Your code here
pass4 test cases · run your code against them in the editor