From a5677d3f90dc01b5da8bf364f549e6deb1878136 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 17 Dec 2019 10:14:18 -0800 Subject: [PATCH] updates --- utils/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index e077d894..d7b27171 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -466,7 +466,10 @@ def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.5): Returns detections with shape: (x1, y1, x2, y2, object_conf, class_conf, class) """ + # NMS method https://github.com/ultralytics/yolov3/issues/679 'OR', 'AND', 'MERGE', 'VISION', 'VISION_BATCHED' + method = 'MERGE' if conf_thres <= 0.01 else 'VISION' # MERGE is highest mAP, VISION is fastest + # Box constraints min_wh, max_wh = 2, 10000 # (pixels) minimum and maximium box width and height output = [None] * len(prediction) @@ -516,10 +519,6 @@ def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.5): # Get detections sorted by decreasing confidence scores pred = pred[(-pred[:, 4]).argsort()] - # Set NMS method https://github.com/ultralytics/yolov3/issues/679 - # 'OR', 'AND', 'MERGE', 'VISION', 'VISION_BATCHED' - method = 'MERGE' if conf_thres <= 0.01 else 'VISION' # MERGE is highest mAP, VISION is fastest - # Batched NMS if method == 'VISION_BATCHED': i = torchvision.ops.boxes.batched_nms(boxes=pred[:, :4],