|
38 | 38 | from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD |
39 | 39 | from timm.layers import Mlp, LayerNorm, DropPath, trunc_normal_, to_2tuple |
40 | 40 |
|
41 | | -from timm.models._builder import build_model_with_cfg |
42 | | -from timm.models._features import feature_take_indices |
43 | | -from timm.models._manipulate import checkpoint |
44 | | -from timm.models._registry import generate_default_cfgs, register_model |
| 41 | +from ._builder import build_model_with_cfg |
| 42 | +from ._features import feature_take_indices |
| 43 | +from ._manipulate import checkpoint |
| 44 | +from ._registry import generate_default_cfgs, register_model |
45 | 45 |
|
46 | 46 | def get_sinusoid_encoding(n_position: int, d_hid: int) -> torch.Tensor: |
47 | 47 | ''' Sinusoid position encoding table using PyTorch ''' |
@@ -267,7 +267,6 @@ def forward(self, x: torch.Tensor) -> torch.Tensor: |
267 | 267 |
|
268 | 268 | # final tokens |
269 | 269 | x = self.project(x) |
270 | | - |
271 | 270 | return x |
272 | 271 |
|
273 | 272 | class Attention(nn.Module): |
@@ -597,40 +596,40 @@ def checkpoint_filter_fn( |
597 | 596 |
|
598 | 597 | default_cfgs = generate_default_cfgs({ |
599 | 598 | 't2t_vit_7.in1k': _cfg( |
600 | | - hf_hub_id='timm/', |
601 | | - # url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/71.7_T2T_ViT_7.pth.tar', |
| 599 | + # hf_hub_id='timm/', |
| 600 | + url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/71.7_T2T_ViT_7.pth.tar', |
602 | 601 | ), |
603 | 602 | 't2t_vit_10.in1k': _cfg( |
604 | | - hf_hub_id='timm/', |
605 | | - # url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/75.2_T2T_ViT_10.pth.tar' |
| 603 | + # hf_hub_id='timm/', |
| 604 | + url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/75.2_T2T_ViT_10.pth.tar' |
606 | 605 | ), |
607 | 606 | 't2t_vit_12.in1k': _cfg( |
608 | | - hf_hub_id='timm/', |
609 | | - # url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/76.5_T2T_ViT_12.pth.tar' |
| 607 | + # hf_hub_id='timm/', |
| 608 | + url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/76.5_T2T_ViT_12.pth.tar' |
610 | 609 | ), |
611 | 610 | 't2t_vit_14.in1k': _cfg( |
612 | | - hf_hub_id='timm/', |
613 | | - # url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/81.5_T2T_ViT_14.pth.tar' |
| 611 | + # hf_hub_id='timm/', |
| 612 | + url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/81.5_T2T_ViT_14.pth.tar' |
614 | 613 | ), |
615 | 614 | 't2t_vit_19.in1k': _cfg( |
616 | | - f_hub_id='timm/', |
617 | | - # url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/81.9_T2T_ViT_19.pth.tar' |
| 615 | + # f_hub_id='timm/', |
| 616 | + url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/81.9_T2T_ViT_19.pth.tar' |
618 | 617 | ), |
619 | 618 | 't2t_vit_24.in1k': _cfg( |
620 | | - hf_hub_id='timm/', |
621 | | - # url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/82.3_T2T_ViT_24.pth.tar' |
| 619 | + # hf_hub_id='timm/', |
| 620 | + url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/82.3_T2T_ViT_24.pth.tar' |
622 | 621 | ), |
623 | 622 | 't2t_vit_t_14.in1k': _cfg( |
624 | | - hf_hub_id='timm/', |
625 | | - # url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/81.7_T2T_ViTt_14.pth.tar' |
| 623 | + # hf_hub_id='timm/', |
| 624 | + url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/81.7_T2T_ViTt_14.pth.tar' |
626 | 625 | ), |
627 | 626 | 't2t_vit_t_19.in1k': _cfg( |
628 | | - hf_hub_id='timm/', |
629 | | - # url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/82.4_T2T_ViTt_19.pth.tar' |
| 627 | + # hf_hub_id='timm/', |
| 628 | + url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/82.4_T2T_ViTt_19.pth.tar' |
630 | 629 | ), |
631 | 630 | 't2t_vit_t_24.in1k': _cfg( |
632 | | - hf_hub_id='timm/', |
633 | | - # url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/82.6_T2T_ViTt_24.pth.tar' |
| 631 | + # hf_hub_id='timm/', |
| 632 | + url='https://github.com/yitu-opensource/T2T-ViT/releases/download/main/82.6_T2T_ViTt_24.pth.tar' |
634 | 633 | ), |
635 | 634 | }) |
636 | 635 |
|
|
0 commit comments