Browse Source
Fix input size assert issue
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
1 changed files with
3 additions and
1 deletions
-
timm_image.py
|
@ -109,7 +109,7 @@ class TimmImage(NNOperator): |
|
|
crop_pct=self.config['crop_pct'] |
|
|
crop_pct=self.config['crop_pct'] |
|
|
) |
|
|
) |
|
|
except: |
|
|
except: |
|
|
self.tfms = create_transform(**resolve_data_config({}, model=self.model)) |
|
|
|
|
|
|
|
|
self.tfms = create_transform(**resolve_data_config({}, model=self.model.model)) |
|
|
self.skip_tfms = skip_preprocess |
|
|
self.skip_tfms = skip_preprocess |
|
|
else: |
|
|
else: |
|
|
log.warning('The operator is initialized without specified model.') |
|
|
log.warning('The operator is initialized without specified model.') |
|
@ -149,6 +149,8 @@ class TimmImage(NNOperator): |
|
|
@property |
|
|
@property |
|
|
def config(self): |
|
|
def config(self): |
|
|
config = get_pretrained_cfg(self.model_name) |
|
|
config = get_pretrained_cfg(self.model_name) |
|
|
|
|
|
if not isinstance(config, dict) and hasattr(config, 'to_dict'): |
|
|
|
|
|
config = config.to_dict() |
|
|
return config |
|
|
return config |
|
|
|
|
|
|
|
|
@arg(1, to_image_color('RGB')) |
|
|
@arg(1, to_image_color('RGB')) |
|
|