datasets.py 文件源码

python
阅读 41 收藏 0 点赞 0 评论 0

项目:Awesome-GANs 作者: kozistr 项目源码 文件源码
def pix2pix_shoes_bags(self):
        shoes_filename_queue = tf.train.string_input_producer(tf.train.match_filenames_once(dirs['pix2pix_shoes']),
                                                              capacity=200)
        bags_filename_queue = tf.train.string_input_producer(tf.train.match_filenames_once(dirs['pix2pix_bags']),
                                                             capacity=200)
        image_reader = tf.WholeFileReader()

        _, img_shoes = image_reader.read(shoes_filename_queue)
        _, img_bags = image_reader.read(bags_filename_queue)

        # decoding jpg images
        img_shoes, img_bags = tf.image.decode_jpeg(img_shoes), tf.image.decode_jpeg(img_bags)

        # image size : 64x64x3
        img_shoes = tf.cast(tf.reshape(img_shoes, shape=[self.input_height,
                                                         self.input_width,
                                                         self.input_channel]), dtype=tf.float32) / 255.
        img_bags = tf.cast(tf.reshape(img_bags, shape=[self.input_height,
                                                       self.input_width,
                                                       self.input_channel]), dtype=tf.float32) / 255.

        self.batch_shoes = tf.train.shuffle_batch([img_shoes],
                                                  batch_size=self.batch_size,
                                                  num_threads=self.num_threads,
                                                  capacity=1024, min_after_dequeue=256)

        self.batch_bags = tf.train.shuffle_batch([img_bags],
                                                 batch_size=self.batch_size,
                                                 num_threads=self.num_threads,
                                                 capacity=1024, min_after_dequeue=256)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号