diff --git a/gnes/encoder/video/inception.py b/gnes/encoder/video/inception.py index dab1e603..4588cbbf 100644 --- a/gnes/encoder/video/inception.py +++ b/gnes/encoder/video/inception.py @@ -69,9 +69,7 @@ def encode(self, data: List['np.ndarray'], *args, pos_start = [0] + [sum(v_len[:i + 1]) for i in range(len(v_len) - 1)] pos_end = [sum(v_len[:i + 1]) for i in range(len(v_len))] - def _resize(x): - self.logger.info('image shape: %s' % str(x.shape)) - return np.array(Image.fromarray(x).resize((self.inception_size_x, self.inception_size_y)), dtype=np.float32) * 2 / 255. - 1. + _resize = lambda x: np.array(Image.fromarray(x).resize((self.inception_size_x, self.inception_size_y)), dtype=np.float32) * 2 / 255. - 1. images = [_resize(im) for v in data for im in v] @@ -81,6 +79,6 @@ def _encode(self, data): feed_dict={self.inputs: data}) return end_points_[self.select_layer] - encodes = _encode(images).astype(np.float32) + encodes = _encode(self, images).astype(np.float32) return [encodes[s:e].copy() for s, e in zip(pos_start, pos_end)]