def pix2pix_vangogh(self):
queue_A = tf.train.string_input_producer(tf.train.match_filenames_once(dirs['pix2pix_vangogh-A']),
num_epochs=self.epoch, shuffle=True)
queue_B = tf.train.string_input_producer(tf.train.match_filenames_once(dirs['pix2pix_vangogh-B']),
num_epochs=self.epoch, shuffle=True)
image_reader = tf.WholeFileReader()
_, img_A = image_reader.read(queue_A)
_, img_B = image_reader.read(queue_B)
# decoding jpg images
img_A = tf.image.decode_jpeg(img_A)
img_B = tf.image.decode_jpeg(img_B)
# image size : 64x64x3
self.img_A = tf.cast(tf.reshape(img_A, shape=[None,
self.input_height,
self.input_width,
self.input_channel]), dtype=tf.float32) / 255.
self.img_B = tf.cast(tf.reshape(img_B, shape=[None,
self.input_height,
self.input_width,
self.input_channel]), dtype=tf.float32) / 255.
print(self.img_A.shape)
print(self.img_B.shape)
# min_queue_examples = self.batch_size
# self.batch_A = tf.train.shuffle_batch([img_A],
# batch_size=self.batch_size,
# num_threads=self.num_threads,
# capacity=min_queue_examples + 3 * self.batch_size,
# min_after_dequeue=min_queue_examples)
# self.batch_B = tf.train.shuffle_batch([img_B],
# batch_size=self.batch_size,
# num_threads=self.num_threads,
# capacity=min_queue_examples + 3 * self.batch_size,
# min_after_dequeue=min_queue_examples)
评论列表
文章目录