Model or dataset
pytorch/vision avatar
pytorch/vision

TorchVision: Datasets, Transforms and Weights for PyTorch, and the Version Lock That Comes With Them

Datasets, Transforms and Models specific to Computer Vision

17,911 stars7,262 forksPythonBSD-3-Clause

At a glance

What is it?
TorchVision is the domain library that ships computer vision datasets, image transforms and pre-trained model architectures alongside PyTorch. Its value is the version pairing with torch, and its main cost is that the pairing is mandatory.
Who is it for?
Adopt TorchVision if you are already on PyTorch and want reference dataset loaders, torchvision.transforms pipelines and downloadable pre-trained weights without assembling them yourself. Do not adopt it as a general image I/O or augmentation library for non-PyTorch stacks, and do not treat its dataset wrappers as a licensing shortcut: the README states it does not host or distribute datasets and does not claim you have license to use them.
Can I use it commercially?
Yes. BSD-3-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The problem TorchVision solves is packaging, not research

Training a vision model means writing the same scaffolding every time: a Dataset subclass that walks an ImageFolder tree, a transform pipeline that resizes and normalises, a model definition with the right number of output classes, and a URL plus checksum for pre-trained weights. TorchVision bundles those four things. The README describes the package as consisting of popular datasets, model architectures, and common image transformations for computer vision, which is a plain description of a utility library rather than a framework.

The audience follows from that. If you are writing PyTorch code and you need CIFAR, ImageNet-style folder loaders, or a ResNet to fine-tune, this is the default place to look. If you are working in TensorFlow, JAX or a non-Python stack, nothing here applies to you. The library assumes torch is present and its APIs are built on torch tensors, so it is not a standalone image toolkit that happens to have a PyTorch binding.

Transforms sit on top of an image backend you choose

The README lists the image backends TorchVision currently supports: torch tensors, Pillow, and Pillow-SIMD, which it describes as a much faster drop-in replacement for Pillow with SIMD. That list is the clearest signal about how the transform layer works. A transform does not implement its own resize or rotate kernel. It dispatches to whichever representation it is handed, so a pipeline that keeps images as PIL objects and one that converts to tensors early will not execute the same code path even when the transform names match.

This matters when you profile a data loader and find the bottleneck in augmentation. Swapping Pillow for Pillow-SIMD is presented as a drop-in change, which is the cheapest lever the documentation offers. The alternative lever is moving work onto tensors, where operations can run on the same device as the model. The README does not rank these options or give numbers, so treat the choice as something you measure on your own pipeline rather than something the project decides for you.

There is also a correctness angle. Because transforms are backend-dispatched, a pipeline that works on PIL input may behave differently once you convert to tensors mid-stream. Keep the conversion point fixed and explicit rather than letting different transforms in the same pipeline assume different input types.

The torch and torchvision version table is the real installation constraint

Installation is deliberately not documented in the README. It points to the official PyTorch instructions at pytorch.org/get-started/locally for stable torch and torchvision, and to CONTRIBUTING.md for building from source. What the README does provide is the compatibility matrix, and that table is the part you actually need.

For the current line, torch 2.13 pairs with torchvision 0.28, torch 2.12 with 0.27, torch 2.11 with 0.26, and torch 2.10 with 0.25. All of those list Python >=3.10 and <=3.14. The nightly row pairs main with main and the same Python range. The collapsed older-versions table shows the pattern has held for years: torch 2.0 with torchvision 0.15, torch 1.13 with 0.14, and so on back to torch 1.0 and torchvision 0.2. The minor numbers are offset by design, so torchvision 0.29 does not correspond to torch 2.14 in any obvious arithmetic way. Read the table.

Python support moves too. Releases from torchvision 0.25 onward require Python 3.10 or newer; 0.23 and 0.22 allowed 3.9; 0.19 through 0.21 allowed 3.8. If you are pinned to an older interpreter, the table tells you which torchvision release is the last one you can use, and that release will also pin your torch version. Upgrading the interpreter and upgrading torch are the same decision here.

The release notes for v0.29.0 are titled TorchVision 0.29: ABI stability, which suggests binary interface stability was the theme of that release. The README does not define what that guarantee covers, so if ABI stability is the reason you are moving to 0.29, read the release notes themselves rather than assuming it extends to every extension point.

Datasets and pre-trained weights are conveniences with licence strings attached

The dataset disclaimer is unusually direct. The README states that this is a utility library that downloads and prepares public datasets, that the project does not host or distribute those datasets, does not vouch for their quality or fairness, and does not claim that you have license to use them. Determining whether you have permission under the dataset's own licence is placed on you.

