timm
PyTorch Image Models (timm)
A huge collection of vision architectures and their pretrained weights for PyTorch, from CNNs to Vision Transformers.
Basic information
| Name | timm |
|---|---|
| Full name | PyTorch Image Models (timm) |
| Category | Computer Vision & Image Processing |
| Developer | Ross Wightman, hosted by Hugging Face |
| Release year | Not specified |
| Official website | github.com/huggingface/pytorch-image-models |
| GitHub repository | huggingface/pytorch-image-models |
| Official documentation | huggingface.co/docs/timm/en/index |
| Package on PyPI | timm |
| License | Apache-2.0 (PyPI license) |
| Project status | Active Had a release in the last 12 months |
| Latest version | 3 November 2026 (version 1.0.31) |
| Programming language | Python |
| Operating systems | Not specified |
| Required Python version | >=3.10 |
| Difficulty level | Medium |
Data last checked: 21 November 2026 — source: PyPI JSON API (2026-11-21)
Overview
timm includes hundreds of architectures (ResNet, EfficientNet, ConvNeXt, ViT, Swin, DeiT and others) behind a unified timm.create_model API, with pretrained weights on the Hugging Face Hub, plus training tools, optimizers and learning-rate schedulers.
It is the practical reference for trying vision transformers and swapping the backbone in models.
When to choose it? Choose it to try modern vision architectures and vision transformers with ready weights.
Uses
Main uses
- Transfer learning with modern architectures
- Transfer learning with modern architectures
- Trying vision transformers
- Trying vision transformers
- Feature extraction as a backbone for other models
- Feature extraction as a backbone for other models
Scientific fields
- Computer vision
- Computer vision
- Medical imaging
- Medical imaging
Suitable project types
- An image classifier with ViT or ConvNeXt
- An image classifier with ViT or ConvNeXt
Research applications
- Comparing vision architectures under unified settings
- Comparing vision architectures under unified settings
Technical features
A feature is shown as "Supported" only if it is documented in the library's official documentation; anything we have not verified is shown as "Not specified".
| CPU support | Supported |
|---|---|
| GPU support | Supported |
| CUDA compatibility | Supported |
| Distributed training or computing | Partial or through an add-onThe included training script supports distribution. |
| Automatic differentiation (Autodiff) | SupportedThrough PyTorch. |
| Model deployment | Partial or through an add-on |
| Pre-trained models | Supported |
| Supported data types | PyTorch tensors |
| Integration with other libraries | PyTorch, TorchVision, Hugging Face Transformers |
| Flexibility (editorial estimate) | High |
| Performance (editorial estimate) | High |
| Community (editorial estimate) | Large |
| Documentation quality (editorial estimate) | Documentation on Hugging Face |
Installation and running
pip install timmCompatibility: Python >=3.10 — according to the package data on PyPI, checked on 21 November 2026
Compatibility: Python >=3.10 — according to the package data on PyPI, checked on 21 November 2026
Installing inside a virtual environment (venv or conda) is recommended. If you need compatibility with a specific CUDA version or operating system, refer to the official documentation, because this information changes with every release.
Code examples
Examples marked "Run and tested" were actually run, with their output, test date and library versions recorded; the others need a GPU or model downloads, so they were not run in the test environment.
MediumCreating a Vision Transformer with timmRun and tested
Goal: Listing the available models and creating a small ViT with a custom number of classes.
import timm, torch
print("Number of registered ViT models:", len(timm.list_models("vit_*")))
model = timm.create_model("vit_tiny_patch16_224", pretrained=False, num_classes=3).eval()
x = torch.randn(2, 3, 224, 224)
with torch.no_grad():
feats = model.forward_features(x)
logits = model(x)
print("Feature shape (batch, patches+CLS, dims):", tuple(feats.shape))
print("Output shape:", tuple(logits.shape))
Code explanation
list_models searches model names by pattern, and create_model creates the model. We use pretrained=False because the weights are downloaded from the Hugging Face Hub; in your project set it to True for transfer learning. forward_features returns the patch representation before the classification head.
Output recorded during testing
Number of registered ViT models: 214 Feature shape (batch, patches+CLS, dims): (2, 197, 192) Output shape: (2, 3)
This example was actually run and tested on 21 November 2026 on a CPU — timm 1.0.31, torch 2.15.0, python 3.13.18
Pros
- The largest collection of vision architectures behind a unified API
- Many pretrained weights
Limitations
- Downloading weights requires access to the Hugging Face Hub
- The many options can confuse beginners
References and verification
- Package page on PyPI (source of the version, licence and release date) Checked directly
https://pypi.org/project/timm/
Checked on: 21 November 2026 — version checked: 1.0.31 — reviewed by: the DLArabic team
- Official website A link the package officially declares on PyPI
https://github.com/huggingface/pytorch-image-models
Checked on: 21 November 2026 — reviewed by: the DLArabic team
- Official documentation A link the package officially declares on PyPI
https://huggingface.co/docs/timm/en/index
Checked on: 21 November 2026 — reviewed by: the DLArabic team
- Official repository A link the package officially declares on PyPI
https://github.com/huggingface/pytorch-image-models
Checked on: 21 November 2026 — reviewed by: the DLArabic team
- Package page on PyPI (source of the version, licence and release date) Checked directly
https://pypi.org/project/timm/
Checked on: 21 November 2026 — version checked: 1.0.31 — reviewed by: the DLArabic team
- Official website A link the package officially declares on PyPI
https://github.com/huggingface/pytorch-image-models
Checked on: 21 November 2026 — reviewed by: the DLArabic team
- Official documentation A link the package officially declares on PyPI
https://huggingface.co/docs/timm/en/index
Checked on: 21 November 2026 — reviewed by: the DLArabic team
- Official repository A link the package officially declares on PyPI
https://github.com/huggingface/pytorch-image-models
Checked on: 21 November 2026 — reviewed by: the DLArabic team
History of verified versions
| Version | Release date | Checked on |
|---|---|---|
| 1.0.31 | 3 November 2026 | 21 November 2026 |
Page information last reviewed: 21 November 2026. The description was written originally for the encyclopedia and is not copied from the official websites.
