From 70d6d2c4847982a8f20c4233a28ba84ea9485868 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Sat, 2 Jul 2022 15:17:05 -0700 Subject: [PATCH] support test_crop_size in data config resolve --- timm/data/config.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/timm/data/config.py b/timm/data/config.py index 38f5689a..78176e4b 100644 --- a/timm/data/config.py +++ b/timm/data/config.py @@ -64,11 +64,15 @@ def resolve_data_config(args, default_cfg={}, model=None, use_test_size=False, v new_config['std'] = default_cfg['std'] # resolve default crop percentage - new_config['crop_pct'] = DEFAULT_CROP_PCT + crop_pct = DEFAULT_CROP_PCT if 'crop_pct' in args and args['crop_pct'] is not None: - new_config['crop_pct'] = args['crop_pct'] - elif 'crop_pct' in default_cfg: - new_config['crop_pct'] = default_cfg['crop_pct'] + crop_pct = args['crop_pct'] + else: + if use_test_size and 'test_crop_pct' in default_cfg: + crop_pct = default_cfg['test_crop_pct'] + elif 'crop_pct' in default_cfg: + crop_pct = default_cfg['crop_pct'] + new_config['crop_pct'] = crop_pct if verbose: _logger.info('Data processing configuration for current model + dataset:')