From dd0782bd8dc10852359da068e9737fe4736d2215 Mon Sep 17 00:00:00 2001
From: Glenn Jocher <glenn.jocher@ultralytics.com>
Date: Sun, 10 Sep 2023 20:50:03 +0200
Subject: [PATCH] Apply default ConfusionMatrix `conf=0.25` (#4813)

---
 ultralytics/utils/metrics.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ultralytics/utils/metrics.py b/ultralytics/utils/metrics.py
index 731b55ab..d86d297e 100644
--- a/ultralytics/utils/metrics.py
+++ b/ultralytics/utils/metrics.py
@@ -189,7 +189,7 @@ class ConfusionMatrix:
         self.task = task
         self.matrix = np.zeros((nc + 1, nc + 1)) if self.task == 'detect' else np.zeros((nc, nc))
         self.nc = nc  # number of classes
-        self.conf = 0.25 if conf is None else conf  # argument may be None from default cfg
+        self.conf = 0.25 if conf in (None, 0.001) else conf  # apply 0.25 if default val conf is passed
         self.iou_thres = iou_thres
 
     def process_cls_preds(self, preds, targets):