Skip to content

Commit

Permalink
Add resnet and resnet-v2 18/34 weights trained with mnv4 small based …
Browse files Browse the repository at this point in the history
…recipe
  • Loading branch information
rwightman committed Oct 31, 2024
1 parent f5b58e3 commit e6263bf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
6 changes: 6 additions & 0 deletions timm/models/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,9 @@ def _gcfg(url='', **kwargs):
hf_hub_id='timm/',
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/resnet18d_ra2-48a79e06.pth',
first_conv='conv1.0'),
'resnet18d.ra4_e3600_r224_in1k': _rcfg(
hf_hub_id='timm/',
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5), crop_pct=0.9),
'resnet34.a1_in1k': _rcfg(
hf_hub_id='timm/',
url='https://github.com/huggingface/pytorch-image-models/releases/download/v0.1-rsb-weights/resnet34_a1_0-46f8f793.pth'),
Expand All @@ -724,6 +727,9 @@ def _gcfg(url='', **kwargs):
'resnet34.bt_in1k': _ttcfg(
hf_hub_id='timm/',
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/resnet34-43635321.pth'),
'resnet34.ra4_e3600_r224_in1k': _rcfg(
hf_hub_id='timm/',
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5), crop_pct=0.9),
'resnet34d.ra2_in1k': _ttcfg(
hf_hub_id='timm/',
url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/resnet34d_ra2-f8dcfcaf.pth',
Expand Down
22 changes: 14 additions & 8 deletions timm/models/resnetv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,14 +696,20 @@ def _cfg(url='', **kwargs):
hf_hub_id='timm/',
num_classes=21843, custom_load=True),

'resnetv2_18.untrained': _cfg(
interpolation='bicubic', crop_pct=0.95),
'resnetv2_18d.untrained': _cfg(
interpolation='bicubic', crop_pct=0.95, first_conv='stem.conv1'),
'resnetv2_34.untrained': _cfg(
interpolation='bicubic', crop_pct=0.95),
'resnetv2_34d.untrained': _cfg(
interpolation='bicubic', crop_pct=0.95, first_conv='stem.conv1'),
'resnetv2_18.ra4_e3600_r224_in1k': _cfg(
hf_hub_id='timm/',
interpolation='bicubic', crop_pct=0.9, test_input_size=(3, 288, 288), test_crop_pct=1.0),
'resnetv2_18d.ra4_e3600_r224_in1k': _cfg(
hf_hub_id='timm/',
interpolation='bicubic', crop_pct=0.9, test_input_size=(3, 288, 288), test_crop_pct=1.0,
first_conv='stem.conv1'),
'resnetv2_34.ra4_e3600_r224_in1k': _cfg(
hf_hub_id='timm/',
interpolation='bicubic', crop_pct=0.9, test_input_size=(3, 288, 288), test_crop_pct=1.0),
'resnetv2_34d.ra4_e3600_r224_in1k': _cfg(
hf_hub_id='timm/',
interpolation='bicubic', crop_pct=0.9, test_input_size=(3, 288, 288), test_crop_pct=1.0,
first_conv='stem.conv1'),
'resnetv2_50.a1h_in1k': _cfg(
hf_hub_id='timm/',
interpolation='bicubic', crop_pct=0.95, test_input_size=(3, 288, 288), test_crop_pct=1.0),
Expand Down

0 comments on commit e6263bf

Please sign in to comment.