Pycocotools best.pt after COCO train (#1616)

* Pycocotools best.pt after COCO train

* cleanup
This commit is contained in:
Glenn Jocher authored and GitHub committed 2020-12-06 14:58:33 +01:00
1 parent d929bb656c
commit 791dadb51c
5 files changed
+117 -15

No files matched your search

+2 -3
View File
@@ -1,5 +1,4 @@
import argparse
import glob
import json
import os
from pathlib import Path
@@ -246,7 +245,7 @@ def test(data,
# Save JSON
if save_json and len(jdict):
w = Path(weights[0] if isinstance(weights, list) else weights).stem if weights is not None else '' # weights
anno_json = glob.glob('../coco/annotations/instances_val*.json')[0] # annotations json
anno_json = '../coco/annotations/instances_val2017.json' # annotations json
pred_json = str(save_dir / f"{w}_predictions.json") # predictions json
print('\nEvaluating pycocotools mAP... saving %s...' % pred_json)
with open(pred_json, 'w') as f:
@@ -266,7 +265,7 @@ def test(data,
eval.summarize()
map, map50 = eval.stats[:2] # update results (mAP@0.5:0.95, mAP@0.5)
except Exception as e:
print('ERROR: pycocotools unable to run: %s' % e)
print(f'pycocotools unable to run: {e}')
# Return results
if not training: