Skip to main content

torchvision

https://codecov.io/gh/pytorch/vision/branch/master/graph/badge.svg 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

master / nightly

master / nightly

>=3.6

1.7.1

0.8.2

>=3.6

1.7.0

0.8.1

>=3.6

1.7.0

0.8.0

>=3.6

1.6.0

0.7.0

>=3.6

1.5.1

0.6.1

>=3.5

1.5.0

0.6.0

>=3.5

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.

C++ API

TorchVision also offers a C++ API that contains C++ equivalent of python models.

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/docs/stable/torchvision/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!

Metadata

Release files for torchvision 0.9.0

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

Total release size: 125.3 MB

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

Download URL torchvision-0.9.0-cp39-cp39-win_amd64.whl
Size 852.5 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
b03275f351feffaf7450d234ffb57cce26ff5e696d01ef5f543de205f18849a9
BLAKE2b-256 checksum
How to use checksums
608e227796b0b41f190bd28d07c7a1aab3d24fd49c109ef04179db06fd61c4c9
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.9.0-cp39-cp39-manylinux1_x86_64.whl

Download URL torchvision-0.9.0-cp39-cp39-manylinux1_x86_64.whl
Size 17.3 MB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
d85d405e8cf694c1f85da7f0496ea69dd4f8d8dafbdad1e29bcdc4c621fc5cf0
BLAKE2b-256 checksum
How to use checksums
25ceba303023a3d36d31a8f6cab12c2b0b56fa61ceb61cf44d3e3835502a0c2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

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

Download URL torchvision-0.9.0-cp39-cp39-macosx_10_9_x86_64.whl
Size 13.1 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
421bda7131f3c0eae2260f10174ac3c49e54183b33acb927b4b572f4cd90066d
BLAKE2b-256 checksum
How to use checksums
d374e92e310c375ef8ce5e24e486288072b72676eba06741d5952838d5d529d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

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

Download URL torchvision-0.9.0-cp38-cp38-win_amd64.whl
Size 852.7 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
2252bc63fcccb27785726dd9d0d9a97432657a5d139390bf93cd6bdf227a4401
BLAKE2b-256 checksum
How to use checksums
e380990ee679f2c29a2d79446cd79e3ed82ec446f7eaf4257e9478a3b6f02f7d
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.9.0-cp38-cp38-manylinux1_x86_64.whl

Download URL torchvision-0.9.0-cp38-cp38-manylinux1_x86_64.whl
Size 17.3 MB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
8fce78a59959f4bb4780a78c2277d617e44da7bc270bc449ff403187f6b587fc
BLAKE2b-256 checksum
How to use checksums
f8066fca0c94a0e797038f654b71d7ec3ae1fbce33180afb6c78bc73f1839856
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

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

Download URL torchvision-0.9.0-cp38-cp38-macosx_10_9_x86_64.whl
Size 13.2 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
fa302f6e8fe33a8d5c6649e659655c0427eee662fe22ce69eb56fa402b520c26
BLAKE2b-256 checksum
How to use checksums
316f3a24bd6e209c385c1209081a721bff0d9029207433cbc3da8777d722e59e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

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

Download URL torchvision-0.9.0-cp37-cp37m-win_amd64.whl
Size 852.6 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
8791da742c24344646a4ac36adee9327491f7fff7607dffe352402b5bf25ea21
BLAKE2b-256 checksum
How to use checksums
e09388cbc7e7528b06b393dbcf98ab29390be3801794dfc77881664f1bb0ec80
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.9.0-cp37-cp37m-manylinux1_x86_64.whl

Download URL torchvision-0.9.0-cp37-cp37m-manylinux1_x86_64.whl
Size 17.3 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
d90750ae76a0cad8ffb6b509b30412dcd102d27d5f34f7184b289b6687de580e
BLAKE2b-256 checksum
How to use checksums
6f6a4e8d7c897f24a6aa9d5e7c23a157b52084ccd43d1b6019603361d2136dde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

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

Download URL torchvision-0.9.0-cp37-cp37m-macosx_10_9_x86_64.whl
Size 13.2 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
24b505dbcf3cb8da49d4b1447543c1021b699c84fc3701523101b62ee4adf097
BLAKE2b-256 checksum
How to use checksums
a3cfcda30a8d8dbcf06ad55688682714ea5d6062a962e77e5bae7a49c76ca855
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

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

Download URL torchvision-0.9.0-cp36-cp36m-win_amd64.whl
Size 852.7 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
b9f71f62725776495071b875494af86615f225b1a40902f5df452da5cfde0510
BLAKE2b-256 checksum
How to use checksums
4bdecf2c383e758a91bfe3ddaaf3e01aa5cd07ac289e7d7b86225da83242c35f
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.9.0-cp36-cp36m-manylinux1_x86_64.whl

Download URL torchvision-0.9.0-cp36-cp36m-manylinux1_x86_64.whl
Size 17.3 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
874714f30822d4c1160071dac004d48ae641bfdccccbb497098c86f6589ec0f1
BLAKE2b-256 checksum
How to use checksums
2a9581029fa471429480ede157955e42d176d506a2fd37188021b69a2926f6fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

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

Download URL torchvision-0.9.0-cp36-cp36m-macosx_10_9_x86_64.whl
Size 13.2 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
63052147c776d9f93385410c1d5a791386eb0cb5e1b93c7feac686f8dbe6eb06
BLAKE2b-256 checksum
How to use checksums
8b96ce45fe7697a460d8a2b2be66d4234d5ac4804e6db10e06797a84dbb98afd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

Release history Release notifications | RSS feed

0.9.1

16 release files

This release

0.9.0 This release

12 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