From fbf0014cd6053695de7c732c42c7748293fb776f Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 24 Apr 2019 17:13:36 +0200 Subject: [PATCH] updates --- utils/utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index 2e46fbbec6..3e400ff7a9 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -376,12 +376,12 @@ def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.5): nms_style = 'MERGE' # 'OR' (default), 'AND', 'MERGE' (experimental) for c in pred[:, -1].unique(): dc = pred[pred[:, -1] == c] # select class c - dc = dc[:min(len(dc), 100)] # limit to first 100 boxes: https://github.com/ultralytics/yolov3/issues/117 - - # No NMS required if only 1 prediction - if len(dc) == 1: - det_max.append(dc) + n = len(dc) + if n == 1: + det_max.append(dc) # No NMS required if only 1 prediction continue + elif n > 100: + dc = dc[:100] # limit to first 100 boxes: https://github.com/ultralytics/yolov3/issues/117 # Non-maximum suppression if nms_style == 'OR': # default