在张量流中使用立体图像进行批量学习
batch learning with stereo images in tensorflow
如何使用tf.readfile
批量学习?
for i in range(len(files_mask)):
t_image_left = tf.read_file(files_left[i], name='read_fileimage_left')
t_image_right = tf.read_file(files_right[i], name='read_fileimage_right')
t_image_mask = tf.read_file(files_mask[i], name='read_fileimage_mask')
t_left = tf.image.decode_png(t_image_left, name='decode_png_t_left', dtype=tf.uint8)
t_right = tf.image.decode_png(t_image_right, name='decode_png_t_right', dtype=tf.uint8)
t_mask = tf.image.decode_png(t_image_mask, name='decode_png_t_mask', dtype=tf.uint8)
左右图像和蒙版批次应相互对应。左上批次应该是所有图像中的左上批次。
这可能吗:https://www.tensorflow.org/versions/r1.2/api_docs/python/tf/train/batch ?
您可以使用 tf.train.batch
,但您还必须使用文件名队列,例如 tf.train.slice_input_producer
filename_queue = tf.train.slice_input_producer([files_left, files_right, files_mask])
t_image_left = tf.read_file(filename_queue[0], name='read_fileimage_left')
t_image_right = tf.read_file(filename_queue[1], name='read_fileimage_right')
t_image_mask = tf.read_file(filename_queue[2], name='read_fileimage_mask')
t_left = tf.image.decode_png(t_image_left, name='decode_png_t_left', dtype=tf.uint8)
t_right = tf.image.decode_png(t_image_right, name='decode_png_t_right', dtype=tf.uint8)
t_mask = tf.image.decode_png(t_image_mask, name='decode_png_t_mask', dtype=tf.uint8
batch_left, batch_right, batch_mask = tf.train.batch([t_left, t_right, t_mask], batch_size=32, num_threads=1,
capacity=500, enqueue_many=False,)
如何使用tf.readfile
批量学习?
for i in range(len(files_mask)):
t_image_left = tf.read_file(files_left[i], name='read_fileimage_left')
t_image_right = tf.read_file(files_right[i], name='read_fileimage_right')
t_image_mask = tf.read_file(files_mask[i], name='read_fileimage_mask')
t_left = tf.image.decode_png(t_image_left, name='decode_png_t_left', dtype=tf.uint8)
t_right = tf.image.decode_png(t_image_right, name='decode_png_t_right', dtype=tf.uint8)
t_mask = tf.image.decode_png(t_image_mask, name='decode_png_t_mask', dtype=tf.uint8)
左右图像和蒙版批次应相互对应。左上批次应该是所有图像中的左上批次。
这可能吗:https://www.tensorflow.org/versions/r1.2/api_docs/python/tf/train/batch ?
您可以使用 tf.train.batch
,但您还必须使用文件名队列,例如 tf.train.slice_input_producer
filename_queue = tf.train.slice_input_producer([files_left, files_right, files_mask])
t_image_left = tf.read_file(filename_queue[0], name='read_fileimage_left')
t_image_right = tf.read_file(filename_queue[1], name='read_fileimage_right')
t_image_mask = tf.read_file(filename_queue[2], name='read_fileimage_mask')
t_left = tf.image.decode_png(t_image_left, name='decode_png_t_left', dtype=tf.uint8)
t_right = tf.image.decode_png(t_image_right, name='decode_png_t_right', dtype=tf.uint8)
t_mask = tf.image.decode_png(t_image_mask, name='decode_png_t_mask', dtype=tf.uint8
batch_left, batch_right, batch_mask = tf.train.batch([t_left, t_right, t_mask], batch_size=32, num_threads=1,
capacity=500, enqueue_many=False,)