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.8, <=3.10

1.13.0

0.14.0

>=3.7.2, <=3.10

1.12.0

0.13.0

>=3.7, <=3.10

1.11.0

0.12.0

>=3.7, <=3.10

1.10.2

0.11.3

>=3.6, <=3.9

1.10.1

0.11.2

>=3.6, <=3.9

1.10.0

0.11.1

>=3.6, <=3.9

1.9.1

0.10.1

>=3.6, <=3.9

1.9.0

0.10.0

>=3.6, <=3.9

1.8.2

0.9.2

>=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

We don’t officially support building from source using pip, but if you do, you’ll need to use the --no-build-isolation flag. 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 (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.

Python linking is disabled by default when compiling TorchVision with CMake, this allows you to run models without any Python dependency. In some special cases where TorchVision’s operators are used from Python code, you may need to link to Python. This can be done by passing -DUSE_PYTHON=on to CMake.

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!

Pre-trained Model License

The pre-trained models provided in this library may have their own licenses or terms and conditions derived from the dataset used for training. It is your responsibility to determine whether you have permission to use the models for your use case.

More specifically, SWAG models are released under the CC-BY-NC 4.0 license. See SWAG LICENSE for additional details.

Citing TorchVision

If you find TorchVision useful in your work, please consider citing the following BibTeX entry:

@software{torchvision2016,
    title        = {TorchVision: PyTorch's Computer Vision library},
    author       = {TorchVision maintainers and contributors},
    year         = 2016,
    journal      = {GitHub repository},
    publisher    = {GitHub},
    howpublished = {\url{https://github.com/pytorch/vision}}
}

Metadata

Release files for torchvision 0.15.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.15.2
File
torchvision-0.15.2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
torchvision-0.15.2-cp311-cp311-manylinux2014_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARM64 Details
torchvision-0.15.2-cp311-cp311-manylinux1_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.5+ x86-64 Details
torchvision-0.15.2-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
torchvision-0.15.2-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
torchvision-0.15.2-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
torchvision-0.15.2-cp310-cp310-manylinux2014_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ ARM64 Details
torchvision-0.15.2-cp310-cp310-manylinux1_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.5+ x86-64 Details
torchvision-0.15.2-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
torchvision-0.15.2-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
torchvision-0.15.2-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
torchvision-0.15.2-cp39-cp39-manylinux2014_aarch64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ ARM64 Details
torchvision-0.15.2-cp39-cp39-manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details
torchvision-0.15.2-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
torchvision-0.15.2-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
torchvision-0.15.2-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
torchvision-0.15.2-cp38-cp38-manylinux2014_aarch64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ ARM64 Details
torchvision-0.15.2-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
torchvision-0.15.2-cp38-cp38-macosx_11_0_arm64.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64 Details
torchvision-0.15.2-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details

Total release size: 73.4 MB

Release files / torchvision-0.15.2-cp311-cp311-win_amd64.whl

Download URL torchvision-0.15.2-cp311-cp311-win_amd64.whl
Size 1.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
10be76ceded48329d0a0355ac33da131ee3993ff6c125e4a02ab34b5baa2472c
BLAKE2b-256 checksum
How to use checksums
d526a1e128500fb661d3ee7d99b97fb45d3b83e57091278c9babec859da7b87f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp311-cp311-manylinux2014_aarch64.whl

Download URL torchvision-0.15.2-cp311-cp311-manylinux2014_aarch64.whl
Size 1.2 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
b02a7ffeaa61448737f39a4210b8ee60234bda0515a0c0d8562f884454105b0f
BLAKE2b-256 checksum
How to use checksums
66e0cd847d4d22be88a71d5d65f5809342e7ea7ded62230e7bde7420a2105e51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp311-cp311-manylinux1_x86_64.whl

Download URL torchvision-0.15.2-cp311-cp311-manylinux1_x86_64.whl
Size 6.0 MB
Tags CPython 3.11 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
012ad25cfd9019ff9b0714a168727e3845029be1af82296ff1e1482931fa4b80
BLAKE2b-256 checksum
How to use checksums
4b62b6ec55347600b02b0a2a6596e673c69424aea7360c48343653866e66aa0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp311-cp311-macosx_11_0_arm64.whl

Download URL torchvision-0.15.2-cp311-cp311-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
757505a0ab2be7096cb9d2bf4723202c971cceddb72c7952a7e877f773de0f8a
BLAKE2b-256 checksum
How to use checksums
8a6dd713159642b36c42f5b6871330241070797ec89d3f8855eeb91c8baddddd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp311-cp311-macosx_10_9_x86_64.whl

Download URL torchvision-0.15.2-cp311-cp311-macosx_10_9_x86_64.whl
Size 1.5 MB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
5f35f6bd5bcc4568e6522e4137fa60fcc72f4fa3e615321c26cd87e855acd398
BLAKE2b-256 checksum
How to use checksums
69402f3b2392ce7c4b856a5964803c4bc0bf0d5fc75ff7f6cc64cc2058c3e700
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp310-cp310-win_amd64.whl

Download URL torchvision-0.15.2-cp310-cp310-win_amd64.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
96fae30c5ca8423f4b9790df0f0d929748e32718d88709b7b567d2f630c042e3
BLAKE2b-256 checksum
How to use checksums
9e1dcb1e7f25b6dda4e672ed8a3e7fbd073ec39e2ba6c378c3071ef2cd6100e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp310-cp310-manylinux2014_aarch64.whl

Download URL torchvision-0.15.2-cp310-cp310-manylinux2014_aarch64.whl
Size 1.2 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
1eefebf5fbd01a95fe8f003d623d941601c94b5cec547b420da89cb369d9cf96
BLAKE2b-256 checksum
How to use checksums
165e51c5fde550161edcfa3e131c51a8b4261775ebb2b118b3560116fa9f7a73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp310-cp310-manylinux1_x86_64.whl

Download URL torchvision-0.15.2-cp310-cp310-manylinux1_x86_64.whl
Size 6.0 MB
Tags CPython 3.10 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
54143f7cc0797d199b98a53b7d21c3f97615762d4dd17ad45a41c7e80d880e73
BLAKE2b-256 checksum
How to use checksums
870f88f023bf6176d9af0f85feedf4be129f9cf2748801c4d9c690739a10c100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp310-cp310-macosx_11_0_arm64.whl

Download URL torchvision-0.15.2-cp310-cp310-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
37eb138e13f6212537a3009ac218695483a635c404b6cc1d8e0d0d978026a86d
BLAKE2b-256 checksum
How to use checksums
d2bf4cd5133120e6cbcc2fa5c38c92f2f44a7486a9d2ae851e3d5a7e83f396d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp310-cp310-macosx_10_9_x86_64.whl

Download URL torchvision-0.15.2-cp310-cp310-macosx_10_9_x86_64.whl
Size 1.5 MB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
7754088774e810c5672b142a45dcf20b1bd986a5a7da90f8660c43dc43fb850c
BLAKE2b-256 checksum
How to use checksums
16e73b43cce519d7236bbbdc31f468b43ae2084ff7db8cb162764311028d32a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

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

Download URL torchvision-0.15.2-cp39-cp39-win_amd64.whl
Size 1.2 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
07c462524cc1bba5190c16a9d47eac1fca024d60595a310f23c00b4ffff18b30
BLAKE2b-256 checksum
How to use checksums
d848e2a056436033da54856d793e12dc0fcf8cdd179fd4cd0d1ce7c7ce659797
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp39-cp39-manylinux2014_aarch64.whl

Download URL torchvision-0.15.2-cp39-cp39-manylinux2014_aarch64.whl
Size 1.2 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
b85f98d4cc2f72452f6792ab4463a3541bc5678a8cdd3da0e139ba2fe8b56d42
BLAKE2b-256 checksum
How to use checksums
b85513d0fc65a4e0dab3dbdcc39ce51285c7b44297f197a5e13f9558cf67cefb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

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

Download URL torchvision-0.15.2-cp39-cp39-manylinux1_x86_64.whl
Size 6.0 MB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
63df26673e66cba3f17e07c327a8cafa3cce98265dbc3da329f1951d45966838
BLAKE2b-256 checksum
How to use checksums
419e8809e45a084680394e8d219fcf8a2c0eed2dddf1ec0a7968f4052826a6e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp39-cp39-macosx_11_0_arm64.whl

Download URL torchvision-0.15.2-cp39-cp39-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
987ab62225b4151a11e53fd06150c5258ced24ac9d7c547e0e4ab6fbca92a5ce
BLAKE2b-256 checksum
How to use checksums
15500485f9ef81d5e70b1408dafd65e3269ad32321ce8e58d5d549d19a3e9135
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

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

Download URL torchvision-0.15.2-cp39-cp39-macosx_10_9_x86_64.whl
Size 1.5 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
4790260fcf478a41c7ecc60a6d5200a88159fdd8d756e9f29f0f8c59c4a67a68
BLAKE2b-256 checksum
How to use checksums
55fe8e5f1e89294ef0216b6280719f0f70ef286b7316eb59c8fbd1307974dc4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

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

Download URL torchvision-0.15.2-cp38-cp38-win_amd64.whl
Size 1.2 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
c07071bc8d02aa8fcdfe139ab6a1ef57d3b64c9e30e84d12d45c9f4d89fb6536
BLAKE2b-256 checksum
How to use checksums
e0058264dffad43c6a785787515db6d9af2ca80ec2d2c16a0be9968f755a3c8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp38-cp38-manylinux2014_aarch64.whl

Download URL torchvision-0.15.2-cp38-cp38-manylinux2014_aarch64.whl
Size 1.2 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
9a192f2aa979438f23c20e883980b23d13268ab9f819498774a6d2eb021802c2
BLAKE2b-256 checksum
How to use checksums
7b41c94ead27ee4750ec76e62efe6e2e432fd58586978da449327de1f0d2e998
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

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

Download URL torchvision-0.15.2-cp38-cp38-manylinux1_x86_64.whl
Size 33.8 MB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
c55f9889e436f14b4f84a9c00ebad0d31f5b4626f10cf8018e6c676f92a6d199
BLAKE2b-256 checksum
How to use checksums
3171a362404ae76eaac714f704cb3338d8bfdf3692004a0e0799e002260a1391
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / torchvision-0.15.2-cp38-cp38-macosx_11_0_arm64.whl

Download URL torchvision-0.15.2-cp38-cp38-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
31211c01f8b8ec33b8a638327b5463212e79a03e43c895f88049f97af1bd12fd
BLAKE2b-256 checksum
How to use checksums
da4b08357c9d14bc15306c60107e1fa33c317720e34b72606cb662937bc37593
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

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

Download URL torchvision-0.15.2-cp38-cp38-macosx_10_9_x86_64.whl
Size 1.5 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
8f12415b686dba884fb086f53ac803f692be5a5cdd8a758f50812b30fffea2e4
BLAKE2b-256 checksum
How to use checksums
6c9cb75aaaa78d8f2deb374398128ce7350450dbfcb891956767e0f39177482c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.15.2 This release

20 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