Greedy non-maximum suppression deletes every box that overlaps a higher-scoring box by more than a threshold. When two real objects overlap heavily (two people side by side, cars in traffic) one of them is lost. Soft-NMS keeps every box but lowers its score according to how much it overlaps the boxes already selected. Implement it with three decay rules.
soft_nms(boxes, scores, method="gaussian", iou_threshold=0.3, sigma=0.5, score_threshold=0.001)
boxes is (N, 4) as [x1, y1, x2, y2] and scores is (N,); lists or arrays. IoU is intersection area over union area.(index, current score) and remove it from the remaining set.iou_threshold, update its score:
"linear": if , otherwise unchanged;"gaussian": , for every remaining box;"hard": if (this is ordinary greedy NMS).score_threshold.(index, score) tuples in selection order, with indices as Python ints and scores as Python floats. Empty input returns [].