Always return Precision metric regardless of plot arg (#16900)

This commit is contained in:
Mohammed Yasin 2024-10-14 21:58:37 +08:00 committed by GitHub
parent 6ec8e6ae55
commit 4642d687ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -598,7 +598,7 @@ def ap_per_class(
# AP from recall-precision curve
for j in range(tp.shape[1]):
ap[ci, j], mpre, mrec = compute_ap(recall[:, j], precision[:, j])
if plot and j == 0:
if j == 0:
prec_values.append(np.interp(x, mrec, mpre)) # precision at mAP@0.5
prec_values = np.array(prec_values) # (nc, 1000)