Explicitly compute TP, FP in val.py (#5727)

This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-11-20 01:04:56 +01:00
1 parent eb51ffdcac
commit 36d12a500e
2 files changed
+16 -7

No files matched your search

+1 -1
View File
@@ -237,7 +237,7 @@ def run(data,
# Compute metrics
stats = [np.concatenate(x, 0) for x in zip(*stats)] # to numpy
if len(stats) and stats[0].any():
p, r, ap, f1, ap_class = ap_per_class(*stats, plot=plots, save_dir=save_dir, names=names)
tp, fp, p, r, f1, ap, ap_class = ap_per_class(*stats, plot=plots, save_dir=save_dir, names=names)
ap50, ap = ap[:, 0], ap.mean(1) # AP@0.5, AP@0.5:0.95
mp, mr, map50, map = p.mean(), r.mean(), ap50.mean(), ap.mean()
nt = np.bincount(stats[3].astype(np.int64), minlength=nc) # number of targets per class