From 9d38d2b044cc2e3641c60c01b3af038cd4f8d7c3 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 18 Jun 2023 03:07:45 +0200 Subject: [PATCH] Fix Classify confusion matrix (#3241) --- ultralytics/yolo/utils/metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultralytics/yolo/utils/metrics.py b/ultralytics/yolo/utils/metrics.py index 8544adf512..cd903213fe 100644 --- a/ultralytics/yolo/utils/metrics.py +++ b/ultralytics/yolo/utils/metrics.py @@ -204,7 +204,7 @@ class ConfusionMatrix: """ preds, targets = torch.cat(preds)[:, 0], torch.cat(targets) for p, t in zip(preds.cpu().numpy(), targets.cpu().numpy()): - self.matrix[t][p] += 1 + self.matrix[p][t] += 1 def process_batch(self, detections, labels): """