Skip to main content

torchvision

https://pepy.tech/badge/torchvision https://img.shields.io/badge/dynamic/json.svg?label=docs&url=https%3A%2F%2Fpypi.org%2Fpypi%2Ftorchvision%2Fjson&query=%24.info.version&colorB=brightgreen&prefix=v

The torchvision package consists of popular datasets, model architectures, and common image transformations for computer vision.

Installation

We recommend Anaconda as Python package management system. Please refer to pytorch.org for the detail of PyTorch (torch) installation. The following is the corresponding torchvision versions and supported Python versions.

torch

torchvision

python

main / nightly

main / nightly

>=3.6, <=3.9

1.9.0

0.10.0

>=3.6, <=3.9

1.8.1

0.9.1

>=3.6, <=3.9

1.8.0

0.9.0

>=3.6, <=3.9

1.7.1

0.8.2

>=3.6, <=3.9

1.7.0

0.8.1

>=3.6, <=3.8

1.7.0

0.8.0

>=3.6, <=3.8

1.6.0

0.7.0

>=3.6, <=3.8

1.5.1

0.6.1

>=3.5, <=3.8

1.5.0

0.6.0

>=3.5, <=3.8

1.4.0

0.5.0

==2.7, >=3.5, <=3.8

1.3.1

0.4.2

==2.7, >=3.5, <=3.7

1.3.0

0.4.1

==2.7, >=3.5, <=3.7

1.2.0

0.4.0

==2.7, >=3.5, <=3.7

1.1.0

0.3.0

==2.7, >=3.5, <=3.7

<=1.0.1

0.2.2

==2.7, >=3.5, <=3.7

Anaconda:

conda install torchvision -c pytorch

pip:

pip install torchvision

From source:

python setup.py install
# or, for OSX
# MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install

In case building TorchVision from source fails, install the nightly version of PyTorch following the linked guide on the contributing page and retry the install.

By default, GPU support is built if CUDA is found and torch.cuda.is_available() is true. It’s possible to force building GPU support by setting FORCE_CUDA=1 environment variable, which is useful when building a docker image.

Image Backend

Torchvision currently supports the following image backends:

  • Pillow (default)

  • Pillow-SIMD - a much faster drop-in replacement for Pillow with SIMD. If installed will be used as the default.

  • accimage - if installed can be activated by calling torchvision.set_image_backend('accimage')

  • libpng - can be installed via conda conda install libpng or any of the package managers for debian-based and RHEL-based Linux distributions.

  • libjpeg - can be installed via conda conda install jpeg or any of the package managers for debian-based and RHEL-based Linux distributions. libjpeg-turbo can be used as well.

Notes: libpng and libjpeg must be available at compilation time in order to be available. Make sure that it is available on the standard library locations, otherwise, add the include and library paths in the environment variables TORCHVISION_INCLUDE and TORCHVISION_LIBRARY, respectively.

Video Backend

