def dataset_reader(filename_queue): #prev name: CamVid_reader
image_filename = filename_queue[0] #tensor of type string
label_filename = filename_queue[1] #tensor of type string
#get png encoded image
imageValue = tf.read_file(image_filename)
labelValue = tf.read_file(label_filename)
#decodes a png image into a uint8 or uint16 tensor
#returns a tensor of type dtype with shape [height, width, depth]
image_bytes = tf.image.decode_png(imageValue)
label_bytes = tf.image.decode_png(labelValue) #Labels are png, not jpeg
image = tf.reshape(image_bytes, (FLAGS.image_h, FLAGS.image_w, FLAGS.image_c))
label = tf.reshape(label_bytes, (FLAGS.image_h, FLAGS.image_w, 1))
return image, label
评论列表
文章目录