From b2910e12c7715f99c3ce4b42d7280fe9e0f4be42 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Thu, 22 Feb 2024 18:02:26 +0100 Subject: [PATCH 1/2] fix for https://github.com/WongKinYiu/yolov9/issues/11 --- detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect.py b/detect.py index dbc626492..b1abf608b 100644 --- a/detect.py +++ b/detect.py @@ -99,7 +99,7 @@ def run( # NMS with dt[2]: - pred = non_max_suppression(pred, conf_thres, iou_thres, classes, agnostic_nms, max_det=max_det) + pred = non_max_suppression(pred[0][0], conf_thres, iou_thres, classes, agnostic_nms, max_det=max_det) # Second-stage classifier (optional) # pred = utils.general.apply_classifier(pred, classifier_model, im, im0s) From 1e33dbbe463db9eac77194025628fb837bb8afba Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Fri, 23 Feb 2024 09:08:16 +0100 Subject: [PATCH 2/2] following discussion on https://github.com/WongKinYiu/yolov9/issues/11 --- detect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/detect.py b/detect.py index b1abf608b..6a13a6cb3 100644 --- a/detect.py +++ b/detect.py @@ -99,7 +99,8 @@ def run( # NMS with dt[2]: - pred = non_max_suppression(pred[0][0], conf_thres, iou_thres, classes, agnostic_nms, max_det=max_det) + pred = pred[0][1] if isinstance(pred[0], list) else pred[0] + pred = non_max_suppression(pred, conf_thres, iou_thres, classes, agnostic_nms, max_det=max_det) # Second-stage classifier (optional) # pred = utils.general.apply_classifier(pred, classifier_model, im, im0s)