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

Commit

Permalink
fix(encoder): fix name for video encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
Larryjianfeng committed Aug 1, 2019
1 parent 15eb50b commit 46b5c94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gnes/encoder/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
6 changes: 3 additions & 3 deletions gnes/encoder/video/incep_mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions gnes/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 46b5c94

Please sign in to comment.