From f74dd32b1d53ed84e820c044ca3f8f08d078c286 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 25 Jun 2021 01:49:38 +0200 Subject: [PATCH] COCO annotations JSON fix --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index 31d57221a3d..643dc441e52 100644 --- a/test.py +++ b/test.py @@ -270,7 +270,7 @@ def run(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 = '../coco/annotations/instances_val2017.json' # annotations json + anno_json = str(Path(data.get('path', '../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: