Skip to content

Commit

Permalink
Fix issue with list of metrics in CustomDataset.evaluate (open-mmlab#…
Browse files Browse the repository at this point in the history
…2128)

* Fix issue with list of metrics in CustomDataset.evaluate

Changes to be committed:
modified:   mmdet/datasets/custom.py

* Updated to evaluate only one of mAP or recall

Changes to be committed:
modified:   mmdet/datasets/custom.py
  • Loading branch information
melikovk authored Feb 22, 2020
1 parent 6d046c4 commit 376501f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mmdet/datasets/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ def evaluate(self,
scale_ranges (list[tuple] | None): Scale ranges for evaluating mAP.
Default: None.
"""
if not isinstance(metric, str):
assert len(metric) == 1
metric = metric[0]
allowed_metrics = ['mAP', 'recall']
if metric not in allowed_metrics:
raise KeyError('metric {} is not supported'.format(metric))
Expand All @@ -198,11 +201,7 @@ def evaluate(self,
if isinstance(iou_thr, float):
iou_thr = [iou_thr]
recalls = eval_recalls(
gt_bboxes,
results,
proposal_nums,
iou_thr,
print_summary=False)
gt_bboxes, results, proposal_nums, iou_thr, logger=logger)
for i, num in enumerate(proposal_nums):
for j, iou in enumerate(iou_thr):
eval_results['recall@{}@{}'.format(num, iou)] = recalls[i,
Expand Down

0 comments on commit 376501f

Please sign in to comment.