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.2

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.2
File
torchvision-0.11.2-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
torchvision-0.11.2-cp39-cp39-manylinux2014_aarch64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ ARM64 Details
torchvision-0.11.2-cp39-cp39-manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details
torchvision-0.11.2-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
torchvision-0.11.2-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
torchvision-0.11.2-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
torchvision-0.11.2-cp38-cp38-manylinux2014_aarch64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ ARM64 Details
torchvision-0.11.2-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
torchvision-0.11.2-cp38-cp38-macosx_11_0_arm64.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64 Details
torchvision-0.11.2-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
torchvision-0.11.2-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
torchvision-0.11.2-cp37-cp37m-manylinux2014_aarch64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ ARM64 Details
torchvision-0.11.2-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
torchvision-0.11.2-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
torchvision-0.11.2-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
torchvision-0.11.2-cp36-cp36m-manylinux2014_aarch64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ ARM64 Details
torchvision-0.11.2-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
torchvision-0.11.2-cp36-cp36m-macosx_10_9_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 Details

Total release size: 147.6 MB

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

Download URL torchvision-0.11.2-cp39-cp39-win_amd64.whl
Size 985.0 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
b78b753b01c19f60bf4df078d245609ed6df9265a127d9fbc2ca202409779cda
BLAKE2b-256 checksum
How to use checksums
3aadbfe05d5c85e8fcc343b15acc2bb365e7af01d39ba8b6adf680356bac72e7
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.2-cp39-cp39-manylinux2014_aarch64.whl

Download URL torchvision-0.11.2-cp39-cp39-manylinux2014_aarch64.whl
Size 614.0 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
3315176f2ee887dcb9d4ada02d103bad837ba065c84d992dce0dbf9dae9ad43c
BLAKE2b-256 checksum
How to use checksums
3c11a90c538b557abd33955c961f7bc230a2b6d4ef24ecb9e1d2a7a6d479d307
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.2-cp39-cp39-manylinux1_x86_64.whl

Download URL torchvision-0.11.2-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
bc6b125134278d8b59682a3693bbf99a1eac6306f0eb71314333010d28392a83
BLAKE2b-256 checksum
How to use checksums
928bcbbcf8e055b074ea55ae07d1f3d8fb2888d47f2944ee5ea286243d4d2ba2
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.2-cp39-cp39-macosx_11_0_arm64.whl

Download URL torchvision-0.11.2-cp39-cp39-macosx_11_0_arm64.whl
Size 552.3 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
eb479be61a28fcff71b1e3ec823641cd75d61229bedab1e83659e3df53ca0159
BLAKE2b-256 checksum
How to use checksums
088bae35ded85a6bf8d79583dad7f62f507ed3cd6637cd0944a10e2569f6e0b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

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

Download URL torchvision-0.11.2-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
63d6f46e083f00ad7ce09d355eb94f512bf41899630240c6c865ca0d9d00718c
BLAKE2b-256 checksum
How to use checksums
73f2b360ddc86b4b0e10750f1dcf95542c978f6a7893220af245a8e04a0d5664
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.2-cp38-cp38-win_amd64.whl

Download URL torchvision-0.11.2-cp38-cp38-win_amd64.whl
Size 985.0 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
27f0d9088c76edfa3c1f1dcaf965f102437c049f13b599ef02abe99f4d346cb6
BLAKE2b-256 checksum
How to use checksums
f472e8011d274951d2ec3155b079b97fc61c2c8a293061dda9b327552b9d32f7
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.2-cp38-cp38-manylinux2014_aarch64.whl

Download URL torchvision-0.11.2-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
ecf3f8f8e548dd7b36c5abca03563a32a6d5cb7e97ceec012df1b6380ed5d4c3
BLAKE2b-256 checksum
How to use checksums
3d125c4b99fb9831d47520ba08de93c10e8de9c0514f4156a420b6fde9276ae0
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.2-cp38-cp38-manylinux1_x86_64.whl

