Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Guide · AI & Machine LearningFree

torchvision Documentation

The official documentation for torchvision, PyTorch's computer vision library: image and video transforms that also move boxes and masks, pretrained classification, detection and segmentation models with their matching preprocessing, datasets and box operations such as NMS.

GitHub stars

17.9k (pytorch/vision)

GitHub · Sept 2026

Latest release

v0.29.0 (September 2026)

GitHub · Sept 2026

License

BSD-3-Clause

GitHub · Sept 2026

Format

Guide

Topic

AI & Machine Learning

Provider

PyTorch

Time needed

Reference; an evening to learn the layout

Level

Intermediate

Access

Free

What torchvision is

torchvision is the computer vision library that sits alongside PyTorch. In its own words it provides popular datasets, model architectures and common image transformations for computer vision. These docs are its official reference, and they are where you check which pretrained weights exist, what preprocessing they expect and how each transform behaves.

What the docs cover

  • Transforms: transforming images, videos, bounding boxes and masks, with the newer v2 API that applies the same random crop or flip to an image and its labels together.
  • TVTensors: tensor types such as Image, Video, BoundingBoxes, KeyPoints and Mask, which let transforms know what they are working on.
  • Models and pretrained weights: classification, semantic segmentation, object detection, instance segmentation, video classification and optical flow.
  • Datasets: built-in datasets and base classes for your own.
  • Utils: drawing boxes, masks and keypoints for checking results.
  • Operators: detection and segmentation operations such as non-maximum suppression, box conversions and IoU.
  • Feature extraction: tools to pull intermediate features out of a model.

Is it worth reading?

Yes, whenever you fine-tune a vision model in PyTorch. The most common silent bug in transfer learning is preprocessing that does not match the pretrained weights. torchvision attaches the right transforms to each weights object, and the docs show how to use them. The transforms v2 pages save a lot of pain when you augment detection or segmentation data, because boxes and masks move with the image.

How to use it

Keep it open next to your code rather than reading it end to end. Start with the transforms v2 getting started example, then the models page for the architecture you want, and the operators page when you need NMS or box maths.

Prerequisites

PyTorch basics: tensors, datasets and data loaders, and a training loop you understand.

Free and paid

Free and open source under the BSD 3-Clause licence. Individual pretrained weights come from datasets with their own terms, which the model pages note.

Common questions

v1 or v2 transforms? New code should use v2, which handles boxes, masks and videos as well as images.

Best for: anyone training or fine-tuning image models in PyTorch.

machine learningpythonopen source

Ready to start?

Opens on PyTorch in a new tab.

Open resource
Link broken or out of date?

Report a problem

With "torchvision Documentation". Only Tauseef reads this.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.