Skip to content

Commit

Permalink
[Fix] Fix preprocess_model_config for CIFAR dataset (#1659)
Browse files Browse the repository at this point in the history
* fix cifar10 for mmcls

* remove unnecessary code
  • Loading branch information
hanrui1sensetime authored and lvhan028 committed Mar 1, 2023
1 parent eecd77d commit d9b5a21
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions mmdeploy/codebase/mmcls/deploy/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ def process_model_config(model_cfg: Config,
cfg.test_pipeline.pop(0)
# check whether input_shape is valid
if input_shape is not None:
if 'crop_size' in cfg.test_pipeline[2]:
crop_size = cfg.test_pipeline[2]['crop_size']
if tuple(input_shape) != (crop_size, crop_size):
logger = get_root_logger()
logger.warning(
f'`input shape` should be equal to `crop_size`: {crop_size},\
but given: {input_shape}')
for pipeline_component in cfg.test_pipeline:
if 'Crop' in pipeline_component['type']:
if 'crop_size' in pipeline_component:
crop_size = pipeline_component['crop_size']
if tuple(input_shape) != (crop_size, crop_size):
logger = get_root_logger()
logger.warning(
f'`input shape` should be equal to `crop_size`: {crop_size},\
but given: {input_shape}')
return cfg


Expand Down

0 comments on commit d9b5a21

Please sign in to comment.