From 4a63b24b0913569fafe008f0530a9b9add2f1eb6 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 26 Mar 2020 19:50:29 -0700 Subject: [PATCH] Merge NMS update --- utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/utils.py b/utils/utils.py index f023893c..f8f192b4 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -555,7 +555,7 @@ def non_max_suppression(prediction, conf_thres=0.1, iou_thres=0.6, multi_label=T i = torchvision.ops.boxes.nms(boxes, scores, iou_thres) iou = box_iou(boxes, boxes[i]).tril_() # lower triangular iou matrix weights = (iou > iou_thres) * scores.view(-1, 1) - weights /= weights.sum(0) + weights /= weights.sum(0) + 1E-6 x[i, :4] = torch.mm(weights.T, x[:, :4]) # merged_boxes(n,4) = weights(n,n) * boxes(n,4) elif method == 'vision': i = torchvision.ops.boxes.nms(boxes, scores, iou_thres)