Skip to content

Commit 9067be6

Browse files
committed
Add weights for new tiny test models
1 parent a2f539f commit 9067be6

File tree

6 files changed

+29
-25
lines changed

6 files changed

+29
-25
lines changed

timm/models/byobnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2355,7 +2355,7 @@ def _cfgr(url='', **kwargs):
23552355
'test_byobnet.r160_in1k': _cfgr(
23562356
hf_hub_id='timm/',
23572357
first_conv='stem.conv',
2358-
input_size=(3, 160, 160), crop_pct=0.875, pool_size=(5, 5),
2358+
input_size=(3, 160, 160), crop_pct=0.95, pool_size=(5, 5),
23592359
),
23602360
})
23612361

timm/models/convnext.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -953,14 +953,17 @@ def _cfgv2(url='', **kwargs):
953953
input_size=(3, 256, 256), pool_size=(8, 8), crop_pct=1.0, num_classes=1024),
954954

955955
"test_convnext.r160_in1k": _cfg(
956-
# hf_hub_id='timm/',
957-
input_size=(3, 160, 160), pool_size=(5, 5), mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5)),
956+
hf_hub_id='timm/',
957+
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
958+
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
958959
"test_convnext2.r160_in1k": _cfg(
959-
# hf_hub_id='timm/',
960-
input_size=(3, 160, 160), pool_size=(5, 5), mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5)),
960+
hf_hub_id='timm/',
961+
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
962+
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
961963
"test_convnext3.r160_in1k": _cfg(
962-
# hf_hub_id='timm/',
963-
input_size=(3, 160, 160), pool_size=(5, 5), mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5)),
964+
hf_hub_id='timm/',
965+
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
966+
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
964967

965968
})
966969

timm/models/efficientnet.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,19 +1804,18 @@ def _cfg(url='', **kwargs):
18041804

18051805
"test_efficientnet.r160_in1k": _cfg(
18061806
hf_hub_id='timm/',
1807-
input_size=(3, 160, 160), pool_size=(5, 5)),
1807+
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
1808+
"test_efficientnet_ln.r160_in1k": _cfg(
1809+
hf_hub_id='timm/',
1810+
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
18081811
"test_efficientnet_gn.r160_in1k": _cfg(
18091812
hf_hub_id='timm/',
18101813
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
1811-
input_size=(3, 160, 160), pool_size=(5, 5)),
1812-
"test_efficientnet_ln.r160_in1k": _cfg(
1813-
#hf_hub_id='timm/',
1814-
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
1815-
input_size=(3, 160, 160), pool_size=(5, 5)),
1814+
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
18161815
"test_efficientnet_evos.r160_in1k": _cfg(
1817-
#hf_hub_id='timm/',
1816+
hf_hub_id='timm/',
18181817
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
1819-
input_size=(3, 160, 160), pool_size=(5, 5)),
1818+
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
18201819
})
18211820

18221821

timm/models/nfnet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,9 @@ def _dcfg(url='', **kwargs):
736736
'nf_ecaresnet101': _dcfg(url='', first_conv='stem.conv'),
737737

738738
'test_nfnet.r160_in1k': _dcfg(
739-
# hf_hub_id='timm/',
739+
hf_hub_id='timm/',
740740
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
741-
crop_pct=0.875, input_size=(3, 160, 160), pool_size=(5, 5)),
741+
crop_pct=0.95, input_size=(3, 160, 160), pool_size=(5, 5)),
742742
})
743743

744744

timm/models/resnet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,8 +1304,8 @@ def _gcfg(url='', **kwargs):
13041304
first_conv='conv1.0'),
13051305

13061306
'test_resnet.r160_in1k': _cfg(
1307-
#hf_hub_id='timm/',
1308-
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
1307+
hf_hub_id='timm/',
1308+
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5), crop_pct=0.95,
13091309
input_size=(3, 160, 160), pool_size=(5, 5), first_conv='conv1.0'),
13101310
})
13111311

timm/models/vision_transformer.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,13 +2014,13 @@ def _cfg(url: str = '', **kwargs) -> Dict[str, Any]:
20142014

20152015
'test_vit.r160_in1k': _cfg(
20162016
hf_hub_id='timm/',
2017-
input_size=(3, 160, 160), crop_pct=0.875),
2017+
input_size=(3, 160, 160), crop_pct=0.95),
20182018
'test_vit2.r160_in1k': _cfg(
2019-
#hf_hub_id='timm/',
2020-
input_size=(3, 160, 160), crop_pct=0.875),
2019+
hf_hub_id='timm/',
2020+
input_size=(3, 160, 160), crop_pct=0.95),
20212021
'test_vit3.r160_in1k': _cfg(
20222022
#hf_hub_id='timm/',
2023-
input_size=(3, 160, 160), crop_pct=0.875),
2023+
input_size=(3, 160, 160), crop_pct=0.95),
20242024
}
20252025

20262026
_quick_gelu_cfgs = [
@@ -3217,21 +3217,23 @@ def vit_so150m_patch16_reg4_gap_256(pretrained: bool = False, **kwargs) -> Visio
32173217
def test_vit(pretrained: bool = False, **kwargs) -> VisionTransformer:
32183218
""" ViT Test
32193219
"""
3220-
model_args = dict(patch_size=16, embed_dim=64, depth=6, num_heads=2, mlp_ratio=3)
3220+
model_args = dict(patch_size=16, embed_dim=64, depth=6, num_heads=2, mlp_ratio=3, dynamic_img_size=True)
32213221
model = _create_vision_transformer('test_vit', pretrained=pretrained, **dict(model_args, **kwargs))
32223222
return model
32233223

32243224

3225+
@register_model
32253226
def test_vit2(pretrained: bool = False, **kwargs) -> VisionTransformer:
32263227
""" ViT Test
32273228
"""
32283229
model_args = dict(
32293230
patch_size=16, embed_dim=64, depth=8, num_heads=2, mlp_ratio=3,
3230-
class_token=False, reg_tokens=1, global_pool='avg', init_values=1e-5)
3231+
class_token=False, reg_tokens=1, global_pool='avg', init_values=1e-5, dynamic_img_size=True)
32313232
model = _create_vision_transformer('test_vit2', pretrained=pretrained, **dict(model_args, **kwargs))
32323233
return model
32333234

32343235

3236+
@register_model
32353237
def test_vit3(pretrained: bool = False, **kwargs) -> VisionTransformer:
32363238
""" ViT Test
32373239
"""

0 commit comments

Comments
 (0)