timm documentation
MaxViT et CoAtNet
MaxViT et CoAtNet
Catégorie : Hybride · Code : timm/models/maxxvit.py · Architectures : 58 · Poids pré-entraînés : 52 (43 avec des résultats ImageNet-1k)
Implémentations de zéro de MaxViT (blocs MBConv avec attention multi-axes, attention locale et dilatée sur grille bloquée) et CoAtNet (étapes de convolution suivies d'étapes d'attention relative), ainsi que des variantes timm (configurations _rw, MaxxViT).
Articles
- MaxViT : Vision Transformer multi-axes
- CoAtNet : marier convolution et attention pour toutes les tailles de données
Utilisation
Consultez le Démarrage rapide pour le chargement des poids pré-entraînés, le prétraitement des images et l’ajustement fin, ainsi que Extraction de caractéristiques pour utiliser les modèles comme squelettes.
>>> import timm
>>> model = timm.create_model('maxxvitv2_nano_rw_256.sw_in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)Prise en charge de l'API des modèles
✓ pris en charge, ✓ (carré) fonctionne uniquement pour les tailles carrées, ✗ non pris en charge, – non nécessaire (le modèle accepte déjà n'importe quelle taille d'entrée). Vérifié en exécutant chaque fonctionnalité sur un modèle initialisé aléatoirement (MaxxVit avec maxvit_pico_rw_256 à 256), les autres architectures de la même classe sont censées se comporter de la même manière. Consultez la page API du modèle pour plus de détails.
Architectures
| Architecture | Paramètres (M) | GMACs | Taille d'entrée | Poids pré-entraînés |
|---|---|---|---|---|
coatnet_0_224 | 25.04 | 4.58 | 224 | 0 |
coatnet_0_rw_224 | 27.44 | 4.43 | 224 | 1 |
coatnet_1_224 | 42.23 | 8.70 | 224 | 0 |
coatnet_1_rw_224 | 41.72 | 8.04 | 224 | 1 |
coatnet_2_224 | 74.68 | 16.50 | 224 | 0 |
coatnet_2_rw_224 | 73.87 | 15.09 | 224 | 2 |
coatnet_3_224 | 166.97 | 36.56 | 224 | 0 |
coatnet_3_rw_224 | 181.81 | 33.44 | 224 | 1 |
coatnet_4_224 | 275.43 | 62.48 | 224 | 0 |
coatnet_5_224 | 687.47 | 145.49 | 224 | 0 |
coatnet_bn_0_rw_224 | 27.44 | 4.67 | 224 | 1 |
coatnet_nano_cc_224 | 13.76 | 2.24 | 224 | 0 |
coatnet_nano_rw_224 | 15.14 | 2.41 | 224 | 1 |
coatnet_pico_rw_224 | 10.85 | 2.05 | 224 | 0 |
coatnet_rmlp_0_rw_224 | 27.45 | 4.72 | 224 | 0 |
coatnet_rmlp_1_rw2_224 | 41.72 | 8.11 | 224 | 2 |
coatnet_rmlp_1_rw_224 | 41.69 | 7.85 | 224 | 1 |
coatnet_rmlp_2_rw_224 | 73.88 | 15.18 | 224 | 3 |
coatnet_rmlp_2_rw_384 | 73.88 | 47.69 | 384 | 1 |
coatnet_rmlp_3_rw_224 | 165.15 | 33.56 | 224 | 0 |
coatnet_rmlp_nano_rw_224 | 15.15 | 2.62 | 224 | 1 |
coatnext_nano_rw_224 | 14.70 | 2.47 | 224 | 1 |
maxvit_base_tf_224 | 119.47 | 24.04 | 224 | 2 |
maxvit_base_tf_384 | 119.65 | 73.80 | 384 | 2 |
maxvit_base_tf_512 | 119.88 | 138.02 | 512 | 2 |
maxvit_large_tf_224 | 211.79 | 43.68 | 224 | 2 |
maxvit_large_tf_384 | 212.03 | 132.55 | 384 | 2 |
maxvit_large_tf_512 | 212.33 | 244.75 | 512 | 2 |
maxvit_nano_rw_256 | 15.45 | 4.46 | 256 | 1 |
maxvit_pico_rw_256 | 7.46 | 1.83 | 256 | 0 |
maxvit_rmlp_base_rw_224 | 116.14 | 23.15 | 224 | 2 |
maxvit_rmlp_base_rw_384 | 116.14 | 70.97 | 384 | 1 |
maxvit_rmlp_nano_rw_256 | 15.50 | 4.47 | 256 | 1 |
maxvit_rmlp_pico_rw_256 | 7.52 | 1.85 | 256 | 1 |
maxvit_rmlp_small_rw_224 | 64.90 | 10.75 | 224 | 1 |
maxvit_rmlp_small_rw_256 | 64.90 | 14.15 | 256 | 0 |
maxvit_rmlp_tiny_rw_256 | 29.15 | 6.77 | 256 | 1 |
maxvit_small_tf_224 | 68.93 | 11.66 | 224 | 1 |
maxvit_small_tf_384 | 69.02 | 35.87 | 384 | 1 |
maxvit_small_tf_512 | 69.13 | 67.26 | 512 | 1 |
maxvit_tiny_pm_256 | 30.09 | 6.61 | 256 | 0 |
maxvit_tiny_rw_224 | 29.06 | 5.11 | 224 | 1 |
maxvit_tiny_rw_256 | 29.07 | 6.74 | 256 | 0 |
maxvit_tiny_tf_224 | 30.92 | 5.60 | 224 | 1 |
maxvit_tiny_tf_384 | 30.98 | 17.53 | 384 | 1 |
maxvit_tiny_tf_512 | 31.05 | 33.49 | 512 | 1 |
maxvit_xlarge_tf_224 | 506.99 | 97.52 | 224 | 1 |
maxvit_xlarge_tf_384 | 475.32 | 292.78 | 384 | 1 |
maxvit_xlarge_tf_512 | 475.77 | 534.14 | 512 | 1 |
maxxvit_rmlp_nano_rw_256 | 16.78 | 4.37 | 256 | 1 |
maxxvit_rmlp_small_rw_256 | 66.01 | 14.67 | 256 | 1 |
maxxvit_rmlp_tiny_rw_256 | 29.64 | 6.66 | 256 | 0 |
maxxvitv2_nano_rw_256 | 23.70 | 6.26 | 256 | 1 |
maxxvitv2_rmlp_base_rw_224 | 116.09 | 24.20 | 224 | 2 |
maxxvitv2_rmlp_base_rw_384 | 116.09 | 72.98 | 384 | 1 |
maxxvitv2_rmlp_large_rw_224 | 215.42 | 44.14 | 224 | 0 |
test_coatnet | 0.58 | - | 160 | 0 |
test_maxvit | 1.09 | - | 160 | 0 |
Les GMACs et le nombre de paramètres correspondent à la taille d’entrée par défaut et au classifieur de chaque architecture, d’après les résultats des benchmarks.
Poids pré-entraînés
Top-1 est la précision de validation sur ImageNet-1k issue de results-imagenet.csv à la taille d'évaluation indiquée, - si le poids n'a pas de résultat ImageNet-1k (par exemple, poids de pré-entraînement ou poids image-texte). Classes est la taille du classifieur pré-entraîné, aucune pour les poids sans classifieur.
| Poids | Taille d'entrée | Top-1 (%) | Taille d'évaluation | Classes | Licence | Hub |
|---|---|---|---|---|---|---|
coatnet_0_rw_224.sw_in1k | 224 | 82.396 | 224 | 1000 | apache-2.0 | timm |
coatnet_1_rw_224.sw_in1k | 224 | 83.620 | 224 | 1000 | apache-2.0 | timm |
coatnet_2_rw_224.sw_in12k | 224 | - | - | 11821 | apache-2.0 | timm |
coatnet_2_rw_224.sw_in12k_ft_in1k | 224 | 86.582 | 224 | 1000 | apache-2.0 | timm |
coatnet_3_rw_224.sw_in12k | 224 | - | - | 11821 | apache-2.0 | timm |
coatnet_bn_0_rw_224.sw_in1k | 224 | 82.394 | 224 | 1000 | apache-2.0 | timm |
coatnet_nano_rw_224.sw_in1k | 224 | 81.704 | 224 | 1000 | apache-2.0 | timm |
coatnet_rmlp_1_rw2_224.sw_in12k | 224 | - | - | 11821 | apache-2.0 | timm |
coatnet_rmlp_1_rw2_224.sw_in12k_ft_in1k | 224 | 84.940 | 224 | 1000 | apache-2.0 | timm |
coatnet_rmlp_1_rw_224.sw_in1k | 224 | 83.350 | 224 | 1000 | apache-2.0 | timm |
coatnet_rmlp_2_rw_224.sw_in12k | 224 | - | - | 11821 | apache-2.0 | timm |
coatnet_rmlp_2_rw_224.sw_in12k_ft_in1k | 224 | 86.538 | 224 | 1000 | apache-2.0 | timm |
coatnet_rmlp_2_rw_224.sw_in1k | 224 | 84.608 | 224 | 1000 | apache-2.0 | timm |
coatnet_rmlp_2_rw_384.sw_in12k_ft_in1k | 384 | 87.388 | 384 | 1000 | apache-2.0 | timm |
coatnet_rmlp_nano_rw_224.sw_in1k | 224 | 82.064 | 224 | 1000 | apache-2.0 | timm |
coatnext_nano_rw_224.sw_in1k | 224 | 81.998 | 224 | 1000 | apache-2.0 | timm |
maxvit_base_tf_224.in1k | 224 | 84.884 | 224 | 1000 | apache-2.0 | timm |
maxvit_base_tf_224.in21k | 224 | - | - | 21843 | apache-2.0 | timm |
maxvit_base_tf_384.in1k | 384 | 86.290 | 384 | 1000 | apache-2.0 | timm |
maxvit_base_tf_384.in21k_ft_in1k | 384 | 87.930 | 384 | 1000 | apache-2.0 | timm |
maxvit_base_tf_512.in1k | 512 | 86.598 | 512 | 1000 | apache-2.0 | timm |
maxvit_base_tf_512.in21k_ft_in1k | 512 | 88.214 | 512 | 1000 | apache-2.0 | timm |
maxvit_large_tf_224.in1k | 224 | 84.938 | 224 | 1000 | apache-2.0 | timm |
maxvit_large_tf_224.in21k | 224 | - | - | 21843 | apache-2.0 | timm |
maxvit_large_tf_384.in1k | 384 | 86.242 | 384 | 1000 | apache-2.0 | timm |
maxvit_large_tf_384.in21k_ft_in1k | 384 | 87.994 | 384 | 1000 | apache-2.0 | timm |
maxvit_large_tf_512.in1k | 512 | 86.534 | 512 | 1000 | apache-2.0 | timm |
maxvit_large_tf_512.in21k_ft_in1k | 512 | 88.236 | 512 | 1000 | apache-2.0 | timm |
maxvit_nano_rw_256.sw_in1k | 256 | 82.934 | 256 | 1000 | apache-2.0 | timm |
maxvit_rmlp_base_rw_224.sw_in12k | 224 | - | - | 11821 | apache-2.0 | timm |
maxvit_rmlp_base_rw_224.sw_in12k_ft_in1k | 224 | 86.908 | 224 | 1000 | apache-2.0 | timm |
maxvit_rmlp_base_rw_384.sw_in12k_ft_in1k | 384 | 87.810 | 384 | 1000 | apache-2.0 | timm |
maxvit_rmlp_nano_rw_256.sw_in1k | 256 | 82.978 | 256 | 1000 | apache-2.0 | timm |
maxvit_rmlp_pico_rw_256.sw_in1k | 256 | 80.550 | 256 | 1000 | apache-2.0 | timm |
maxvit_rmlp_small_rw_224.sw_in1k | 224 | 84.488 | 224 | 1000 | apache-2.0 | timm |
maxvit_rmlp_tiny_rw_256.sw_in1k | 256 | 84.226 | 256 | 1000 | apache-2.0 | timm |
maxvit_small_tf_224.in1k | 224 | 84.452 | 224 | 1000 | apache-2.0 | timm |
maxvit_small_tf_384.in1k | 384 | 85.534 | 384 | 1000 | apache-2.0 | timm |
maxvit_small_tf_512.in1k | 512 | 86.102 | 512 | 1000 | apache-2.0 | timm |
maxvit_tiny_rw_224.sw_in1k | 224 | 83.522 | 224 | 1000 | apache-2.0 | timm |
maxvit_tiny_tf_224.in1k | 224 | 83.426 | 224 | 1000 | apache-2.0 | timm |
maxvit_tiny_tf_384.in1k | 384 | 85.106 | 384 | 1000 | apache-2.0 | timm |
maxvit_tiny_tf_512.in1k | 512 | 85.658 | 512 | 1000 | apache-2.0 | timm |
maxvit_xlarge_tf_224.in21k | 224 | - | - | 21843 | apache-2.0 | timm |
maxvit_xlarge_tf_384.in21k_ft_in1k | 384 | 88.302 | 384 | 1000 | apache-2.0 | timm |
maxvit_xlarge_tf_512.in21k_ft_in1k | 512 | 88.540 | 512 | 1000 | apache-2.0 | timm |
maxxvit_rmlp_nano_rw_256.sw_in1k | 256 | 83.036 | 256 | 1000 | apache-2.0 | timm |
maxxvit_rmlp_small_rw_256.sw_in1k | 256 | 84.634 | 256 | 1000 | apache-2.0 | timm |
maxxvitv2_nano_rw_256.sw_in1k | 256 | 83.108 | 256 | 1000 | apache-2.0 | timm |
maxxvitv2_rmlp_base_rw_224.sw_in12k | 224 | - | - | 11821 | apache-2.0 | timm |
maxxvitv2_rmlp_base_rw_224.sw_in12k_ft_in1k | 224 | 86.640 | 224 | 1000 | apache-2.0 | timm |
maxxvitv2_rmlp_base_rw_384.sw_in12k_ft_in1k | 384 | 87.480 | 384 | 1000 | apache-2.0 | timm |
Citation
@article{tu2022maxvit,
title={MaxViT: Multi-Axis Vision Transformer},
author={Tu, Zhengzhong and Talebi, Hossein and Zhang, Han and Yang, Feng and Milanfar, Peyman and Bovik, Alan and Li, Yinxiao},
journal={ECCV},
year={2022},
}
@article{DBLP:journals/corr/abs-2106-04803,
author = {Zihang Dai and Hanxiao Liu and Quoc V. Le and Mingxing Tan},
title = {CoAtNet: Marrying Convolution and Attention for All Data Sizes},
journal = {CoRR},
volume = {abs/2106.04803},
year = {2021}
}