◐ModelVision & ImageFree
timm (PyTorch Image Models)
The largest collection of pretrained image models for PyTorch — ViT, ConvNeXt, EfficientNet, Swin, and 900+ more.
timm — PyTorch Image Models
timm is Ross Wightman's ever-expanding collection of state-of-the-art image models, pretrained weights, and training utilities for PyTorch. With 900+ model architectures and thousands of pretrained checkpoints, it is the go-to library for transfer learning, feature extraction, and vision benchmarking.
Key Features
- 900+ model architectures: ViT, DeiT, Swin, ConvNeXt, EfficientNet, RegNet, ResNet, and more
- Thousands of pretrained weights from ImageNet, ImageNet-21k, LAION, and domain-specific datasets
- Universal
create_model()API with consistent feature extraction interface - Optimised data augmentation (RandAugment, MixUp, CutMix) and training recipes
- ONNX and TorchScript export;
timm.onnxhelper for direct export
Quick Start
pip install timm
import timm
import torch
model = timm.create_model("convnext_base.fb_in22k", pretrained=True)
model.eval()
data_cfg = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_cfg, is_training=False)
from PIL import Image
img = transforms(Image.open("image.jpg")).unsqueeze(0)
with torch.no_grad():
output = model(img)
print(output.topk(5))
npx ai-supply add timm-image-models
Curated mirror of the open-source pytorch-image-models (Apache-2.0). Get it from the source.