The pre-trained model section repeats the structure. Models may carry their own licences or terms derived from the training dataset, and the README names one case explicitly: SWAG models are released under CC-BY-NC 4.0, with a pointer to the SWAG repository licence for details. CC-BY-NC is a non-commercial licence, which is a materially different constraint from the BSD-3-Clause that covers the library code itself.

That split is the thing to internalise. The repository licence governs the source. It does not govern the weights you download through it or the datasets you fetch with it. A team that audits only the repository licence will miss both. If you are shipping a product, the licence of each weight file and each dataset is a separate item to check, and for SWAG the answer is already written down.

Where TorchVision is the wrong tool

The version lock is the sharpest limitation. TorchVision is not independently versioned in any useful sense: it tracks torch, and the README's table makes the coupling explicit from the current releases back through the older-versions block. If your production environment pins torch for reasons outside your control, your torchvision version is effectively decided for you, along with your supported Python range. You cannot upgrade the transforms layer on its own to pick up a fix.

Second, the library is scoped to computer vision. It is not a general data pipeline. If your training job mixes images with text, audio or tabular data, the dataset and transform abstractions here cover only the image portion, and you will be writing the coordination layer yourself.

Third, the dataset wrappers are download-and-prepare helpers, not curated data. The README says so directly. If your work depends on dataset provenance, documented collection methodology or fairness guarantees, a wrapper that fetches files is not that. You still need to read the dataset's own documentation.

Finally, the README does not describe a serving or inference runtime. It describes datasets, architectures and transforms. If you need to deploy a model, that is a different concern and this library is not claiming to address it.

The alternative is a dedicated augmentation or data library

The realistic alternative for the transform layer is a standalone image augmentation library that does not depend on torch, such as Albumentations or Kornia. The difference in approach is where the work happens and what the API is coupled to. A standalone augmentation library owns its own kernels and targets NumPy arrays or its own image type, so it can be used from any Python training loop and upgraded on its own schedule. TorchVision's transforms are dispatched through the backends the README lists (torch tensors, Pillow, Pillow-SIMD) and live inside the torch release train.

That trade cuts both ways. A standalone library frees you from the torch pairing but adds a second dependency with its own version constraints, and it will not give you the model architectures or the dataset loaders. TorchVision gives you all three in one package at the cost of the lock. For a team already standardised on PyTorch, the lock is usually cheaper than the second dependency. For a team that needs the same augmentation code in a PyTorch job and a NumPy-only preprocessing step, the standalone library is the one that does not force a rewrite.

The choice is not about which is faster. The README makes no performance claims and gives no benchmarks, and neither does this article. It is about whether you want your image pipeline's upgrade cadence tied to torch's.

Maintenance cost and licence boundaries

The maintenance surface is the compatibility table. Every torch upgrade is a torchvision upgrade, and every torchvision upgrade carries a Python version floor that has been moving upward: 3.8 in the 0.19 to 0.21 era, 3.9 in 0.22 and 0.23, and 3.10 from 0.25 onward. If you maintain long-lived environments, budget for the fact that staying on a supported torchvision means periodically raising your interpreter version, and that the two moves cannot be separated.

The release cadence visible in the material is roughly every six to eight weeks for minor versions, with patch releases in between, based on the dates of v0.29.0, v0.28.0 and v0.27.1. That is a pace you can plan around, but it also means the version you pin will fall behind quickly if you are not tracking it.

On licensing, the repository is BSD-3-Clause. That covers the code. The README is explicit that it does not cover the datasets or the pre-trained weights, and it names CC-BY-NC 4.0 for SWAG models as one concrete example. This is not legal advice; the point is simply that the repository licence and the artefacts you pull through the library are governed separately, and the README says so in two separate disclaimers.

Editorial conclusion

Adopt TorchVision if you are already on PyTorch and want reference dataset loaders, torchvision.transforms pipelines and downloadable pre-trained weights without assembling them yourself. Do not adopt it as a general image I/O or augmentation library for non-PyTorch stacks, and do not treat its dataset wrappers as a licensing shortcut: the README states it does not host or distribute datasets and does not claim you have license to use them. Before you commit, verify three things: that your installed torch version appears in the compatibility table for the torchvision release you are pinning, whether your transforms run on tensors or PIL images since that changes which backend does the work, and the licence attached to the specific pre-trained weights you plan to ship.

Official sources

  1. License: BSD-3-Clause
  2. Project website
  3. pytorch/vision on GitHub
  4. README
  5. Releases
Community notes

Community notes