updates
This commit is contained in:
parent
17fbd6ed8c
commit
952df070db
11
test.py
11
test.py
|
@ -181,8 +181,14 @@ def test(cfg,
|
||||||
for i, c in enumerate(ap_class):
|
for i, c in enumerate(ap_class):
|
||||||
print(pf % (names[c], seen, nt[c], p[i], r[i], ap[i], f1[i]))
|
print(pf % (names[c], seen, nt[c], p[i], r[i], ap[i], f1[i]))
|
||||||
|
|
||||||
|
# Print speeds
|
||||||
|
if verbose:
|
||||||
|
t = tuple(x / seen * 1E3 for x in (t0, t1, t0 + t1)) + (img_size, img_size, batch_size) # tuple
|
||||||
|
print('Speed: %.1f/%.1f/%.1f ms inference/NMS/total per %gx%g image at batch-size %g' % t)
|
||||||
|
|
||||||
# Save JSON
|
# Save JSON
|
||||||
if save_json and map and len(jdict):
|
if save_json and map and len(jdict):
|
||||||
|
print('COCO mAP with pycocotools...')
|
||||||
imgIds = [int(Path(x).stem.split('_')[-1]) for x in dataloader.dataset.img_files]
|
imgIds = [int(Path(x).stem.split('_')[-1]) for x in dataloader.dataset.img_files]
|
||||||
with open('results.json', 'w') as file:
|
with open('results.json', 'w') as file:
|
||||||
json.dump(jdict, file)
|
json.dump(jdict, file)
|
||||||
|
@ -204,11 +210,6 @@ def test(cfg,
|
||||||
cocoEval.summarize()
|
cocoEval.summarize()
|
||||||
mf1, map = cocoEval.stats[:2] # update to pycocotools results (mAP@0.5:0.95, mAP@0.5)
|
mf1, map = cocoEval.stats[:2] # update to pycocotools results (mAP@0.5:0.95, mAP@0.5)
|
||||||
|
|
||||||
# Print speeds
|
|
||||||
if verbose:
|
|
||||||
t = tuple(x / seen * 1E3 for x in (t0, t1, t0 + t1)) + (img_size, img_size, batch_size) # tuple
|
|
||||||
print('Speed: %.1f/%.1f/%.1f ms inference/NMS/total per %gx%g image at batch-size %g' % t)
|
|
||||||
|
|
||||||
# Return results
|
# Return results
|
||||||
maps = np.zeros(nc) + map
|
maps = np.zeros(nc) + map
|
||||||
for i, c in enumerate(ap_class):
|
for i, c in enumerate(ap_class):
|
||||||
|
|
Loading…
Reference in New Issue