COCO annotations JSON fix (#3764)
Browse files
test.py
CHANGED
@@ -270,7 +270,7 @@ def run(data,
|
|
270 |
# Save JSON
|
271 |
if save_json and len(jdict):
|
272 |
w = Path(weights[0] if isinstance(weights, list) else weights).stem if weights is not None else '' # weights
|
273 |
-
anno_json = '../coco/annotations/instances_val2017.json' # annotations json
|
274 |
pred_json = str(save_dir / f"{w}_predictions.json") # predictions json
|
275 |
print('\nEvaluating pycocotools mAP... saving %s...' % pred_json)
|
276 |
with open(pred_json, 'w') as f:
|
|
|
270 |
# Save JSON
|
271 |
if save_json and len(jdict):
|
272 |
w = Path(weights[0] if isinstance(weights, list) else weights).stem if weights is not None else '' # weights
|
273 |
+
anno_json = str(Path(data.get('path', '../coco')) / 'annotations/instances_val2017.json') # annotations json
|
274 |
pred_json = str(save_dir / f"{w}_predictions.json") # predictions json
|
275 |
print('\nEvaluating pycocotools mAP... saving %s...' % pred_json)
|
276 |
with open(pred_json, 'w') as f:
|