This commit is contained in:
Glenn Jocher 2019-12-23 10:13:20 -08:00
parent a51d83df33
commit a5160b44ca
1 changed files with 3 additions and 2 deletions

View File

@ -528,8 +528,9 @@ def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.5, multi_cls=Tru
# Non-maximum suppression # Non-maximum suppression
det_max = [] det_max = []
for c in j.unique(): cls = pred[:, -1]
dc = pred[j == c] # select class c for c in cls.unique():
dc = pred[cls == c] # select class c
n = len(dc) n = len(dc)
if n == 1: if n == 1:
det_max.append(dc) # No NMS required if only 1 prediction det_max.append(dc) # No NMS required if only 1 prediction