Commit a75dcd5b authored by derekjchow's avatar derekjchow Committed by GitHub
Browse files

Merge pull request #1869 from tmattio/master

Make object_detection dictionaries compatible with Python3
parents c0b5d11d 545b75f9
...@@ -271,7 +271,7 @@ class FasterRCNNMetaArchTestBase(tf.test.TestCase): ...@@ -271,7 +271,7 @@ class FasterRCNNMetaArchTestBase(tf.test.TestCase):
self.assertEqual(set(prediction_out.keys()), expected_output_keys) self.assertEqual(set(prediction_out.keys()), expected_output_keys)
self.assertAllEqual(prediction_out['image_shape'], input_image_shape) self.assertAllEqual(prediction_out['image_shape'], input_image_shape)
for output_key, expected_shape in expected_output_shapes.iteritems(): for output_key, expected_shape in expected_output_shapes.items():
self.assertAllEqual(prediction_out[output_key].shape, expected_shape) self.assertAllEqual(prediction_out[output_key].shape, expected_shape)
# Check that anchors are clipped to window. # Check that anchors are clipped to window.
......
...@@ -63,7 +63,7 @@ class MultiResolutionFeatureMapGeneratorTest(tf.test.TestCase): ...@@ -63,7 +63,7 @@ class MultiResolutionFeatureMapGeneratorTest(tf.test.TestCase):
sess.run(init_op) sess.run(init_op)
out_feature_maps = sess.run(feature_maps) out_feature_maps = sess.run(feature_maps)
out_feature_map_shapes = dict( out_feature_map_shapes = dict(
(key, value.shape) for key, value in out_feature_maps.iteritems()) (key, value.shape) for key, value in out_feature_maps.items())
self.assertDictEqual(out_feature_map_shapes, expected_feature_map_shapes) self.assertDictEqual(out_feature_map_shapes, expected_feature_map_shapes)
def test_get_expected_feature_map_shapes_with_inception_v3(self): def test_get_expected_feature_map_shapes_with_inception_v3(self):
...@@ -93,7 +93,7 @@ class MultiResolutionFeatureMapGeneratorTest(tf.test.TestCase): ...@@ -93,7 +93,7 @@ class MultiResolutionFeatureMapGeneratorTest(tf.test.TestCase):
sess.run(init_op) sess.run(init_op)
out_feature_maps = sess.run(feature_maps) out_feature_maps = sess.run(feature_maps)
out_feature_map_shapes = dict( out_feature_map_shapes = dict(
(key, value.shape) for key, value in out_feature_maps.iteritems()) (key, value.shape) for key, value in out_feature_maps.items())
self.assertDictEqual(out_feature_map_shapes, expected_feature_map_shapes) self.assertDictEqual(out_feature_map_shapes, expected_feature_map_shapes)
......
...@@ -25,7 +25,6 @@ import PIL.Image as Image ...@@ -25,7 +25,6 @@ import PIL.Image as Image
import PIL.ImageColor as ImageColor import PIL.ImageColor as ImageColor
import PIL.ImageDraw as ImageDraw import PIL.ImageDraw as ImageDraw
import PIL.ImageFont as ImageFont import PIL.ImageFont as ImageFont
import six
import tensorflow as tf import tensorflow as tf
...@@ -398,7 +397,7 @@ def visualize_boxes_and_labels_on_image_array(image, ...@@ -398,7 +397,7 @@ def visualize_boxes_and_labels_on_image_array(image,
classes[i] % len(STANDARD_COLORS)] classes[i] % len(STANDARD_COLORS)]
# Draw all boxes onto image. # Draw all boxes onto image.
for box, color in six.iteritems(box_to_color_map): for box, color in box_to_color_map.items():
ymin, xmin, ymax, xmax = box ymin, xmin, ymax, xmax = box
if instance_masks is not None: if instance_masks is not None:
draw_mask_on_image_array( draw_mask_on_image_array(
......
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