def input_setup(self):
'''
This function basically setup variables for taking image input.
filenames_A/filenames_B -> takes the list of all training images
self.image_A/self.image_B -> Input image with each values ranging from [-1,1]
'''
filenames_A = tf.train.match_filenames_once("./input/horse2zebra/trainA/*.jpg")
self.queue_length_A = tf.size(filenames_A)
filenames_B = tf.train.match_filenames_once("./input/horse2zebra/trainB/*.jpg")
self.queue_length_B = tf.size(filenames_B)
filename_queue_A = tf.train.string_input_producer(filenames_A)
filename_queue_B = tf.train.string_input_producer(filenames_B)
image_reader = tf.WholeFileReader()
_, image_file_A = image_reader.read(filename_queue_A)
_, image_file_B = image_reader.read(filename_queue_B)
self.image_A = tf.subtract(tf.div(tf.image.resize_images(tf.image.decode_jpeg(image_file_A),[256,256]),127.5),1)
self.image_B = tf.subtract(tf.div(tf.image.resize_images(tf.image.decode_jpeg(image_file_B),[256,256]),127.5),1)
评论列表
文章目录