Skip to content
Permalink
Browse files

fix(encoder): fix name for video encoder

  • Loading branch information...
Larryjianfeng committed Aug 1, 2019
1 parent 15eb50b commit 46b5c94eea4973e3f1b2dcb05e85981f316a4ca3
Showing with 6 additions and 6 deletions.
  1. +1 −1 gnes/encoder/base.py
  2. +3 −3 gnes/encoder/video/incep_mixture.py
  3. +2 −2 gnes/helper.py
@@ -40,7 +40,7 @@ def encode(self, img: List['np.ndarray'], *args, **kwargs) -> np.ndarray:

class BaseVideoEncoder(BaseEncoder):

def encode(self, videos: List['np.ndarray'], *args, **kwargs) -> np.ndarray:
def encode(self, data: List['np.ndarray'], *args, **kwargs) -> np.ndarray:
pass


@@ -103,14 +103,14 @@ def post_init(self):
saver.restore(self.sess2, self.model_dir_mixture)

@batching
def encode(self, videos: List['np.ndarray'], *args, **kwargs) -> np.ndarray:
def encode(self, data: List['np.ndarray'], *args, **kwargs) -> np.ndarray:
ret = []
v_len = [len(v) for v in videos]
v_len = [len(v) for v in data]
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))]
max_len = min(max(v_len), self.max_frames)

img = [im for v in videos for im in v]
img = [im for v in data for im in v]
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]
@@ -48,8 +48,8 @@ def get_first_available_gpu():
try:
import GPUtil
r = GPUtil.getAvailable(order='random',
maxMemory=0.1,
maxLoad=0.1,
maxMemory=0.5,
maxLoad=0.5,
limit=1)
if r:
return r[0]

0 comments on commit 46b5c94

Please sign in to comment.
You can’t perform that action at this time.