talira

timm (PyTorch Image Models)

Large collection of PyTorch image models and backbones with pretrained weights and training scripts

open sourceApache-2.0free

timm (PyTorch Image Models) is a collection of image models, layers, utilities, optimizers, schedulers, data loaders and augmentations, and reference training and validation scripts for PyTorch. It brings together a wide range of architectures, including ResNet, EfficientNet, Vision Transformers and ConvNeXt, nearly all with pretrained weights, and every model can extract multi-scale feature maps for use as a backbone.

Problems it solves

  • get a pretrained image classification backbone for my PyTorch model
  • fine-tune a Vision Transformer on my own images
  • compare many image model architectures with the same training code

Features

  • a wide range of image model architectures, nearly all with pretrained weights
  • multi-scale feature map extraction for using models as backbones
  • reference training, validation and inference scripts
  • optimizers, schedulers and augmentations for image training

Limitations

  • Most pretrained weights were trained on ImageNet, which was released for non-commercial research only, so their makers advise legal advice before using them commercially.1
  • Some weights it references carry their own non-commercial licences, such as Facebook's WSL and SSL ResNeXt models (CC-BY-NC 4.0).1

Alternatives

The same job

These do what timm (PyTorch Image Models) does.

  1. vit-pytorch PyTorch implementations of the Vision Transformer and dozens of its variants
  2. Transformers Hugging Face's Python library of model definitions for text, vision, audio and multimodal models
  3. Diffusers State-of-the-art diffusion models for image, video, and audio generation in PyTorch

Compare timm (PyTorch Image Models) with the top 3