whatisgithub

What is pretrained-models.pytorch?

cadene/pretrained-models.pytorch — explained in plain English

Analysis updated 2026-06-24

9,111PythonAudience · researcherComplexity · 2/5Setup · easy

In one sentence

A PyTorch library bundling over 40 image-recognition models pre-trained on ImageNet under one consistent interface, making it easy to load, swap, and fine-tune architectures for transfer learning.

Mindmap

mindmap
  root((pretrained models))
    What it does
      40 plus architectures
      Consistent API
      ImageNet weights
    Tech Stack
      Python
      PyTorch
    Use Cases
      Transfer learning
      Image classification
      Fine tune on custom data
    Audience
      ML researchers
      Data scientists
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Load a pre-trained ResNet or NASNet model and fine-tune it on your own image dataset without training from scratch.

USE CASE 2

Swap between 40+ image-recognition architectures without rewriting preprocessing or inference code.

USE CASE 3

Use transfer learning to build an image classifier for a narrow category using limited labeled data.

What is it built with?

PythonPyTorch

How does it compare?

cadene/pretrained-models.pytorchlmeszinc/azurlaneautoscriptkozea/weasyprint
Stars9,1119,1099,115
LanguagePythonPythonPython
Setup difficultyeasymoderateeasy
Complexity2/53/52/5
Audienceresearchergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

GPU recommended for training, CPU inference works but is slow for larger architectures like NASNet.

The explanation does not specify the license terms.

So what is it?

This repository collects a large set of image-recognition models that have already been trained on a standard large image dataset called ImageNet, packaged so they can be used directly in PyTorch. PyTorch is a popular framework for building and running machine learning systems. A pretrained model is one that has already done the computationally expensive work of learning from millions of images, so you can use its learned knowledge as a starting point rather than training from scratch. The practical value is for a technique called transfer learning, where you take a model trained on a large general dataset and adapt it to a more specific task. For example, you might start with one of these pretrained models and fine-tune it to recognize a narrow category of images relevant to your own project. That approach typically works better and requires less data than training a model from zero. The library bundles more than 40 different model architectures under one consistent interface. The list includes well-known designs like ResNet, Inception, Xception, NASNet, DualPathNetworks, and several variants of each. Each model in the collection exposes the same set of attributes and methods regardless of which architecture it is, which makes it straightforward to swap one model for another without rewriting surrounding code. Installation is one pip command. Once installed, you load a model by name, pass it an image preprocessed to the right format, and get back predictions. Each model object carries metadata about what input size and pixel format it expects, so the library can handle the preprocessing differences between architectures automatically. The README includes accuracy figures measured on the ImageNet validation set for each model, along with notes on reproducing those results. The project is marked as a work in progress and was actively updated between 2017 and 2018, with contributions from several external developers who ported additional architectures.

Copy-paste prompts

Prompt 1
Using pretrained-models.pytorch, load a pre-trained NASNet model and run inference on a custom image to get the top-5 predictions.
Prompt 2
How do I fine-tune a pretrained InceptionV4 model from this library on my own dataset using PyTorch's training loop?
Prompt 3
Show me how to swap from ResNet-50 to DPN-92 in my script without changing any preprocessing code using this library.
Prompt 4
How do I preprocess an image to match the exact input size and pixel format expected by a specific model in pretrained-models.pytorch?
Prompt 5
Which model in pretrained-models.pytorch has the best accuracy on ImageNet validation and how do I load it?

Frequently asked questions

What is pretrained-models.pytorch?

A PyTorch library bundling over 40 image-recognition models pre-trained on ImageNet under one consistent interface, making it easy to load, swap, and fine-tune architectures for transfer learning.

What language is pretrained-models.pytorch written in?

Mainly Python. The stack also includes Python, PyTorch.

What license does pretrained-models.pytorch use?

The explanation does not specify the license terms.

How hard is pretrained-models.pytorch to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is pretrained-models.pytorch for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.