Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
Merge pull request #212 from gnes-ai/move_resize_from_inception
Browse files Browse the repository at this point in the history
fix(encoder): remove image resize from TFInceptionEncoder
  • Loading branch information
mergify[bot] authored Sep 5, 2019
2 parents 334d232 + 67b211d commit a12f8ef
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gnes/encoder/image/inception.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit a12f8ef

Please sign in to comment.