diff --git a/ultralytics/utils/metrics.py b/ultralytics/utils/metrics.py index b5988110..ae98fb71 100644 --- a/ultralytics/utils/metrics.py +++ b/ultralytics/utils/metrics.py @@ -581,6 +581,7 @@ def ap_per_class( n_l = nt[ci] # number of labels n_p = i.sum() # number of predictions if n_p == 0 or n_l == 0: + prec_values.append(np.zeros(1000)) continue # Accumulate FPs and TPs