fix bug in the ConfusionMatrix class (#18409)

This commit is contained in:
yuzhj 2024-12-26 21:23:03 +08:00 committed by GitHub
parent 7afec0d89e
commit edf8ba0f17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -372,10 +372,9 @@ class ConfusionMatrix:
else:
self.matrix[self.nc, gc] += 1 # true background
if n:
for i, dc in enumerate(detection_classes):
if not any(m1 == i):
self.matrix[dc, self.nc] += 1 # predicted background
for i, dc in enumerate(detection_classes):
if not any(m1 == i):
self.matrix[dc, self.nc] += 1 # predicted background
def matrix(self):
"""Returns the confusion matrix."""