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
评论列表
文章目录