Commit 2b436a12 authored by A. Unique TensorFlower's avatar A. Unique TensorFlower
Browse files

Internal change

PiperOrigin-RevId: 338364871
parent 95f2b046
...@@ -190,9 +190,12 @@ class COCOEvaluator(object): ...@@ -190,9 +190,12 @@ class COCOEvaluator(object):
if hasattr(coco_eval, 'category_stats'): if hasattr(coco_eval, 'category_stats'):
for category_index, category_id in enumerate(coco_eval.params.catIds): for category_index, category_id in enumerate(coco_eval.params.catIds):
coco_category = self._coco_gt.cats[category_id] if self._annotation_file:
# if 'name' is available use it, otherwise use `id` coco_category = self._coco_gt.cats[category_id]
category_display_name = coco_category.get('name', category_id) # if 'name' is available use it, otherwise use `id`
category_display_name = coco_category.get('name', category_id)
else:
category_display_name = category_id
metrics_dict[prefix + 'Precision mAP ByCategory/{}'.format( metrics_dict[prefix + 'Precision mAP ByCategory/{}'.format(
category_display_name category_display_name
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment