Skip to content

Commit

Permalink
add non-fixed path option to coco's instances_val2017.json (#11860)
Browse files Browse the repository at this point in the history
add non-fixed path option fo coco annotations
  • Loading branch information
malashinroman committed Jul 23, 2023
1 parent 485da42 commit 52d9622
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions val.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ def run(
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 = 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
LOGGER.info(f'\nEvaluating pycocotools mAP... saving {pred_json}...')
with open(pred_json, 'w') as f:
Expand Down

0 comments on commit 52d9622

Please sign in to comment.