Guest User

Untitled

a guest
Jan 23rd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. def predict_input_fn(fileNames):
  2.  
  3. def parse_image(example_proto):
  4. parsed_features = tf.parse_single_example(example_proto, imageFeaturesDict)
  5. return parsed_features
  6.  
  7. dataset = tf.data.TFRecordDataset(fileNames, compression_type='GZIP')
  8. dataset = dataset.map(parse_image)
  9. dataset = dataset.batch(PATCH_WIDTH * PATCH_HEIGHT)
  10.  
  11. iterator = dataset.make_one_shot_iterator()
  12. return iterator.get_next()
  13.  
  14. predictions = classifier.predict(input_fn=lambda: predict_input_fn(fileNames))
  15.  
  16. for pred_dict in predictions:
  17. ... fill up the image array ...
Add Comment
Please, Sign In to add comment