Unverified Commit 7431515f authored by cclauss's avatar cclauss Committed by GitHub
Browse files

long(image_id, 16) --> int(image_id, 16)

See: https://github.com/tensorflow/models/pull/3220#discussion_r163131613
parent 088ec5d2
...@@ -42,11 +42,6 @@ import tensorflow as tf ...@@ -42,11 +42,6 @@ import tensorflow as tf
from object_detection.dataset_tools import oid_tfrecord_creation from object_detection.dataset_tools import oid_tfrecord_creation
from object_detection.utils import label_map_util from object_detection.utils import label_map_util
try:
long # Python 2
except NameError:
long = int # Python 3
tf.flags.DEFINE_string('input_annotations_csv', None, tf.flags.DEFINE_string('input_annotations_csv', None,
'Path to CSV containing image bounding box annotations') 'Path to CSV containing image bounding box annotations')
tf.flags.DEFINE_string('input_images_directory', None, tf.flags.DEFINE_string('input_images_directory', None,
...@@ -101,7 +96,7 @@ def main(_): ...@@ -101,7 +96,7 @@ def main(_):
tf_example = oid_tfrecord_creation.tf_example_from_annotations_data_frame( tf_example = oid_tfrecord_creation.tf_example_from_annotations_data_frame(
image_annotations, label_map, encoded_image) image_annotations, label_map, encoded_image)
if tf_example: if tf_example:
shard_idx = long(image_id, 16) % FLAGS.num_shards shard_idx = int(image_id, 16) % FLAGS.num_shards
output_tfrecords[shard_idx].write(tf_example.SerializeToString()) output_tfrecords[shard_idx].write(tf_example.SerializeToString())
......
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