From 754a1b5bf8d65f552fadd4c083e53c17e79cece4 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 25 Apr 2020 21:15:30 -0700 Subject: [PATCH] reduce merge limit to 3000 --- utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/utils.py b/utils/utils.py index 7adfa76a..4547de31 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -556,7 +556,7 @@ def non_max_suppression(prediction, conf_thres=0.1, iou_thres=0.6, multi_label=T boxes, scores = x[:, :4].clone() + c.view(-1, 1) * max_wh, x[:, 4] # boxes (offset by class), scores if method == 'merge': # Merge NMS (boxes merged using weighted mean) i = torchvision.ops.boxes.nms(boxes, scores, iou_thres) - if n < 1E4: # update boxes as boxes(i,4) = weights(i,n) * boxes(n,4) + if n < 3E3: # update boxes as boxes(i,4) = weights(i,n) * boxes(n,4) # weights = (box_iou(boxes, boxes).tril_() > iou_thres) * scores.view(-1, 1) # box weights # weights /= weights.sum(0) # normalize # x[:, :4] = torch.mm(weights.T, x[:, :4])