# lucidrains/vit-pytorch

Implementation of Vision Transformer, a simple way to achieve SOTA in vision classification with only a single transformer encoder, in Pytorch

Repository: https://github.com/lucidrains/vit-pytorch
Canonical: https://ross.abutalabs.com/products/vit-pytorch
Language: Python
License: MIT
License Family: permissive
Topics: artificial-intelligence, attention-mechanism, transformers, computer-vision, image-classification
Last push: 2026-08-02T15:23:44+00:00

## Health v2 (maintenance only)
Score: 87/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 70, longevity 100
- inputs: {"age_days": 2160, "days_push": 31, "days_rel": 203, "gap_med": 3.0, "n_releases_24m": 51}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 25488, forks 3492 (observed 2026-08-28T04:11:38.178183+00:00)

## What it is
A PyTorch library implementing the Vision Transformer (ViT) and dozens of ViT variants (NaViT, MaxViT, MobileViT, Dino, masked autoencoders, and more) for image classification and vision research. It provides clean, minimal model definitions without pretrained weights.

## Use cases
- implement vision transformer in pytorch
- train an image classifier with a transformer encoder
- experiment with ViT variants like NaViT or MaxViT
- research attention mechanisms for images
- build a masked autoencoder for images
- apply transformers to video classification

## When to choose
- you want readable, hackable PyTorch ViT implementations for research or experimentation
- you need many transformer vision architectures in one pip-installable package
- you are learning how vision transformers work from clean code

## When to avoid
- you need pretrained weights for production use - use timm instead
- you need a full training pipeline, data loading, or deployment tooling
- you work in TensorFlow, JAX, or a non-PyTorch stack

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, deep-learning, image-processing
- domain: computer-vision, deep-learning, machine-learning, artificial-intelligence
- platform: python
- tags: vision-transformer, pytorch, image-classification, attention, transformer-architectures, research-code

## Member repositories
- lucidrains/vit-pytorch (main) score 87

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:38.178183+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:56:02.953465+00:00, confidence not recorded.
  - readme: https://github.com/lucidrains/vit-pytorch (fetched 2026-08-28T04:11:38.178183+00:00, sha 621c223e5dc3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
