Browse Source
rm _types
Signed-off-by: junjie.jiang <junjie.jiang@zilliz.com>
main
1 changed files with
1 additions and
1 deletions
-
data2vec_vision.py
|
|
@ -27,7 +27,7 @@ class Data2VecVision(NNOperator): |
|
|
|
self.feature_extractor = BeitFeatureExtractor.from_pretrained(model_name) |
|
|
|
|
|
|
|
@arg(1, to_image_color('RGB')) |
|
|
|
def __call__(self, img: towhee._types.Image) -> numpy.ndarray: |
|
|
|
def __call__(self, img: 'towhee.types.Image') -> numpy.ndarray: |
|
|
|
img = PILImage.fromarray(img.astype('uint8'), 'RGB') |
|
|
|
inputs = self.feature_extractor(img, return_tensors="pt") |
|
|
|
with torch.no_grad(): |
|
|
|