def ImageProducer_imagenet(filename_queue,isotropic):
line_reader = tf.TextLineReader()
key, line = line_reader.read(filename_queue)
# line_batch or line (depending if you want to batch)
filename, label = tf.decode_csv(line,record_defaults=[tf.constant([],dtype=tf.string),tf.constant([],dtype=tf.int32)],field_delim=' ')
file_contents = tf.read_file(filename)
example = tf.image.decode_jpeg(file_contents)
processed_img = process_image(example,isotropic)
# Convert from RGB channel ordering to BGR This matches, for instance, how OpenCV orders the channels.
processed_img = tf.reverse(processed_img, [False, False, True])
#processed_img.set_shape([224, 224, 3])
return processed_img, label
评论列表
文章目录