Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def predict_input_fn(fileNames):
- def parse_image(example_proto):
- parsed_features = tf.parse_single_example(example_proto, imageFeaturesDict)
- return parsed_features
- dataset = tf.data.TFRecordDataset(fileNames, compression_type='GZIP')
- dataset = dataset.map(parse_image)
- dataset = dataset.batch(PATCH_WIDTH * PATCH_HEIGHT)
- iterator = dataset.make_one_shot_iterator()
- return iterator.get_next()
- predictions = classifier.predict(input_fn=lambda: predict_input_fn(fileNames))
- for pred_dict in predictions:
- ... fill up the image array ...
Add Comment
Please, Sign In to add comment