Download URL torchvision-0.11.2-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
82431c4cf9cce36d6ec5f338b4cc5b96732a4becb359588bbc72fba282d3cfff
BLAKE2b-256 checksum
How to use checksums
36c64f850a3848b2c863ebe8abd3dfa6b58fdc84544a244fb96e2446b60bf7ec
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.2-cp38-cp38-macosx_11_0_arm64.whl

Download URL torchvision-0.11.2-cp38-cp38-macosx_11_0_arm64.whl
Size 597.5 kB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3abcfab98dea4bc1e512e99c5b56e66e237bd65569e1c9b1c3c2d459ef50795c
BLAKE2b-256 checksum
How to use checksums
6feb67ad3c5796753a7e9928c3329427b59fb879a1a24e0bea8624ee59638820
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

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

Download URL torchvision-0.11.2-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
52b14ce23a6e0a5a1309970888a1febb12e93fe6aed78df8aa115f1cf2019cc6
BLAKE2b-256 checksum
How to use checksums
0829f8ff498296dc8d2bc8c51c07fc8f3a069cd188c7c4ba343cb1118869b328
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.2-cp37-cp37m-win_amd64.whl

Download URL torchvision-0.11.2-cp37-cp37m-win_amd64.whl
Size 985.0 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
d2aa1e253c9ddcf728a2dc6e771ebaf3201798cf91304cd352795a34daefce51
BLAKE2b-256 checksum
How to use checksums
5fcf7100087a34cc1a4fd6aa492edd2fe7c51c6773bad6473bc2551c427834cb
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.2-cp37-cp37m-manylinux2014_aarch64.whl

Download URL torchvision-0.11.2-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
fe1395b5fe3b5f2111312a8c75dd48176db7b9f129e1f4159bf1fb2aeec54778
BLAKE2b-256 checksum
How to use checksums
18023da9c183a5ff153014a86b4c8ed6dd4f7ac4fe4e429729c534b3823ae44a
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.2-cp37-cp37m-manylinux1_x86_64.whl

Download URL torchvision-0.11.2-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
32cca2b5e0696f59e03c1261444deb81c87c6967d444aaf2d156f3023e741ffe
BLAKE2b-256 checksum
How to use checksums
8cf73e3875ce0155d9a2acf9911bc80679bdccfa81cc6f3c83fec7c2b267f46a
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.2-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL torchvision-0.11.2-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
3091e5d3131e0664ca817ef32eff0ec5f79e2f0d61b447ae63bdd2429aff179c
BLAKE2b-256 checksum
How to use checksums
7f02de14c5b6bae9d407a9aa4fffff001fc68b2066e7787e232069649b70ddcc
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.2-cp36-cp36m-win_amd64.whl

Download URL torchvision-0.11.2-cp36-cp36m-win_amd64.whl
Size 985.2 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
6d84490010761a34d6238987f88f8bccec06914431fc13c221902ea4f54ecb43
BLAKE2b-256 checksum
How to use checksums
f4cb989e29a5e0f74a72e0f919587bb80e36647a60309fc39183e732b9c5bd12
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.2-cp36-cp36m-manylinux2014_aarch64.whl

Download URL torchvision-0.11.2-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
12eb97a2b87661914c2a6743ec535b432194b3a17620217cab201733e63d0a8f
BLAKE2b-256 checksum
How to use checksums
9e813f93005f4b5815cb5e4938c3ad267c6542ff40e69c683a09e2e042107976
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.2-cp36-cp36m-manylinux1_x86_64.whl

Download URL torchvision-0.11.2-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
a33c4e5c8456d3cdbb706636f209f318c8544be0f08179056296765db95b981b
BLAKE2b-256 checksum
How to use checksums
3803c963ecdf98fae15286437ae533750e2c39e988b7d8c86fad4dbc73a3a146
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.2-cp36-cp36m-macosx_10_9_x86_64.whl

Download URL torchvision-0.11.2-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
0f52745f652fe82e962e3399ac19f5ce7fe42e2b6bf73ef24f4aa1f222bbbfca
BLAKE2b-256 checksum
How to use checksums
08691b6ce41f626c87e839014e4be04bf2d007ec13b9aff7b8a90eddb5abf412
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.2 This release

18 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