Skip to content

Commit

Permalink
Add weights for new tiny test models
Browse files Browse the repository at this point in the history
  • Loading branch information
rwightman committed Sep 22, 2024
1 parent a2f539f commit 9067be6
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion timm/models/byobnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2355,7 +2355,7 @@ def _cfgr(url='', **kwargs):
'test_byobnet.r160_in1k': _cfgr(
hf_hub_id='timm/',
first_conv='stem.conv',
input_size=(3, 160, 160), crop_pct=0.875, pool_size=(5, 5),
input_size=(3, 160, 160), crop_pct=0.95, pool_size=(5, 5),
),
})

Expand Down
15 changes: 9 additions & 6 deletions timm/models/convnext.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,14 +953,17 @@ def _cfgv2(url='', **kwargs):
input_size=(3, 256, 256), pool_size=(8, 8), crop_pct=1.0, num_classes=1024),

"test_convnext.r160_in1k": _cfg(
# hf_hub_id='timm/',
input_size=(3, 160, 160), pool_size=(5, 5), mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5)),
hf_hub_id='timm/',
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
"test_convnext2.r160_in1k": _cfg(
# hf_hub_id='timm/',
input_size=(3, 160, 160), pool_size=(5, 5), mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5)),
hf_hub_id='timm/',
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
"test_convnext3.r160_in1k": _cfg(
# hf_hub_id='timm/',
input_size=(3, 160, 160), pool_size=(5, 5), mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5)),
hf_hub_id='timm/',
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),

})

Expand Down
15 changes: 7 additions & 8 deletions timm/models/efficientnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1804,19 +1804,18 @@ def _cfg(url='', **kwargs):

"test_efficientnet.r160_in1k": _cfg(
hf_hub_id='timm/',
input_size=(3, 160, 160), pool_size=(5, 5)),
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
"test_efficientnet_ln.r160_in1k": _cfg(
hf_hub_id='timm/',
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
"test_efficientnet_gn.r160_in1k": _cfg(
hf_hub_id='timm/',
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
input_size=(3, 160, 160), pool_size=(5, 5)),
"test_efficientnet_ln.r160_in1k": _cfg(
#hf_hub_id='timm/',
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
input_size=(3, 160, 160), pool_size=(5, 5)),
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
"test_efficientnet_evos.r160_in1k": _cfg(
#hf_hub_id='timm/',
hf_hub_id='timm/',
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
input_size=(3, 160, 160), pool_size=(5, 5)),
input_size=(3, 160, 160), pool_size=(5, 5), crop_pct=0.95),
})


Expand Down
4 changes: 2 additions & 2 deletions timm/models/nfnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,9 @@ def _dcfg(url='', **kwargs):
'nf_ecaresnet101': _dcfg(url='', first_conv='stem.conv'),

'test_nfnet.r160_in1k': _dcfg(
# hf_hub_id='timm/',
hf_hub_id='timm/',
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
crop_pct=0.875, input_size=(3, 160, 160), pool_size=(5, 5)),
crop_pct=0.95, input_size=(3, 160, 160), pool_size=(5, 5)),
})


Expand Down
4 changes: 2 additions & 2 deletions timm/models/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,8 +1304,8 @@ def _gcfg(url='', **kwargs):
first_conv='conv1.0'),

'test_resnet.r160_in1k': _cfg(
#hf_hub_id='timm/',
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
hf_hub_id='timm/',
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5), crop_pct=0.95,
input_size=(3, 160, 160), pool_size=(5, 5), first_conv='conv1.0'),
})

Expand Down
14 changes: 8 additions & 6 deletions timm/models/vision_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2014,13 +2014,13 @@ def _cfg(url: str = '', **kwargs) -> Dict[str, Any]:

'test_vit.r160_in1k': _cfg(
hf_hub_id='timm/',
input_size=(3, 160, 160), crop_pct=0.875),
input_size=(3, 160, 160), crop_pct=0.95),
'test_vit2.r160_in1k': _cfg(
#hf_hub_id='timm/',
input_size=(3, 160, 160), crop_pct=0.875),
hf_hub_id='timm/',
input_size=(3, 160, 160), crop_pct=0.95),
'test_vit3.r160_in1k': _cfg(
#hf_hub_id='timm/',
input_size=(3, 160, 160), crop_pct=0.875),
input_size=(3, 160, 160), crop_pct=0.95),
}

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


@register_model
def test_vit2(pretrained: bool = False, **kwargs) -> VisionTransformer:
""" ViT Test
"""
model_args = dict(
patch_size=16, embed_dim=64, depth=8, num_heads=2, mlp_ratio=3,
class_token=False, reg_tokens=1, global_pool='avg', init_values=1e-5)
class_token=False, reg_tokens=1, global_pool='avg', init_values=1e-5, dynamic_img_size=True)
model = _create_vision_transformer('test_vit2', pretrained=pretrained, **dict(model_args, **kwargs))
return model


@register_model
def test_vit3(pretrained: bool = False, **kwargs) -> VisionTransformer:
""" ViT Test
"""
Expand Down

0 comments on commit 9067be6

Please sign in to comment.