mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Fix small bug in seresnet input size and eval transform handling of img size
This commit is contained in:
parent
db1fe34d0c
commit
6e9697eb9c
@ -183,11 +183,11 @@ def transforms_imagenet_eval(
|
|||||||
|
|
||||||
if isinstance(img_size, tuple):
|
if isinstance(img_size, tuple):
|
||||||
assert len(img_size) == 2
|
assert len(img_size) == 2
|
||||||
if img_size[0] == img_size[1]:
|
if img_size[-1] == img_size[-2]:
|
||||||
# fall-back to older behaviour so Resize scales to shortest edge if target is square
|
# fall-back to older behaviour so Resize scales to shortest edge if target is square
|
||||||
scale_size = int(math.floor(img_size[0] / crop_pct))
|
scale_size = int(math.floor(img_size[0] / crop_pct))
|
||||||
else:
|
else:
|
||||||
scale_size = tuple([int(x[0] / crop_pct) for x in img_size])
|
scale_size = tuple([int(x / crop_pct) for x in img_size])
|
||||||
else:
|
else:
|
||||||
scale_size = int(math.floor(img_size / crop_pct))
|
scale_size = int(math.floor(img_size / crop_pct))
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ __all__ = ['SENet', 'senet154', 'seresnet50', 'seresnet101', 'seresnet152',
|
|||||||
|
|
||||||
def _cfg(url=''):
|
def _cfg(url=''):
|
||||||
return {
|
return {
|
||||||
'url': url, 'num_classes': 1000, 'input_size': (3, 224, 244), 'pool_size': (7, 7),
|
'url': url, 'num_classes': 1000, 'input_size': (3, 224, 224), 'pool_size': (7, 7),
|
||||||
'crop_pct': 0.875, 'interpolation': 'bilinear',
|
'crop_pct': 0.875, 'interpolation': 'bilinear',
|
||||||
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
|
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
|
||||||
'first_conv': 'layer0.conv1', 'classifier': 'last_linear',
|
'first_conv': 'layer0.conv1', 'classifier': 'last_linear',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user