Skip to content

Commit

Permalink
bug fix: switched rows and cols for correct detections in confusion m…
Browse files Browse the repository at this point in the history
…atrix (ultralytics#2883)

(cherry picked from commit d48a34d)
  • Loading branch information
MichHeilig authored and Lechtr committed Apr 25, 2021
1 parent e0a9cb2 commit c465df1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def process_batch(self, detections, labels):
for i, gc in enumerate(gt_classes):
j = m0 == i
if n and sum(j) == 1:
self.matrix[gc, detection_classes[m1[j]]] += 1 # correct
self.matrix[detection_classes[m1[j]], gc] += 1 # correct
else:
self.matrix[self.nc, gc] += 1 # background FP

Expand Down

0 comments on commit c465df1

Please sign in to comment.