From 87cc747e6a6144e90e315bb994925d3339e7bf35 Mon Sep 17 00:00:00 2001 From: sugyan Date: Sun, 11 Jun 2017 00:51:26 +0900 Subject: [PATCH] Fix pascalvoc converter --- datasets/pascalvoc_to_tfrecords.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datasets/pascalvoc_to_tfrecords.py b/datasets/pascalvoc_to_tfrecords.py index 9ac20169b..e008a1b99 100644 --- a/datasets/pascalvoc_to_tfrecords.py +++ b/datasets/pascalvoc_to_tfrecords.py @@ -79,8 +79,8 @@ def _process_image(directory, name): width: integer, image width in pixels. """ # Read the image file. - filename = directory + DIRECTORY_IMAGES + name + '.jpg' - image_data = tf.gfile.FastGFile(filename, 'r').read() + filename = os.path.join(directory, DIRECTORY_IMAGES, '{}.jpg'.format(name)) + image_data = tf.gfile.FastGFile(filename, 'rb').read() # Read the XML annotation file. filename = os.path.join(directory, DIRECTORY_ANNOTATIONS, name + '.xml')