This commit is contained in:
Glenn Jocher 2019-07-09 21:11:53 +02:00
parent d5fd37de26
commit 6bd2c22523
1 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ def test(
seen = 0 seen = 0
model.eval() model.eval()
coco91class = coco80_to_coco91_class() coco91class = coco80_to_coco91_class()
print(('%20s' + '%10s' * 6) % ('Class', 'Images', 'Targets', 'P', 'R', 'mAP', 'F1')) print(('%30s' + '%10s' * 6) % ('Class', 'Images', 'Targets', 'P', 'R', 'mAP', 'F1'))
loss, p, r, f1, mp, mr, map, mf1 = 0., 0., 0., 0., 0., 0., 0., 0. loss, p, r, f1, mp, mr, map, mf1 = 0., 0., 0., 0., 0., 0., 0., 0.
jdict, stats, ap, ap_class = [], [], [], [] jdict, stats, ap, ap_class = [], [], [], []
for batch_i, (imgs, targets, paths, shapes) in enumerate(tqdm(dataloader, desc='Computing mAP')): for batch_i, (imgs, targets, paths, shapes) in enumerate(tqdm(dataloader, desc='Computing mAP')):
@ -150,7 +150,7 @@ def test(
mp, mr, map, mf1 = p.mean(), r.mean(), ap.mean(), f1.mean() mp, mr, map, mf1 = p.mean(), r.mean(), ap.mean(), f1.mean()
# Print results # Print results
pf = '%20s' + '%10.3g' * 6 # print format pf = '%30s' + '%10.3g' * 6 # print format
print(pf % ('all', seen, nt.sum(), mp, mr, map, mf1)) print(pf % ('all', seen, nt.sum(), mp, mr, map, mf1))
# Print results per class # Print results per class