|
|
@ -599,7 +599,7 @@ def non_max_suppression(prediction, conf_thres=0.1, iou_thres=0.6, merge=False,
|
|
|
|
|
|
|
|
|
|
|
|
# Detections matrix nx6 (xyxy, conf, cls)
|
|
|
|
# Detections matrix nx6 (xyxy, conf, cls)
|
|
|
|
if multi_label:
|
|
|
|
if multi_label:
|
|
|
|
i, j = (x[:, 5:] > conf_thres).nonzero().t()
|
|
|
|
i, j = (x[:, 5:] > conf_thres).nonzero(as_tuple=False).t()
|
|
|
|
x = torch.cat((box[i], x[i, j + 5, None], j[:, None].float()), 1)
|
|
|
|
x = torch.cat((box[i], x[i, j + 5, None], j[:, None].float()), 1)
|
|
|
|
else: # best class only
|
|
|
|
else: # best class only
|
|
|
|
conf, j = x[:, 5:].max(1, keepdim=True)
|
|
|
|
conf, j = x[:, 5:].max(1, keepdim=True)
|
|
|
|