vit-pytorch
Vision Transformer (ViT) - Pytorch
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has low install friction, carries permissive MIT licensing, and offers a comprehensive suite of transformer vision models backed by recent research. It is well-suited for both research prototyping and production image classification systems. No known vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires torch and torchvision to be installed; GPU recommended for practical training but not required for inference on small batches.
- Low install friction with a pure Python wheel.
- Actively maintained with a recent release.
License · maintenance · safety
permissive license (permissive) — MIT License permits free use, modification, and distribution with minimal restrictions—suitable for both research and commercial projects.
last release 2026-08-02 (12 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 184,548 downloads/mo, #10,033 on PyPI
Alternatives
Verify before relying
pip install vit-pytorch
import torch
from vit_pytorch import ViT
v = ViT(
image_size=256,
patch_size=32,
num_classes=1000,
dim=1024,
depth=6,
heads=16,
mlp_dim=2048
)
img = torch.randn(1, 3, 256, 256)
preds = v(img)- Whether pretrained model weights are included or must be sourced separately
- GPU memory requirements for different model variants and batch sizes
- Training time and convergence characteristics compared to CNN baselines
What it is and what it does
vit-pytorch is a collection of PyTorch implementations of Vision Transformer architectures and related vision models. It provides the core ViT model alongside numerous variants—SimpleViT, NaViT, CaiT, Token-to-Token ViT, LeViT, MobileViT, and others—each addressing different efficiency or accuracy trade-offs. The package also includes support for self-supervised learning techniques like masked autoencoders and masked image modeling, as well as knowledge distillation from convolutional networks.
The library is designed for researchers and practitioners building image classification systems with transformers. It depends on torch for computation, torchvision for standard vision utilities, and einops for flexible tensor reshaping. Models are instantiated with configurable parameters (patch size, embedding dimension, depth, attention heads, dropout rates) and accept batches of images as input, returning class predictions or intermediate representations.
Use it for
- Train a vision transformer from scratch on a custom image classification dataset using the base ViT or SimpleViT variant
- Distill knowledge from a pretrained ResNet or other CNN teacher into a smaller, faster ViT student model
- Implement masked image modeling or masked autoencoder pretraining for self-supervised representation learning
- Experiment with variable-resolution image batching using NaViT for faster training on mixed-size datasets
- Deploy efficient vision models on resource-constrained devices using MobileViT or LeViT variants
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has low install friction, carries permissive MIT licensing, and offers a comprehensive suite of transformer vision models backed by recent research. It is well-suited for both research prototyping and production image classification systems. No known vulnerabilities.
Install
vit-pytorch on PyPI
Before you install
Low install friction with a pure Python wheel. Actively maintained with a recent release. Depends on torch and torchvision, which are standard deep learning libraries, plus einops for tensor operations.
Requires torch and torchvision to be installed; GPU recommended for practical training but not required for inference on small batches.
License in practice
MIT License permits free use, modification, and distribution with minimal restrictions—suitable for both research and commercial projects.
Quickstart
pip install vit-pytorch
import torch
from vit_pytorch import ViT
v = ViT(
image_size=256,
patch_size=32,
num_classes=1000,
dim=1024,
depth=6,
heads=16,
mlp_dim=2048
)
img = torch.randn(1, 3, 256, 256)
preds = v(img)
Verify before relying
- Whether pretrained model weights are included or must be sourced separately
- GPU memory requirements for different model variants and batch sizes
- Training time and convergence characteristics compared to CNN baselines
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packageseinopstorchtorchvision |
| Maintenance | Actively maintained 12 days since the last release |
| First released | |
| Downloads | 184,548 / month, #10,033 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Artificial Intelligence |
Evidence: vit_pytorch-1.24.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “vision transformer pytorch”
- vit-pytorchProvides PyTorch implementations of Vision Transformer (ViT) and…
- x-transformersx-transformers provides modular transformer building blocks—encoder,…
- timmTimm provides a large collection of pretrained PyTorch image…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also conformer · timm · vector-quantize-pytorch · x-transformers · rotary-embedding-torch · CoLT5-attention · local-attention · axial-positional-embedding · rfdetr · ema-pytorch