Skip to main content

torchvision

total torchvision downloads documentation

The torchvision package consists of popular datasets, model architectures, and common image transformations for computer vision.

Installation

Please refer to the official instructions to install the stable versions of torch and torchvision on your system.

To build source, refer to our contributing page.

The following is the corresponding torchvision versions and supported Python versions.

torch torchvision Python
main / nightly main / nightly >=3.8, <=3.11
2.2 0.17 >=3.8, <=3.11
2.1 0.16 >=3.8, <=3.11
2.0 0.15 >=3.8, <=3.11
older versions
torch torchvision Python
1.13 0.14 >=3.7.2, <=3.10
1.12 0.13 >=3.7, <=3.10
1.11 0.12 >=3.7, <=3.10
1.10 0.11 >=3.6, <=3.9
1.9 0.10 >=3.6, <=3.9
1.8 0.9 >=3.6, <=3.9
1.7 0.8 >=3.6, <=3.9
1.6 0.7 >=3.6, <=3.8
1.5 0.6 >=3.5, <=3.8
1.4 0.5 ==2.7, >=3.5, <=3.8
1.3 0.4.2 / 0.4.3 ==2.7, >=3.5, <=3.7
1.2 0.4.1 ==2.7, >=3.5, <=3.7
1.1 0.3 ==2.7, >=3.5, <=3.7
<=1.0 0.2 ==2.7, >=3.5, <=3.7

Image Backends

Torchvision currently supports the following image backends:

  • torch tensors
  • PIL images:

Read more in in our docs.

[UNSTABLE] 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<4.3'
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}}
}

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

Total release size: 106.1 MB

Release files / torchvision-0.18.1-cp312-cp312-win_amd64.whl

Download URL torchvision-0.18.1-cp312-cp312-win_amd64.whl
Size 1.2 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
ed6340b69a63a625e512a66127210d412551d9c5f2ad2978130c6a45bf56cd4a
BLAKE2b-256 checksum
How to use checksums
0f0530ed3e81a610a236426eed6ac57ae0f1bbc4d526008e331f750e34e88c06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

Release files / torchvision-0.18.1-cp312-cp312-manylinux2014_aarch64.whl

Download URL torchvision-0.18.1-cp312-cp312-manylinux2014_aarch64.whl
Size 14.0 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
13d24d904f65e62d66a1e0c41faec630bc193867b8a4a01166769e8a8e8df8e9
BLAKE2b-256 checksum
How to use checksums
a05521e2849ecdab10a04392e2f892f5c70eff72adf71507e852e091e8c5f88f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

Release files / torchvision-0.18.1-cp312-cp312-manylinux1_x86_64.whl

Download URL torchvision-0.18.1-cp312-cp312-manylinux1_x86_64.whl
Size 7.0 MB
Tags CPython 3.12 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
f118d887bfde3a948a41d56587525401e5cac1b7db2eaca203324d6ed2b1caca
BLAKE2b-256 checksum
How to use checksums
cfea02b9fdc72aac151313c95f214fdbb50f95152f33e7cb7ae4e14d717bfa01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

