huggingface/pytorch-image-models
The largest collection of PyTorch image encoders / backbones. Including train, eval, inference, export scripts, and pretrained weights -- ResNet, ResNeXT, EfficientNet, NFNet, Vision Transformer (ViT), MobileNetV4, MobileNet-V3 & V2, RegNet, DPN, CSPNet, Swin Transformer, MaxViT, CoAtNet, ConvNeXt, and more
What it solves
Building and training state-of-the-art image models from scratch is time-consuming. timm provides a wide range of pretrained model architectures, plus all the supporting pieces (optimizers, schedulers, data loaders, augmentations, and training scripts) needed to train or fine-tune them and reproduce strong results like ImageNet.
How it works
timm is a Python package that collects model definitions for many popular vision architectures (ViT, ResNet, EfficientNet, ConvNeXt, etc.), each with optional pretrained weights. It also includes a set of training and validation scripts along with pluggable components: optimizers (like AdamW, Muon, LAMB), learning-rate schedulers (cosine, WSD, etc.), data loading and augmentation pipelines, and utilities for resizing models, extracting features, and more. Users can instantiate a model with a few lines, load pretrained weights, and either use it for inference or fine-tune it with the provided training loop.
Who it's for
Researchers and practitioners working with computer vision who need a broad set of model architectures and a reliable training setup. It is especially useful for those who want to reproduce published results, experiment with new optimizers or schedulers, or quickly benchmark different backbones on image tasks.
Highlights
- Hundreds of model architectures, many with pretrained weights on ImageNet and other datasets.
- Reference training and validation scripts that can reproduce ImageNet training results.
- A wide range of optimizers (e.g., AdamW, Muon, LAMB, LARS) and learning-rate schedulers (e.g., cosine, WSD, plateau).
- Data loaders and augmentation pipelines for flexible training.
- Utilities for model resizing, feature extraction, pruning intermediate layers, and exporting to ONNX.
- Active maintenance with regular updates and new model additions.
Related
- Dispatch
- Project
- Project
- Project
- Project