Advertisement
Guest User

Untitled

a guest
Apr 4th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. test_queue=tf.train.string_input_producer(images)
  2. reader=tf.WholeFileReader()
  3. key , image_data = reader.read(test_queue)
  4. decoded_image = tf.image.decode_jpeg(image_data, channels=MODEL_INPUT_DEPTH)
  5. init_op=tf.initialize_all_variables()
  6. with tf.Session() as sess:
  7. sess.run(init_op)
  8. coord = tf.train.Coordinator()
  9. threads = tf.train.start_queue_runners(sess=sess,coord=coord)
  10. for i in range(len(images)):
  11. try:
  12. image_tensor = decoded_image.eval()
  13. shape=image_tensor.shape
  14. if shape[0]<FLAGS.min_width or shape[1]<FLAGS.min_width:
  15. print "bad too small ",shape[0],"x",shape[1]," ",images[i]
  16. except Exception as e:
  17. print "bad some other reason above" + images[i]
  18. coord.request_stop()
  19. coord.join(threads)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement