Skip to main content

torchvision

https://travis-ci.org/pytorch/vision.svg?branch=master 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.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

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.

Documentation

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

Contributing

We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion. If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us.

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.8.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.8.2
File
torchvision-0.8.2-cp39-cp39-manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details
torchvision-0.8.2-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
torchvision-0.8.2-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
torchvision-0.8.2-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
torchvision-0.8.2-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
torchvision-0.8.2-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
torchvision-0.8.2-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
torchvision-0.8.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: 55.2 MB

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

Download URL torchvision-0.8.2-cp39-cp39-manylinux1_x86_64.whl
Size 12.7 MB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
976750a49db2e23dc5a1ed0b5c31f7af51ed2702eee410ee09ef985c3a3e48cf
BLAKE2b-256 checksum
How to use checksums
183964aa235e1f08c27d9fafd3aa317d081b45914f68a7a2a87b488fd0b69589
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2.post20201201 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

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

Download URL torchvision-0.8.2-cp39-cp39-macosx_10_9_x86_64.whl
Size 1.0 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
1bd58acc3366ec02266aae56a7a752d43ef07de4a6ba420c4f907d0c9168bb8c
BLAKE2b-256 checksum
How to use checksums
037ef6cee590418d9ce11a6a92fd2bc5510678e598197370f4a5ad8f8446cbaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2.post20201201 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

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

Download URL torchvision-0.8.2-cp38-cp38-manylinux1_x86_64.whl
Size 12.8 MB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
cd8817e9197fc60ebae37162a445db90bbf35591314a5767ad3d1490b5d65b0f
BLAKE2b-256 checksum
How to use checksums
239288de78810119baac2a3d9ae203d1a085df6ea5d3af557a151157436f81d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2.post20201201 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

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

Download URL torchvision-0.8.2-cp38-cp38-macosx_10_9_x86_64.whl
Size 1.0 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
afb76a66b9b0693f758a881a2bf333ed97e3c0c3f15a413c4f49d8dd8bd21307
BLAKE2b-256 checksum
How to use checksums
44bfedf227dc1afc239ce2958bd3fa9157558a7d374e62fde5b156df827d6a71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2.post20201201 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

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

Download URL torchvision-0.8.2-cp37-cp37m-manylinux1_x86_64.whl
Size 12.8 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
b068f6bcbe91bdd34dda0a39e8a26392add45a3be82543f6dd523b76484fb56f
BLAKE2b-256 checksum
How to use checksums
94df969e69a94cff1c8911acb0688117f95e1915becc1e01c73e7960a2c76ec8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2.post20201201 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

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

Download URL torchvision-0.8.2-cp37-cp37m-macosx_10_9_x86_64.whl
Size 1.0 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
24db8f4c3d812a032273f68563ad5dbd724f5bfbed523d0c6dce8cede26bb153
BLAKE2b-256 checksum
How to use checksums
8a8fcc7e0b18d73663786f28d70eced98cf10288a849687a10fc8fb60dbf7674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2.post20201201 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

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

Download URL torchvision-0.8.2-cp36-cp36m-manylinux1_x86_64.whl
Size 12.8 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
951239b5fcb911dbf78c1385d677f5f48c7a1b12859e3d3ec287562821b17cf2
BLAKE2b-256 checksum
How to use checksums
19f1d1d9b2be9f50e840accfa180ec2fb759dd2504f2b3a12a232398d5fa00ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2.post20201201 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

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

Download URL torchvision-0.8.2-cp36-cp36m-macosx_10_9_x86_64.whl
Size 1.0 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
86fae370d222f76ad57c57c3bee03f78b8db727743bfb4c1559a3d395159cea8
BLAKE2b-256 checksum
How to use checksums
9ea8bd195708a6602ea650472c3be9712288b710d4d743f1fda4ae7f76177229
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2.post20201201 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

Release history Release notifications | RSS feed

0.9.1

16 release files

This release

0.8.2 This release

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