Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghonglie committed Sep 18, 2022
1 parent 417bf0c commit 6fb9251
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tools/analysis_tools/robustness_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ def get_coco_style_results(filename,

for metric_name in metrics:
assert metric_name in [
'AP', 'AP50', 'AP75', 'APs', 'APm', 'APl', 'AR1', 'AR10', 'AR100',
'ARs', 'ARm', 'ARl'
'mAP', 'mAP_50', 'mAP_75', 'mAP_s', 'mAP_m', 'mAP_l'
]

eval_output = load(filename)
Expand All @@ -78,8 +77,13 @@ def get_coco_style_results(filename,
for corr_i, distortion in enumerate(eval_output):
for severity in eval_output[distortion]:
for metric_j, metric_name in enumerate(metrics):
mAP = eval_output[distortion][severity]['_'.join(
(task, metric_name))]
metric_dict = eval_output[distortion][severity]

new_metric_dict = {}
for k, v in metric_dict.items():
if '/' in k:
new_metric_dict[k.split('/')[-1]] = v
mAP = new_metric_dict['_'.join((task, metric_name))]
results[corr_i, severity, metric_j] = mAP

P = results[0, 0, :]
Expand Down Expand Up @@ -163,7 +167,7 @@ def get_voc_style_results(filename, prints='mPC', aggregate='benchmark'):

def get_results(filename,
dataset='coco',
task='coco/bbox',
task='bbox',
metric=None,
prints='mPC',
aggregate='benchmark'):
Expand Down

0 comments on commit 6fb9251

Please sign in to comment.