Skip to content

Commit 2a84d68

Browse files
committed
Add some so150m vit w/ sbb recipe weights, and a ese_vovnet57b model with RA4 recipe
1 parent 9265d54 commit 2a84d68

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

timm/models/vision_transformer.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,8 +2152,13 @@ def _cfg(url: str = '', **kwargs) -> Dict[str, Any]:
21522152
'vit_base_patch16_reg4_gap_256.untrained': _cfg(
21532153
input_size=(3, 256, 256)),
21542154

2155-
'vit_so150m_patch16_reg4_gap_256.untrained': _cfg(
2156-
input_size=(3, 256, 256)),
2155+
'vit_so150m_patch16_reg4_gap_384.sbb_e250_in12k_ft_in1k': _cfg(
2156+
hf_hub_id='timm/',
2157+
input_size=(3, 384, 384), crop_pct=1.0),
2158+
'vit_so150m_patch16_reg4_gap_256.sbb_e250_in12k': _cfg(
2159+
hf_hub_id='timm/',
2160+
num_classes=11821,
2161+
input_size=(3, 256, 256), crop_pct=0.95),
21572162
'vit_so150m_patch16_reg4_map_256.untrained': _cfg(
21582163
input_size=(3, 256, 256)),
21592164

@@ -3482,6 +3487,17 @@ def vit_so150m_patch16_reg4_gap_256(pretrained: bool = False, **kwargs) -> Visio
34823487
return model
34833488

34843489

3490+
@register_model
3491+
def vit_so150m_patch16_reg4_gap_384(pretrained: bool = False, **kwargs) -> VisionTransformer:
3492+
model_args = dict(
3493+
patch_size=16, embed_dim=896, depth=18, num_heads=14, mlp_ratio=2.572,
3494+
class_token=False, reg_tokens=4, global_pool='avg', fc_norm=False,
3495+
)
3496+
model = _create_vision_transformer(
3497+
'vit_so150m_patch16_reg4_gap_384', pretrained=pretrained, **dict(model_args, **kwargs))
3498+
return model
3499+
3500+
34853501
@register_model
34863502
def vit_intern300m_patch14_448(pretrained: bool = False, **kwargs) -> VisionTransformer:
34873503
model_args = dict(

timm/models/vovnet.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,12 @@ def _cfg(url='', **kwargs):
419419
'ese_vovnet39b.ra_in1k': _cfg(
420420
hf_hub_id='timm/',
421421
test_input_size=(3, 288, 288), test_crop_pct=0.95),
422-
'ese_vovnet57b.untrained': _cfg(url=''),
422+
'ese_vovnet57b.ra4_e3600_r256_in1k': _cfg(
423+
hf_hub_id='timm/',
424+
mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5),
425+
crop_pct=0.95, input_size=(3, 256, 256), pool_size=(8, 8),
426+
test_input_size=(3, 320, 320), test_crop_pct=1.0
427+
),
423428
'ese_vovnet99b.untrained': _cfg(url=''),
424429
'eca_vovnet39b.untrained': _cfg(url=''),
425430
'ese_vovnet39b_evos.untrained': _cfg(url=''),

0 commit comments

Comments
 (0)