add non-fixed path option to coco's instances_val2017.json (#11860)
add non-fixed path option fo coco annotations
This commit is contained in:
1 parent
485da42273
commit
52d96222bb
1 file changed
+2
@@ -304,6 +304,8 @@ def run(
|
|||||||
if save_json and len(jdict):
|
if save_json and len(jdict):
|
||||||
w = Path(weights[0] if isinstance(weights, list) else weights).stem if weights is not None else '' # weights
|
w = Path(weights[0] if isinstance(weights, list) else weights).stem if weights is not None else '' # weights
|
||||||
anno_json = str(Path('../datasets/coco/annotations/instances_val2017.json')) # annotations
|
anno_json = str(Path('../datasets/coco/annotations/instances_val2017.json')) # annotations
|
||||||
|
if not os.path.exists(anno_json):
|
||||||
|
anno_json = os.path.join(data['path'], 'annotations', 'instances_val2017.json')
|
||||||
pred_json = str(save_dir / f'{w}_predictions.json') # predictions
|
pred_json = str(save_dir / f'{w}_predictions.json') # predictions
|
||||||
LOGGER.info(f'\nEvaluating pycocotools mAP... saving {pred_json}...')
|
LOGGER.info(f'\nEvaluating pycocotools mAP... saving {pred_json}...')
|
||||||
with open(pred_json, 'w') as f:
|
with open(pred_json, 'w') as f:
|
||||||
|
|||||||
Reference in new issue
Block a user