Release files / torchvision-0.18.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL torchvision-0.18.1-cp312-cp312-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2be6f0bf7c455c89a51a1dbb6f668d36c6edc479f49ac912d745d10df5715657
BLAKE2b-256 checksum
How to use checksums
4e9092c927d4ca82934c3a1cb0ee3374067bd79f7a465395c1261d3eb17a511f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp311-cp311-win_amd64.whl
Size 1.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
52f7436140045dc2239cdc502aa76b2bd8bd676d64244ff154d304aa69852046
BLAKE2b-256 checksum
How to use checksums
e4c3a21a75dd2de8114a6876f16a36b033e3e62f8ade68085a711b24f4b57c17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp311-cp311-manylinux2014_aarch64.whl
Size 14.0 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
ceb993a882f1ae7ae373ed39c28d7e3e802205b0e59a7ed84ef4028f0bba8d7f
BLAKE2b-256 checksum
How to use checksums
04d813287fc08ed60553033233f47478b8af9f56e2432333e9ad1400a28084db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp311-cp311-manylinux1_x86_64.whl
Size 7.0 MB
Tags CPython 3.11 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
9077cf590cdb3a5e8fdf5cdb71797f8c67713f974cf0228ecb17fcd670ab42f9
BLAKE2b-256 checksum
How to use checksums
82d8fad23c368781b6e6df254287511683b4d151132de64c47a6fea5c3280ba6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp311-cp311-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
80b5d794dd0fdba787adc22f1a367a5ead452327686473cb260dd94364bc56a6
BLAKE2b-256 checksum
How to use checksums
0f028d3f83e01cf7fd72884fe84d4ff737ce774c5a7653bb826cf7acd39179f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp310-cp310-win_amd64.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
ef7bbbc60b38e831a75e547c66ca1784f2ac27100f9e4ddbe9614cef6cbcd942
BLAKE2b-256 checksum
How to use checksums
4e623816637079b77875077678bd7087285a5b5589664f94f5ceb2d080cc024c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp310-cp310-manylinux2014_aarch64.whl
Size 14.0 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
573ff523c739405edb085f65cb592f482d28a30e29b0be4c4ba08040b3ae785f
BLAKE2b-256 checksum
How to use checksums
9d7e38b7d6689e988f23a2c07782e045abaf2d54c7b63086f164c4dbd41228b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp310-cp310-manylinux1_x86_64.whl
Size 7.0 MB
Tags CPython 3.10 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
0b3bda0aa5b416eeb547143b8eeaf17720bdba9cf516dc991aacb81811aa96a5
BLAKE2b-256 checksum
How to use checksums
080417425bf3c0620465ee182cea5c674db4debab87ed0627145d38039cb2a9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp310-cp310-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3e694e54b0548dad99c12af6bf0c8e4f3350137d391dcd19af22a1c5f89322b3
BLAKE2b-256 checksum
How to use checksums
f231867be50508348030afea933e859bd7bbeb86924a6c2e35faf7777fbd6f55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp39-cp39-win_amd64.whl
Size 1.2 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
5c8366a1aeee49e9ea9e64b30d199debdf06b1bd7610a76165eb5d7869c3bde5
BLAKE2b-256 checksum
How to use checksums
3f735dadc116a8e6115f0f3c015ed0c415d301330ddb385bc6c501686e019443
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp39-cp39-manylinux2014_aarch64.whl
Size 1.6 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
54bfcd352abb396d5c9c237d200167c178bd136051b138e1e8ef46ce367c2773
BLAKE2b-256 checksum
How to use checksums
099329e01f8b4cd81d16b3020f3dab0c7837efc1c099b8998fd581e36e4dbdd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp39-cp39-manylinux1_x86_64.whl
Size 7.0 MB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
da83c8bbd34d8bee48bfa1d1b40e0844bc3cba10ed825a5a8cbe3ce7b62264cd
BLAKE2b-256 checksum
How to use checksums
77b776e7c97aea1df00aabef8413d0048c0f693bb44027e57362768199f4e8e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp39-cp39-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
975b8594c0f5288875408acbb74946eea786c5b008d129c0d045d0ead23742bc
BLAKE2b-256 checksum
How to use checksums
e826e414c50dd13a19f5a4a68e32503e86066ce1b2cdf84b6ec49d25e3a85465
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

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

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

Download URL torchvision-0.18.1-cp38-cp38-manylinux2014_aarch64.whl
Size 14.0 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
9726c316a2501df8503e5a5dc46a631afd4c515a958972e5b7f7b9c87d2125c0
BLAKE2b-256 checksum
How to use checksums
cc41e059049363387d027cf76405c51fbc85b88eb369df9881cea20110286179
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp38-cp38-manylinux1_x86_64.whl
Size 7.0 MB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
02085a2ffc7461f5c0edb07d6f3455ee1806561f37736b903da820067eea58c7
BLAKE2b-256 checksum
How to use checksums
13b2d0afeea84eb660468c965d7e3606542f511c9436ddbe80e596acb39fad03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

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

Download URL torchvision-0.18.1-cp38-cp38-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b1c3864fa9378c88bce8ad0ef3599f4f25397897ce612e1c245c74b97092f35e
BLAKE2b-256 checksum
How to use checksums
768fd8f9aa2c34e75d378ec8f20b82bc49695c0701cdb293fb7feed2ec8dd839
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.18.1 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