Skip to content

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. 1

    Clone and build from source

    You'll need: Python · PyTorch

    Clone the repository

    git clone https://github.com/microsoft/Swin-Transformer
  2. 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. 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

ProjectStarsTypeLevelUpdatedBest for
Swin-Transformer (this)16.1kAI model / agentadvanced2.3 years agoResearchers reproducing results from the Swin Transformer paper
InternVL10.2kAI model / agentadvanced1.1 years agoResearchers comparing open multimodal models on vision-language benchmarks
albumentations15.3kLibrarybeginner1.4 years agoMachine learning engineers training image classification or segmentation models with limited data
segmentation_models.pytorch11.8kLibraryintermediate4 days agoPython developers building image segmentation models in PyTorch
labelImg25kDev toolbeginner2.4 years agoPeople who need a simple local tool to draw bounding boxes on a small image set
supervision51.5kLibraryintermediate4 days agoPython 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.