def read_and_decode(filename_queue):
reader = tf.TFRecordReader()
_, serialized_example = reader.read(filename_queue)
features = tf.parse_single_example(
serialized_example,
# Defaults are not specified since both keys are required.
features={
'image_left': tf.FixedLenFeature([], tf.string),
'image_right': tf.FixedLenFeature([], tf.string),
})
image_left = tf.decode_raw(features['image_left'], tf.uint8)
image_right = tf.decode_raw(features['image_right'], tf.uint8)
width = 960
height = 540
depth = 4
image_left.set_shape([width*height*depth])
image_right.set_shape([width*height*depth])
return image_left, image_right
评论列表
文章目录