a3c_training_thread.py 文件源码

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

项目:progressive_a3c 作者: seann999 项目源码 文件源码
def rgb2gray(self, rgb, i=0):
        if FLAGS.save_frames:
            if self.thread_index == 0 and len(os.listdir(os.path.join(FLAGS.model_dir, "images"))) < 1000:
                scipy.misc.imsave("%s/%i.png" % (os.path.join(FLAGS.model_dir, "images"), i), rgb["image"][0])

        img = np.asarray(rgb["image"][0])[..., :3]
        img = np.dot(img, [0.299, 0.587, 0.114])
        img = scipy.misc.imresize(img, (84, 84)) / 255.0
        #flip H
        #
        #img = np.fliplr(img)



        return img
        #return -np.dot(img, [0.299, 0.587, 0.114]) / 255.0 + 1.0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号