diff --git a/ga3c/Environment.py b/ga3c/Environment.py index 1f4c409..34ac073 100644 --- a/ga3c/Environment.py +++ b/ga3c/Environment.py @@ -35,6 +35,7 @@ from Config import Config from GameManager import GameManager +import cv2 class Environment: @@ -55,7 +56,10 @@ def _rgb2gray(rgb): @staticmethod def _preprocess(image): image = Environment._rgb2gray(image) - image = misc.imresize(image, [Config.IMAGE_HEIGHT, Config.IMAGE_WIDTH], 'bilinear') + ## Below method was deprecated in newer versions of scipy + # image = misc.imresize(image, [Config.IMAGE_HEIGHT, Config.IMAGE_WIDTH], 'bilinear') + ## Alternative using cv2 + image = cv2.resize(image, dsize=(Config.IMAGE_HEIGHT, Config.IMAGE_WIDTH), interpolation=cv2.INTER_LINEAR) image = image.astype(np.float32) / 128.0 - 1.0 return image