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

master / nightly

master / nightly

>=3.6

1.8.0

0.9.0

>=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/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.10.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.10.1
File
torchvision-0.10.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
torchvision-0.10.1-cp39-cp39-manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details
torchvision-0.10.1-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
torchvision-0.10.1-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
torchvision-0.10.1-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
torchvision-0.10.1-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
torchvision-0.10.1-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
torchvision-0.10.1-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
torchvision-0.10.1-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
torchvision-0.10.1-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
torchvision-0.10.1-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
torchvision-0.10.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: 149.3 MB

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

Download URL torchvision-0.10.1-cp39-cp39-win_amd64.whl
Size 936.1 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
6c8fe90213be4bce590ac9647b34db022d5d1ae94f309a733b9a64e65232173a
BLAKE2b-256 checksum
How to use checksums
a584f3a7889475114eac2e6f2a83c115ece887474389a6c866b3ebfc0e89e364
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.10.1-cp39-cp39-manylinux1_x86_64.whl

Download URL torchvision-0.10.1-cp39-cp39-manylinux1_x86_64.whl
Size 22.1 MB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
ac8dfbe4933013dda898b815e2476ebbc35e3a16b9352dfdd66e773c77755bec
BLAKE2b-256 checksum
How to use checksums
e7cd701539d8763529861f3bb76b90f7cbedb2edc7920101d9772fd77b921cf1
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.10.1-cp39-cp39-macosx_10_9_x86_64.whl

Download URL torchvision-0.10.1-cp39-cp39-macosx_10_9_x86_64.whl
Size 14.2 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
1c186f42b4f8aa9a01c56c3a758693b0447aa169afb9fba0051177f8fecbd691
BLAKE2b-256 checksum
How to use checksums
4b136259967e57bc1c8f7bfc8fddbd0b79ef9a31297403736e4a7c927c22d81a
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.10.1-cp38-cp38-win_amd64.whl

Download URL torchvision-0.10.1-cp38-cp38-win_amd64.whl
Size 936.2 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
453e935212193e89b4bbb8d51082d8138631c2f8a420390284b1946d893df6eb
BLAKE2b-256 checksum
How to use checksums
3359047bdb8c3dd2bc34e6e20cde495b6317605422f8d4c718430866fc28c171
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.10.1-cp38-cp38-manylinux1_x86_64.whl

Download URL torchvision-0.10.1-cp38-cp38-manylinux1_x86_64.whl
Size 22.1 MB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
d6420bf21b9d0bdbabe55d64c8b11c61f8eb077948a55d5707946fcb17d97cec
BLAKE2b-256 checksum
How to use checksums
4b9b3eac77b49101cb731725c113a41f6355f316aed47a3a48964c9e95e0e3b7
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.10.1-cp38-cp38-macosx_10_9_x86_64.whl

Download URL torchvision-0.10.1-cp38-cp38-macosx_10_9_x86_64.whl
Size 14.3 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
d7c2d6c20244404fc9ca3568c88c305cb5a81d526d5912d52d22c64999bd4353
BLAKE2b-256 checksum
How to use checksums
ed6ea3d9945e12468735ea5503f2501260d3d2532bdf039bbce68eafb0f6c38d
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.10.1-cp37-cp37m-win_amd64.whl

Download URL torchvision-0.10.1-cp37-cp37m-win_amd64.whl
Size 936.2 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
4ebffeee5468a0934952030eaba1de1dbb08154132235ee1d9049e41dfb1600d
BLAKE2b-256 checksum
How to use checksums
a9fb2329c2ddb214336524b7abcae046c69fdaa17f8d6b34462c8155490711e7
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.10.1-cp37-cp37m-manylinux1_x86_64.whl

Download URL torchvision-0.10.1-cp37-cp37m-manylinux1_x86_64.whl
Size 22.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
99d3e01e1d67d12bcc88e826431b70cad5b8e4729a277c04601f83358a120508
BLAKE2b-256 checksum
How to use checksums
566cdaa50a536812da895a4eecaefdffbffd90736c47898d942501080a5b42a5
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.10.1-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL torchvision-0.10.1-cp37-cp37m-macosx_10_9_x86_64.whl
Size 14.3 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
cd7e2b1a89d5a08f24325fc12441f5ba2822f407489377ac7841bf351a1f4d37
BLAKE2b-256 checksum
How to use checksums
396b5c93b16c43cb157851afda3568ef9f72818e9f622cc310904b6ad1543f72
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.10.1-cp36-cp36m-win_amd64.whl

Download URL torchvision-0.10.1-cp36-cp36m-win_amd64.whl
Size 936.3 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
e504d9d51eae60a98925aee4a3fd58655abd5669659ad7431f7791a93af166fc
BLAKE2b-256 checksum
How to use checksums
8b3d207d7ff1c41dc2bdc5f322828531cda9ce361203866855bd64c20dbb06f7
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.10.1-cp36-cp36m-manylinux1_x86_64.whl

Download URL torchvision-0.10.1-cp36-cp36m-manylinux1_x86_64.whl
Size 22.1 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
46a70a30ea7aeab63e67504778f2565fbb1c153fdd8e1a8c6a22193aec4dbddd
BLAKE2b-256 checksum
How to use checksums
8e3b73e2cf095f0a9d0f26b008cbfc009512c53bb2a445723aaad54b33e58cb5
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.10.1-cp36-cp36m-macosx_10_9_x86_64.whl

Download URL torchvision-0.10.1-cp36-cp36m-macosx_10_9_x86_64.whl
Size 14.3 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
bc99a984b162ee5626787eaee885d9fec1a5f16837f9d0c8223cca3269b9e47d
BLAKE2b-256 checksum
How to use checksums
734298bfffa67cfc4bb4f373f4115e6314d4ae221f0669281c9dfb69366eb16a
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.10.1 This release

12 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