timm
PyTorch Image Models
What it is and what it does
Timm is a model zoo and training framework for PyTorch image models. It bundles hundreds of pretrained architectures—vision transformers (ViT, EVA, DINOv3), efficient CNNs (EfficientNet, ConvNeXt), and hybrid designs—with their weights hosted on Hugging Face Hub. You use it to load a pretrained model in one line, fine-tune it on your data, or extract features for downstream tasks.
The package depends on torch, torchvision, pyyaml, huggingface_hub, and safetensors. It supports Python 3.8–3.12 and is actively maintained; recent releases add new model families (DINOv3, MobileCLIP-2, SigLIP-2), optimizer variants (Muon, NAdaMuon), and infrastructure improvements (meta-device initialization, pickle security hardening). Training and inference scripts are included.
Use it for:
- Load a pretrained ViT or ConvNeXt model and fine-tune it on your image classification dataset.
- Extract intermediate feature maps from a pretrained model for use in a downstream vision task.
- Benchmark inference speed and accuracy across multiple model architectures on your hardware.
- Train a custom image model from scratch using timm's training scripts and optimizer support.
- Integrate a pretrained encoder (e.g., DINOv3 ViT) into a multimodal or self-supervised pipeline.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Timm provides a large collection of pretrained PyTorch image models—vision transformers, CNNs, and hybrid architectures—with utilities for loading weights, training, and inference.
Yes. Timm is a mature, actively maintained library with no known vulnerabilities, permissive licensing, and low install friction. It is the de facto standard for accessing a diverse set of pretrained image models in PyTorch. Install it if you need pretrained models, model zoo access, or a training framework for vision tasks.
Install
timm on PyPI
pip
pip install timmuv
uv add timmpoetry
poetry add timmInstalling timm
Before you install
Low friction: pure Python wheel with five runtime dependencies (torch, torchvision, pyyaml, huggingface_hub, safetensors). Active maintenance—last commit 2026-08-11, release 34 days ago—with a large repository (37066 stars) and consistent updates.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and state significant changes.
Quickstart
pip install timm
import timm
model = timm.create_model('vit_base_patch16', pretrained=True)
output = model(torch.randn(1, 3, 256, 256))
Requires torch and torchvision; model inference requires compatible GPU or CPU with sufficient memory depending on model size.
Verify before relying
- Specific input image dimensions and memory requirements for different model families.
- Compatibility guarantees across PyTorch versions beyond the tested range (1.13 to 2.9.1).
- Whether all model variants and pretrained weights remain available on Hugging Face Hub.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — torch, torchvision, pyyaml, huggingface_hub, safetensors |
| Maintenance | actively maintained — 34 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 15,367,053/month — #1,189 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: timm-1.0.28-py3-none-any.whl
Keywords: pytorch, image-classification
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
effdetPyTorch implementation of EfficientDet object…
permissive · top 15,000 on PyPI
segmentation-models-pytorchProvides PyTorch-based neural network models…
permissive · top 15,000 on PyPI
vit-pytorchProvides PyTorch implementations of Vision…
permissive · top 15,000 on PyPI
efficientnet-pytorchLoads and runs pretrained EfficientNet image…
permissive · top 15,000 on PyPI
torchxrayvisionTorchXRayVision provides pre-trained deep…
permissive · top 15,000 on PyPI
pretrainedmodelsProvides a unified interface to load pretrained…
permissive · top 15,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
open-clip-torchOpenCLIP provides open-source implementations…
permissive · top 5,000 on PyPI
torch-emaComputes exponential moving averages of PyTorch…
unclear · top 15,000 on PyPI
pyiqaPyIQA provides a PyTorch-based toolbox for…
noncommercial · top 15,000 on PyPI