Torchvision currently supports the following video backends:

  • [pyav](https://github.com/PyAV-Org/PyAV) (default) - Pythonic binding for ffmpeg libraries.

  • video_reader - This needs ffmpeg to be installed and torchvision to be built from source. There shouldn’t be any conflicting version of ffmpeg installed. Currently, this is only supported on Linux.

conda install -c conda-forge ffmpeg
python setup.py install

Using the models on C++

TorchVision provides an example project for how to use the models on C++ using JIT Script.

Installation From source:

mkdir build
cd build
# Add -DWITH_CUDA=on support for the CUDA if needed
cmake ..
make
make install

Once installed, the library can be accessed in cmake (after properly configuring CMAKE_PREFIX_PATH) via the TorchVision::TorchVision target:

find_package(TorchVision REQUIRED)
target_link_libraries(my-target PUBLIC TorchVision::TorchVision)

The TorchVision package will also automatically look for the Torch package and add it as a dependency to my-target, so make sure that it is also available to cmake via the CMAKE_PREFIX_PATH.

For an example setup, take a look at examples/cpp/hello_world.

TorchVision Operators

In order to get the torchvision operators registered with torch (eg. for the JIT), all you need to do is to ensure that you #include <torchvision/vision.h> in your project.

Documentation

You can find the API documentation on the pytorch website: https://pytorch.org/vision/stable/index.html

Contributing

See the CONTRIBUTING file for how to help out.

Disclaimer on Datasets

This is a utility library that downloads and prepares public datasets. We do not host or distribute these datasets, vouch for their quality or fairness, or claim that you have license to use the dataset. It is your responsibility to determine whether you have permission to use the dataset under the dataset’s license.

If you’re a dataset owner and wish to update any part of it (description, citation, etc.), or do not want your dataset to be included in this library, please get in touch through a GitHub issue. Thanks for your contribution to the ML community!

Release files for torchvision 0.11.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for torchvision 0.11.1
File
torchvision-0.11.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
torchvision-0.11.1-cp39-cp39-manylinux2014_aarch64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ ARM64 Details
torchvision-0.11.1-cp39-cp39-manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details
torchvision-0.11.1-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
torchvision-0.11.1-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
torchvision-0.11.1-cp38-cp38-manylinux2014_aarch64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ ARM64 Details
torchvision-0.11.1-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
torchvision-0.11.1-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
torchvision-0.11.1-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
torchvision-0.11.1-cp37-cp37m-manylinux2014_aarch64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ ARM64 Details
torchvision-0.11.1-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
torchvision-0.11.1-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
torchvision-0.11.1-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
torchvision-0.11.1-cp36-cp36m-manylinux2014_aarch64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ ARM64 Details
torchvision-0.11.1-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
torchvision-0.11.1-cp36-cp36m-macosx_10_9_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 Details

Total release size: 146.5 MB

Release files / torchvision-0.11.1-cp39-cp39-win_amd64.whl

Download URL torchvision-0.11.1-cp39-cp39-win_amd64.whl
Size 984.7 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
11e0b162f7a8ee7fa959b9e0f2a15fb858af0b2e6f79f5a0527db55327241d26
BLAKE2b-256 checksum
How to use checksums
336aeaaa4e492c4bb90bf4bdde37ba84b97e1ff1ba238981cb8595660d626907
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp39-cp39-manylinux2014_aarch64.whl

Download URL torchvision-0.11.1-cp39-cp39-manylinux2014_aarch64.whl
Size 613.7 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
8bb26e3856f163d9fe9287ad19105e93368e1c1d70d58101a9370d0acdb12865
BLAKE2b-256 checksum
How to use checksums
ebca571906a2f847b692448560f89a12f8f55c045fde5b365572e946f4d663b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp39-cp39-manylinux1_x86_64.whl

Download URL torchvision-0.11.1-cp39-cp39-manylinux1_x86_64.whl
Size 23.2 MB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
6ac7aa49f81cdab4176131c3004bc86a5e5525d0be430172c78e6e2bb604e675
BLAKE2b-256 checksum
How to use checksums
0ee4847aa282d07827b6a7cf8d06ac41d740101b7ee59ab96c5bdb03ff2fe0ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp39-cp39-macosx_10_9_x86_64.whl

Download URL torchvision-0.11.1-cp39-cp39-macosx_10_9_x86_64.whl
Size 1.2 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
18f9e1d571be810ee9a4b8604f88748e5eb4e545171f0167ad734bf080eacf2d
BLAKE2b-256 checksum
How to use checksums
a9e741f08c8e659fe39e35cb705c4fe2515ce582b81765a1f312c8f721e52f6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp38-cp38-win_amd64.whl

Download URL torchvision-0.11.1-cp38-cp38-win_amd64.whl
Size 984.6 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
99c92a02832e84e51c47e303a76e57e09776abf5009b046e9269ea7387d5aadb
BLAKE2b-256 checksum
How to use checksums
1ae69def2abf038b71648b92c9582b4f645517159710c6f54973edf44e780f18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp38-cp38-manylinux2014_aarch64.whl

Download URL torchvision-0.11.1-cp38-cp38-manylinux2014_aarch64.whl
Size 14.7 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
5dec0014240f93c17837b37a194c6a35ba99da9c3b7c5b8341f7fb2bcc676e04
BLAKE2b-256 checksum
How to use checksums
970a2314b2db4e3dae2d28c94dec632ea008c483ec2acdadd35087f63e397030
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp38-cp38-manylinux1_x86_64.whl

Download URL torchvision-0.11.1-cp38-cp38-manylinux1_x86_64.whl
Size 23.3 MB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
4e41b0a35587d2284468eddff31642704d4b218ea0e5505bb60881a94d2688e6
BLAKE2b-256 checksum
How to use checksums
8a3ed28ffd98b32b68ec6231a75ade1e2113ae56eb0382dcd7ec721b0fb197c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp38-cp38-macosx_10_9_x86_64.whl

Download URL torchvision-0.11.1-cp38-cp38-macosx_10_9_x86_64.whl
Size 1.2 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
73fae784c31a5ec7ddddefe0ba36ff3fac5131dc9c8babae3fab4ea9885b682a
BLAKE2b-256 checksum
How to use checksums
788bee134fe02512e0eb929cc52e7b9bdaf1a3ee5d4a12ed379028314c20bb5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp37-cp37m-win_amd64.whl

Download URL torchvision-0.11.1-cp37-cp37m-win_amd64.whl
Size 984.7 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
7d28c1cd3f8f470c5faf46b426969d9db1113aa9414fc5a3056e20c7cf91a746
BLAKE2b-256 checksum
How to use checksums
acf1cfa0ba5effdb820dd0718dfe6004e08e30ae4a954013999dfe8cd88104f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp37-cp37m-manylinux2014_aarch64.whl

Download URL torchvision-0.11.1-cp37-cp37m-manylinux2014_aarch64.whl
Size 14.7 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
f0be815759290ad81cafdab17973b040f8317fc59c740ad67948ebb9271e763c
BLAKE2b-256 checksum
How to use checksums
2b57476b68f9ac30750d7260c42fe62353a91f53d5579ab004ff62b784313c8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp37-cp37m-manylinux1_x86_64.whl

Download URL torchvision-0.11.1-cp37-cp37m-manylinux1_x86_64.whl
Size 23.3 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
3c1ba63eaf36d8dff7e0326dc61a73dbb100530ad4231c56427002689cada00b
BLAKE2b-256 checksum
How to use checksums
9e70b5ef020510ad84538f7a9509bfdde18c054dcff96010f824898377e53ab0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL torchvision-0.11.1-cp37-cp37m-macosx_10_9_x86_64.whl
Size 1.2 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
1fde05a1cc41f1fa3771723aad2435eb745513534209e51b349b009769895586
BLAKE2b-256 checksum
How to use checksums
df985f5d6c174eabc0aaabb4427f3c52dfb07ada26e8cb96fcce7ef5df1fa8b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp36-cp36m-win_amd64.whl

Download URL torchvision-0.11.1-cp36-cp36m-win_amd64.whl
Size 984.8 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
0c3bb474e298f3655f419e0f13a0c1ca0ef89f43e0f3f7b7ef603f3f1728543a
BLAKE2b-256 checksum
How to use checksums
2cc5204af8c57f881a2f33e5a9d89e00d145601a538614dbe1a35ece8add4f32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp36-cp36m-manylinux2014_aarch64.whl

Download URL torchvision-0.11.1-cp36-cp36m-manylinux2014_aarch64.whl
Size 14.7 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
75ea4c021e348315a655b3f94734d9ddaf5650a7ace53759dff38a13469c7cfa
BLAKE2b-256 checksum
How to use checksums
fcbeec0f152f1a38821a752847e5af6c94839041eba60d4af5fd7fb682024846
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp36-cp36m-manylinux1_x86_64.whl

Download URL torchvision-0.11.1-cp36-cp36m-manylinux1_x86_64.whl
Size 23.3 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
b56285c3da0abd11cdf86cad82c4aebbb57ab6975673a4f87d686c612dda66b7
BLAKE2b-256 checksum
How to use checksums
1ce6d05bd5325f5c285360609fa7b9beeb9b7b54f052fa73cb95a1833bc06d0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / torchvision-0.11.1-cp36-cp36m-macosx_10_9_x86_64.whl

Download URL torchvision-0.11.1-cp36-cp36m-macosx_10_9_x86_64.whl
Size 1.2 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
597d82e9b186f59695ea19ff96d4b46b74f0be52227b0a77d7cf9a9d20e6801c
BLAKE2b-256 checksum
How to use checksums
01a531c0ce1c040f03662b2134f0fba31639287f512dcc8a8380b1266890c5b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.11.1 This release

16 release files

0.9.1

16 release files

0.8.2

8 release files

0.8.1

6 release files

0.8.0

6 release files

0.7.0

6 release files

0.6.1

8 release files

0.6.0

8 release files

0.5.0

15 release files

0.4.2

9 release files

0.4.1

12 release files

0.4.0

9 release files

0.3.0

12 release files

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page