From 67b211da58d8f0bef2221cce07509d69ff551fc1 Mon Sep 17 00:00:00 2001 From: raccoonliukai <903896015@qq.com> Date: Wed, 4 Sep 2019 22:24:04 +0800 Subject: [PATCH] fix(encoder): remove image resize from TFInceptionEncoder --- gnes/encoder/image/inception.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gnes/encoder/image/inception.py b/gnes/encoder/image/inception.py index eecdb812..7fdf3681 100644 --- a/gnes/encoder/image/inception.py +++ b/gnes/encoder/image/inception.py @@ -16,7 +16,6 @@ from typing import List import numpy as np -from PIL import Image from ..base import BaseImageEncoder from ...helper import batching, get_first_available_gpu @@ -62,9 +61,7 @@ def post_init(self): self.saver.restore(self.sess, self.model_dir) def encode(self, img: List['np.ndarray'], *args, **kwargs) -> np.ndarray: - img = [(np.array(Image.fromarray(im).resize((self.inception_size_x, - self.inception_size_y)), dtype=np.float32) * 2 / 255. - 1.) for im - in img] + img = [(im * 2 / 255. - 1.) for im in img] @batching def _encode(_, data):