Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Apr 24, 2019
1 parent aa2df1e commit fbf0014
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fbf0014

Please sign in to comment.