@@ -40,22 +40,22 @@ def _cfg(url='', **kwargs):
4040
4141default_cfgs = {
4242 'twins_pcpvt_small' : _cfg (
43- url = 'https://s3plus.meituan.net/v1/mss_9240d97c6bf34ab1b78859c3c2a2a3e4/automl-model-zoo/ models/twins/pcpvt_small .pth' ,
43+ url = 'https://github.com/rwightman/pytorch-image- models/releases/download/v0.1-vt3p-weights/twins_pcpvt_small-e70e7e7a .pth' ,
4444 ),
4545 'twins_pcpvt_base' : _cfg (
46- url = 'https://s3plus.meituan.net/v1/mss_9240d97c6bf34ab1b78859c3c2a2a3e4/automl-model-zoo/ models/twins/pcpvt_base .pth' ,
46+ url = 'https://github.com/rwightman/pytorch-image- models/releases/download/v0.1-vt3p-weights/twins_pcpvt_base-e5ecb09b .pth' ,
4747 ),
4848 'twins_pcpvt_large' : _cfg (
49- url = 'https://s3plus.meituan.net/v1/mss_9240d97c6bf34ab1b78859c3c2a2a3e4/automl-model-zoo/ models/twins/pcpvt_large .pth' ,
49+ url = 'https://github.com/rwightman/pytorch-image- models/releases/download/v0.1-vt3p-weights/twins_pcpvt_large-d273f802 .pth' ,
5050 ),
5151 'twins_svt_small' : _cfg (
52- url = 'https://s3plus.meituan.net/v1/mss_9240d97c6bf34ab1b78859c3c2a2a3e4/automl-model-zoo/ models/twins/alt_gvt_small .pth' ,
52+ url = 'https://github.com/rwightman/pytorch-image- models/releases/download/v0.1-vt3p-weights/twins_svt_small-42e5f78c .pth' ,
5353 ),
5454 'twins_svt_base' : _cfg (
55- url = 'https://s3plus.meituan.net/v1/mss_9240d97c6bf34ab1b78859c3c2a2a3e4/automl-model-zoo/ models/twins/alt_gvt_base .pth' ,
55+ url = 'https://github.com/rwightman/pytorch-image- models/releases/download/v0.1-vt3p-weights/twins_svt_base-c2265010 .pth' ,
5656 ),
5757 'twins_svt_large' : _cfg (
58- url = 'https://s3plus.meituan.net/v1/mss_9240d97c6bf34ab1b78859c3c2a2a3e4/automl-model-zoo/ models/twins/alt_gvt_large .pth' ,
58+ url = 'https://github.com/rwightman/pytorch-image- models/releases/download/v0.1-vt3p-weights/twins_svt_large-90f6aaa9 .pth' ,
5959 ),
6060}
6161
@@ -266,7 +266,10 @@ def forward(self, x) -> Tuple[torch.Tensor, Size_]:
266266
267267
268268class Twins (nn .Module ):
269- # Adapted from PVT https://github.com/whai362/PVT.git
269+ """ Twins Vision Transfomer (Revisiting Spatial Attention)
270+
271+ Adapted from PVT (PyramidVisionTransformer) class at https://github.com/whai362/PVT.git
272+ """
270273 def __init__ (
271274 self , img_size = 224 , patch_size = 4 , in_chans = 3 , num_classes = 1000 , embed_dims = (64 , 128 , 256 , 512 ),
272275 num_heads = (1 , 2 , 4 , 8 ), mlp_ratios = (4 , 4 , 4 , 4 ), drop_rate = 0. , attn_drop_rate = 0. , drop_path_rate = 0. ,
0 commit comments