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

Commit

Permalink
refactor(onnx): move batch_size to class attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Han Xiao authored Aug 2, 2019
1 parent a0fdad3 commit c1e406a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gnes/encoder/image/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@


class BaseONNXImageEncoder(BaseImageEncoder):
batch_size = 64

def __init__(self, model_name: str,
model_dir: str,
batch_size: int = 64,
use_cuda: bool = False,
*args, **kwargs):
super().__init__(*args, **kwargs)

self.batch_size = batch_size
self.model_dir = model_dir
self.model_name = model_name
self._use_cuda = use_cuda
Expand Down Expand Up @@ -66,4 +65,4 @@ def encode(self, img: List['np.ndarray'], *args, **kwargs) -> np.ndarray:
if pad_batch != 0:
return result_npy[0][0:len(img)]
else:
return result_npy[0]
return result_npy[0]

0 comments on commit c1e406a

Please sign in to comment.