pytorch-image-models README

The project's README from github.com/huggingface/pytorch-image-models. As one markdown file: README.md.

PyTorch Image Models

What's New

August 27, 2026

August 11, 2026

July 10, 2026

May 27, 2026

May 8, 2026

April 23, 2026

March 23, 2026

Feb 23, 2026

Jan 21, 2026

Jan 5 & 6, 2026

Dec 30, 2025

Dec 12, 2025

Dec 1, 2025

Nov 4, 2025

Oct 31, 2025 🎃

Oct 16-20, 2025

Sept 21, 2025

Sept 17, 2025

July 23, 2025

July 21, 2025

July 7, 2025

model img_size top1 top5 param_count
vit_large_patch16_rope_mixed_ape_224.naver_in1k 224 84.84 97.122 304.4
vit_large_patch16_rope_mixed_224.naver_in1k 224 84.828 97.116 304.2
vit_large_patch16_rope_ape_224.naver_in1k 224 84.65 97.154 304.37
vit_large_patch16_rope_224.naver_in1k 224 84.648 97.122 304.17
vit_base_patch16_rope_mixed_ape_224.naver_in1k 224 83.894 96.754 86.59
vit_base_patch16_rope_mixed_224.naver_in1k 224 83.804 96.712 86.44
vit_base_patch16_rope_ape_224.naver_in1k 224 83.782 96.61 86.59
vit_base_patch16_rope_224.naver_in1k 224 83.718 96.672 86.43
vit_small_patch16_rope_224.naver_in1k 224 81.23 95.022 21.98
vit_small_patch16_rope_mixed_224.naver_in1k 224 81.216 95.022 21.99
vit_small_patch16_rope_ape_224.naver_in1k 224 81.004 95.016 22.06
vit_small_patch16_rope_mixed_ape_224.naver_in1k 224 80.986 94.976 22.06

June 26, 2025

June 23, 2025

Model Top-1 Acc Top-5 Acc Params (M) Eval Seq Len
naflexvit_base_patch16_par_gap.e300_s576_in1k 83.67 96.45 86.63 576
naflexvit_base_patch16_parfac_gap.e300_s576_in1k 83.63 96.41 86.46 576
naflexvit_base_patch16_gap.e300_s576_in1k 83.50 96.46 86.63 576

June 5, 2025

May 28, 2025

Feb 21, 2025

Feb 1, 2025

Jan 27, 2025

Jan 19, 2025

Jan 9, 2025

Jan 6, 2025

Dec 31, 2024

Introduction

PyTorch Image Models (timm) is a collection of image models, layers, utilities, optimizers, schedulers, data-loaders / augmentations, and reference training / validation scripts that aim to pull together a wide variety of SOTA models with ability to reproduce ImageNet training results.

The work of many others is present here. I've tried to make sure all source material is acknowledged via links to github, arxiv papers, etc in the README, documentation, and code docstrings. Please let me know if I missed anything.

Features

Models

pytorch-image-models (huggingface/pytorch-image-models)

optimizer
Searching Database…

What is this?PyTorch Image Models (timm) — the largest collection of PyTorch image encoders and backbones, shipped with pretrained weights plus train, eval, inference and export scripts.
Is this a library I import into my own code, or a tool I run?A Python library you import into your own PyTorch code — the repo also ships ready-made scripts for training, validation, inference and export that you can run from the command line.
How do I add it to my project?Install it with 'pip install timm', then build a model in code like timm.create_model('resnet50', pretrained=True) — pretrained weights are pulled from the Hugging Face Hub on first use.
Which Python and PyTorch versions does it need?Nothing exotic: unit tests cover Python 3.10 up to 3.13 and PyTorch 1.13 up to 2.9.1, so even fairly old environments are supported.
Is it safe to load checkpoints I find online?Loading third-party checkpoints used to be a pickle risk, but recent releases hardened it: loading now defaults to weights_only=True, so a malicious pickle can't execute arbitrary code.
The code is Apache-2.0 — does that cover the pretrained weights too?The code is Apache-2.0, but individual pretrained weights can carry their own terms — the README keeps a separate Licenses section listing them, so check it before commercial use.
Do I need a big GPU, or will a CPU do?It runs anywhere PyTorch runs, CPU included — the collection even added CPUBone, an efficient vision backbone for devices with low parallelization capabilities.
What is NaFlexViT and why would I pick it?It's timm's flexible Vision Transformer: one model that handles variable aspect ratios and resolutions per image, and even variable patch sizes. Classic ViTs load into it with use_naflex=True, and a matching --naflex-loader data pipeline covers training, fine-tuning and evaluation on non-square images.
Beyond ImageNet classifiers, are there self-supervised or CLIP-style encoders?Yes — recent releases added DINOv3 ViT and ConvNeXt weights, SigLIP-2 NaFlex ViT encoders, and MobileCLIP-2 and MetaCLIP-2 vision encoders, so timm doubles as a source of general-purpose backbones.
Where can I check a model's accuracy and speed before picking one?The repo publishes result CSVs with ImageNet top-1/top-5 accuracy for every model, plus inference timing benchmarks run on RTX 4090, 5090 and RTX Pro 6000 cards with PyTorch 2.9.1 — handy for trading accuracy against latency.
Is timm still actively developed?Very much — releases land almost monthly (v1.0.29 in August 2026 added LowFormer weights), and the original maintainer keeps shipping after leaving Hugging Face.
Size
32.2 MB
Stars
37.2K
Age
7y
Commits · 90 Days