Skip to content
Snippets Groups Projects
Commit c1ab7237 authored by Stephane Chavin's avatar Stephane Chavin
Browse files

save TP and FP for validation

parent 7ecfe599
Branches
No related tags found
No related merge requests found
...@@ -274,6 +274,8 @@ def run( ...@@ -274,6 +274,8 @@ def run(
stats = [torch.cat(x, 0).cpu().numpy() for x in zip(*stats)] # to numpy stats = [torch.cat(x, 0).cpu().numpy() for x in zip(*stats)] # to numpy
if len(stats) and stats[0].any(): if len(stats) and stats[0].any():
tp, fp, p, r, f1, ap, 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)
np.save(save_dir / 'class_tp.npy', tp)
np.save(save_dir / 'class_fp.npy', fp)
ap50, ap = ap[:, 0], ap.mean(1) # AP@0.5, AP@0.5:0.95 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() mp, mr, map50, map = p.mean(), r.mean(), ap50.mean(), ap.mean()
nt = np.bincount(stats[3].astype(int), minlength=nc) # number of targets per class nt = np.bincount(stats[3].astype(int), minlength=nc) # number of targets per class
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment