A PyTorch package that implements Vision Transformer and many published vision transformer architectures for image classification and related research. You import model classes and configure them for training or experimentation.
Overview
This package provides PyTorch code for the Vision Transformer (ViT) approach to vision classification using a transformer encoder, along with a large catalog of follow-on architectures described in research papers. Coverage spans simple and efficient ViTs, hybrid convolution-attention designs, masked image modeling, distillation helpers, and architectures aimed at mobile or small datasets.
Typical use is to install the package, instantiate a specific model class (for example a standard ViT, SimpleViT, or a named variant such as MaxViT or MobileViT), and pass tensors through it in a training or inference script. Documentation in the project outlines constructor parameters such as image size, patch size, depth, heads, and class count.
Many entries in the catalog mirror published methods: multi-scale or cross-attention variants, local-global attention patterns, token merging or dropping, 3D and video formulations, and integration with techniques from adjacent transformer work. Some sections note companion official or pretrained checkpoints maintained elsewhere.
The scope is implementation and experimentation rather than a standalone application. Researchers and engineers choose among the provided classes to match a paper or baseline they want to reproduce or extend in PyTorch.
Key features
- Core Vision Transformer implementation
- Many published ViT architecture variants
- Configurable image and patch sizes
- Distillation-oriented model classes
- Masked autoencoder and SimMIM support
- Attention inspection utilities
- 3D and video transformer options
- Mobile and compact transformer models
Use cases
- Reproducing vision transformer papers
- Image classification research in PyTorch
- Comparing ViT architecture families
- Experimenting with masked image pre-training