@@ -64,6 +64,8 @@ def _cfg(url='', **kwargs):
6464 'deit3_small_patch16_384' : _cfg (
6565 url = 'https://dl.fbaipublicfiles.com/deit/deit_3_small_384_1k.pth' ,
6666 input_size = (3 , 384 , 384 ), crop_pct = 1.0 ),
67+ 'deit3_medium_patch16_224' : _cfg (
68+ url = 'https://dl.fbaipublicfiles.com/deit/deit_3_medium_224_1k.pth' ),
6769 'deit3_base_patch16_224' : _cfg (
6870 url = 'https://dl.fbaipublicfiles.com/deit/deit_3_base_224_1k.pth' ),
6971 'deit3_base_patch16_384' : _cfg (
@@ -83,6 +85,9 @@ def _cfg(url='', **kwargs):
8385 'deit3_small_patch16_384_in21ft1k' : _cfg (
8486 url = 'https://dl.fbaipublicfiles.com/deit/deit_3_small_384_21k.pth' ,
8587 input_size = (3 , 384 , 384 ), crop_pct = 1.0 ),
88+ 'deit3_medium_patch16_224_in21ft1k' : _cfg (
89+ url = 'https://dl.fbaipublicfiles.com/deit/deit_3_medium_224_21k.pth' ,
90+ crop_pct = 1.0 ),
8691 'deit3_base_patch16_224_in21ft1k' : _cfg (
8792 url = 'https://dl.fbaipublicfiles.com/deit/deit_3_base_224_21k.pth' ,
8893 crop_pct = 1.0 ),
@@ -290,6 +295,17 @@ def deit3_small_patch16_384(pretrained=False, **kwargs):
290295 return model
291296
292297
298+ @register_model
299+ def deit3_medium_patch16_224 (pretrained = False , ** kwargs ):
300+ """ DeiT-3 medium model @ 224x224 (https://arxiv.org/abs/2012.12877).
301+ ImageNet-1k weights from https://github.com/facebookresearch/deit.
302+ """
303+ model_kwargs = dict (
304+ patch_size = 16 , embed_dim = 512 , depth = 12 , num_heads = 8 , no_embed_class = True , init_values = 1e-6 , ** kwargs )
305+ model = _create_deit ('deit3_medium_patch16_224' , pretrained = pretrained , ** model_kwargs )
306+ return model
307+
308+
293309@register_model
294310def deit3_base_patch16_224 (pretrained = False , ** kwargs ):
295311 """ DeiT-3 base model @ 224x224 from paper (https://arxiv.org/abs/2204.07118).
@@ -367,6 +383,17 @@ def deit3_small_patch16_384_in21ft1k(pretrained=False, **kwargs):
367383 return model
368384
369385
386+ @register_model
387+ def deit3_medium_patch16_224_in21ft1k (pretrained = False , ** kwargs ):
388+ """ DeiT-3 medium model @ 224x224 (https://arxiv.org/abs/2012.12877).
389+ ImageNet-1k weights from https://github.com/facebookresearch/deit.
390+ """
391+ model_kwargs = dict (
392+ patch_size = 16 , embed_dim = 512 , depth = 12 , num_heads = 8 , no_embed_class = True , init_values = 1e-6 , ** kwargs )
393+ model = _create_deit ('deit3_medium_patch16_224_in21ft1k' , pretrained = pretrained , ** model_kwargs )
394+ return model
395+
396+
370397@register_model
371398def deit3_base_patch16_224_in21ft1k (pretrained = False , ** kwargs ):
372399 """ DeiT-3 base model @ 224x224 from paper (https://arxiv.org/abs/2204.07118).
0 commit comments