
Swin Transformer
Official code and pretrained models for Swin Transformer, a vision model for image recognition tasks.
- Stars
- 16.1k
- Forks
- 2.2k
- Licence
- MIT
- Language
- Python
- Last update
- 2.3 years ago
- Type
- AI model / agent
This repository is archived and no longer maintained.
What it is
This is the official research code for Swin Transformer, a neural network architecture that analyzes images using a hierarchy of windowed attention. The README describes it as a general-purpose backbone for computer vision, and the repo includes code and pretrained models for image classification, with links to related projects for detection, segmentation, and video. The repository is archived, so it is no longer actively maintained.
- Classify images using pretrained ImageNet-1K or ImageNet-22K Swin models listed in the README
- Train or fine-tune a Swin model on an image classification dataset
- Use Swin as a backbone for downstream tasks by following the linked detection or segmentation repos
- Experiment with SimMIM masked image pretraining, per the README's get_started guide
Great for
- Researchers reproducing results from the Swin Transformer paper
- Developers who want pretrained vision backbones for image classification
- Students studying hierarchical vision transformer designs
- Teams fine-tuning a pretrained image model on their own labeled images
Not ideal for
- Non-programmers looking for a ready-made app, since the project is code for training and evaluating models
- Projects needing active maintenance or new fixes, since the repository is archived
- Users who need object detection or segmentation from this repo alone, since the README points to separate repositories for those tasks
How to get it
- 1
Clone and build from source
You'll need: Python · PyTorch
Clone the repository
git clone https://github.com/microsoft/Swin-Transformer - 2
Run it
- Clone the repository and read get_started.md for the classification quick start
- Install the Python dependencies listed in the guide
- Download a pretrained checkpoint from the links in the README
- Run the classification evaluation or training script described in get_started.md
- 3
Get the most out of it
- Start with get_started.md, which the README names as the quick start for image classification
- Use the SimMIM pretraining section if you want to study masked image modeling
- Check the linked Swin Transformer detection and segmentation repos for those tasks
- Review the MODELHUB reference mentioned in the README to pick a checkpoint size
Downloads
Strengths
- Official implementation tied directly to the published paper
- Multiple pretrained checkpoints are provided, as described in the README
- Permissive MIT license
Trade-offs
- The repository is archived, so it is unlikely to receive updates
- Detection, segmentation, and video features live in separate repositories
- The README is truncated here, so setup details beyond the linked guide are not verified
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| Swin-Transformer (this) | 16.1k | AI model / agent | advanced | 2.3 years ago | Researchers reproducing results from the Swin Transformer paper |
| InternVL | 10.2k | AI model / agent | advanced | 1.1 years ago | Researchers comparing open multimodal models on vision-language benchmarks |
| albumentations | 15.3k | Library | beginner | 1.4 years ago | Machine learning engineers training image classification or segmentation models with limited data |
| segmentation_models.pytorch | 11.8k | Library | intermediate | 4 days ago | Python developers building image segmentation models in PyTorch |
| labelImg | 25k | Dev tool | beginner | 2.4 years ago | People who need a simple local tool to draw bounding boxes on a small image set |
| supervision | 51.5k | Library | intermediate | 4 days ago | Python developers building apps on top of object detection or segmentation models |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.