Created
October 6, 2017 20:40
-
-
Save WuStangDan/3dc404ebabf5b7ef4721baa475ebd49c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
from object_detection.utils import dataset_util | |
flags = tf.app.flags | |
flags.DEFINE_string('output_path', '', 'Path to output TFRecord') | |
FLAGS = flags.FLAGS | |
def create_tf_example(data_and_label_info): | |
... | |
... | |
return tf_data_and_label | |
def main(_): | |
writer = tf.python_io.TFRecordWriter(FLAGS.output_path) | |
# TODO START: Write code to read in your dataset to examples variable | |
file_loc = None | |
all_data_and_label_info = LOAD(file_loc) | |
# TODO END | |
for data_and_label_info in all_data_and_label_info: | |
tf_example = create_tf_example(data_and_label_info) | |
writer.write(tf_example.SerializeToString()) | |
writer.close() | |
if __name__ == '__main__': | |
tf.app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment