Commit fbbee306 authored by Georg Wölflein's avatar Georg Wölflein Committed by derekjchow
Browse files

Change iteritems() to items() for python3 (#6588)

The evaluation crashes in python3 if iteritems() is used instead of items()
parent 042c9aaa
...@@ -568,7 +568,7 @@ class CocoMaskEvaluator(object_detection_evaluation.DetectionEvaluator): ...@@ -568,7 +568,7 @@ class CocoMaskEvaluator(object_detection_evaluation.DetectionEvaluator):
'annotations': self._groundtruth_list, 'annotations': self._groundtruth_list,
'images': [{'id': image_id, 'height': shape[1], 'width': shape[2]} 'images': [{'id': image_id, 'height': shape[1], 'width': shape[2]}
for image_id, shape in self._image_id_to_mask_shape_map. for image_id, shape in self._image_id_to_mask_shape_map.
iteritems()], items()],
'categories': self._categories 'categories': self._categories
} }
coco_wrapped_groundtruth = coco_tools.COCOWrapper( coco_wrapped_groundtruth = coco_tools.COCOWrapper(
...@@ -582,7 +582,7 @@ class CocoMaskEvaluator(object_detection_evaluation.DetectionEvaluator): ...@@ -582,7 +582,7 @@ class CocoMaskEvaluator(object_detection_evaluation.DetectionEvaluator):
include_metrics_per_category=self._include_metrics_per_category) include_metrics_per_category=self._include_metrics_per_category)
mask_metrics.update(mask_per_category_ap) mask_metrics.update(mask_per_category_ap)
mask_metrics = {'DetectionMasks_'+ key: value mask_metrics = {'DetectionMasks_'+ key: value
for key, value in mask_metrics.iteritems()} for key, value in mask_metrics.items()}
return mask_metrics return mask_metrics
def get_estimator_eval_metric_ops(self, eval_dict): def get_estimator_eval_metric_ops(self, eval_dict):
......
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