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!

Release files for torchvision 0.9.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.9.1
File
torchvision-0.9.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
torchvision-0.9.1-cp39-cp39-manylinux2014_aarch64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ ARM64 Details
torchvision-0.9.1-cp39-cp39-manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details
torchvision-0.9.1-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
torchvision-0.9.1-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
torchvision-0.9.1-cp38-cp38-manylinux2014_aarch64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ ARM64 Details
torchvision-0.9.1-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
torchvision-0.9.1-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
torchvision-0.9.1-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
torchvision-0.9.1-cp37-cp37m-manylinux2014_aarch64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ ARM64 Details
torchvision-0.9.1-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
torchvision-0.9.1-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
torchvision-0.9.1-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
torchvision-0.9.1-cp36-cp36m-manylinux2014_aarch64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ ARM64 Details
torchvision-0.9.1-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
torchvision-0.9.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: 161.3 MB

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

Download URL torchvision-0.9.1-cp39-cp39-win_amd64.whl
Size 852.4 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
42bec9b8e8a1dcd478751457191f317f843fa463555c141994c809c4b11ad60d
BLAKE2b-256 checksum
How to use checksums
c5bec078b97033551a8ffa7b8cf219b2b97a5d09fd03ce4019c4b896571ba2e2
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.1-cp39-cp39-manylinux2014_aarch64.whl

Download URL torchvision-0.9.1-cp39-cp39-manylinux2014_aarch64.whl
Size 491.2 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
92c936584e03dfca39ff31bbc4a4fb54edb08fe8362e75dc08a2fa4b43266068
BLAKE2b-256 checksum
How to use checksums
506d7eccd5f3ce8195b012407589a53c7dbc6327c8fce2bd895e4debb7a78996
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.1-cp39-cp39-manylinux1_x86_64.whl

Download URL torchvision-0.9.1-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
46b82b6cdccd2cb982819165b6ddaa097629315377ba6bbf77bdcb02c2e83692
BLAKE2b-256 checksum
How to use checksums
577e16ed36f9749db8e229621e046a9fa9db5f3f3476a4417d53684c942acd45
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.1-cp39-cp39-macosx_10_9_x86_64.whl

Download URL torchvision-0.9.1-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
091812c9fa405bef12aca9b9c3e671fcae7c0a4945b68705534ba8a401396ad1
BLAKE2b-256 checksum
How to use checksums
a123ba88f128c5da467bdff5e95a063a81faa4a7fc4821af2f53952786cde93e
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.1-cp38-cp38-win_amd64.whl

Download URL torchvision-0.9.1-cp38-cp38-win_amd64.whl
Size 852.4 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
dda0dcb914bcab1a43f823348736b8b1c926bf1fbe9cbb3be892fdbe2ab6d097
BLAKE2b-256 checksum
How to use checksums
350944c1a76f3f4fe7d18294b6c8a3eaff21f33ff1af8e857bc4848d12ad8bda
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.1-cp38-cp38-manylinux2014_aarch64.whl

Download URL torchvision-0.9.1-cp38-cp38-manylinux2014_aarch64.whl
Size 11.8 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
85f21862e504590eb4a77b1d9a1742156a296af55827fb8c82296601922b7ac1
BLAKE2b-256 checksum
How to use checksums
b3a9acc8615fa877eb3ea805053d245a93ed035665d0bea633a1765cef36681c
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.1-cp38-cp38-manylinux1_x86_64.whl

Download URL torchvision-0.9.1-cp38-cp38-manylinux1_x86_64.whl
Size 17.4 MB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
0bfcc3ab99128081bfc9a5c3ab31f5227c4df3b802e6d4217dac104bf5ba8636
BLAKE2b-256 checksum
How to use checksums
8affa5f5206ffc629b4536a54105214721249e2240416d78089dc01c63d00f50
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.1-cp38-cp38-macosx_10_9_x86_64.whl

Download URL torchvision-0.9.1-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
d38d0d23c6ce6ba15eba094a9319393e429796ab2bab228fa3b996abc9e33c3f
BLAKE2b-256 checksum
How to use checksums
ad8b9b67843f3103c2f571913396cb208d10c34da777d31f2082ab62126ec34e
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.1-cp37-cp37m-win_amd64.whl

Download URL torchvision-0.9.1-cp37-cp37m-win_amd64.whl
Size 852.3 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
86e4facb1cf4670ab3d67b7a947f0c43cd0805ec269a5e22ad0b82be727bcb3b
BLAKE2b-256 checksum
How to use checksums
4af66a7d86254981c28a1a9230b087db34a5429b66578bbc9d3a70d40ebbeef4
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.1-cp37-cp37m-manylinux2014_aarch64.whl

Download URL torchvision-0.9.1-cp37-cp37m-manylinux2014_aarch64.whl
Size 11.8 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
b14b5b7fed0b7dc6245c2608b9fd2262d5b375ba998e097b980a1046683ca7f6
BLAKE2b-256 checksum
How to use checksums
4bebca5f87018be47cef7327029e2889357047628ccff52fe7b189771124feb5
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.1-cp37-cp37m-manylinux1_x86_64.whl

Download URL torchvision-0.9.1-cp37-cp37m-manylinux1_x86_64.whl
Size 17.4 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
a1421a26b21b8c098935c3375182470c4c4d99d5e14d81ec3ac14a35e7a85285
BLAKE2b-256 checksum
How to use checksums
938a82062a33b5eb7f696bf23f8ccf04bf6fc81d1a4972740fb21c2569ada0a6
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.1-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL torchvision-0.9.1-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
8aa438869e3033cbd8749d041d1ca7beb6171ca9f7f47b42e742fabd6900f8fc
BLAKE2b-256 checksum
How to use checksums
aa281b27b2fc6aad7ce44dfc9ead604ff72ad61f7c60cbad7abe7726f3ea0af8
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.1-cp36-cp36m-win_amd64.whl

Download URL torchvision-0.9.1-cp36-cp36m-win_amd64.whl
Size 852.4 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
99cd75163938b4b3728815696d75c0df8b66390c489abed2365a530a040059a1
BLAKE2b-256 checksum
How to use checksums
4b1525966bd3314c93ead674736fba92590a89860dd3946d973b9e0b53977b8e
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.1-cp36-cp36m-manylinux2014_aarch64.whl

Download URL torchvision-0.9.1-cp36-cp36m-manylinux2014_aarch64.whl
Size 11.8 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
f16ceec2862faaffc8fc19bca20e0e79ffdab18a53e6cb75e42e33d090e80d04
BLAKE2b-256 checksum
How to use checksums
e332b6464ad450d65ffd44543a7cc98043b57e2fd11cbb251ed44c518ab56395
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.1-cp36-cp36m-manylinux1_x86_64.whl

Download URL torchvision-0.9.1-cp36-cp36m-manylinux1_x86_64.whl
Size 17.4 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
8a937cd3b53656e15de03671f8a638b5e8e4c100725b854d73bdb51e41455e9e
BLAKE2b-256 checksum
How to use checksums
74a04bfa036c5b88444e95d0b3b24c6e0d6047b9c5920572c4be3135e24f15ba
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.1-cp36-cp36m-macosx_10_9_x86_64.whl

Download URL torchvision-0.9.1-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
da4c4f7363b60b0637354974ea0a29dbc301f66c9f25d92ed5f10637909f3500
BLAKE2b-256 checksum
How to use checksums
2c1919ea4cec5a7048eb2596f1574bed5bfec703c0fe9155b1bad0d9b8d198e4
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

This release

0.9.1 This release

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