Skip to main content

image and video datasets and models for torch deep learning

Project description

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

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

torchvision-0.18.0-cp312-cp312-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12 Windows x86-64

torchvision-0.18.0-cp312-cp312-manylinux1_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.12

torchvision-0.18.0-cp312-cp312-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

torchvision-0.18.0-cp311-cp311-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11 Windows x86-64

torchvision-0.18.0-cp311-cp311-manylinux1_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.11

torchvision-0.18.0-cp311-cp311-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

torchvision-0.18.0-cp310-cp310-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10 Windows x86-64

torchvision-0.18.0-cp310-cp310-manylinux1_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.10

torchvision-0.18.0-cp310-cp310-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

torchvision-0.18.0-cp39-cp39-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.9 Windows x86-64

torchvision-0.18.0-cp39-cp39-manylinux1_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.9

torchvision-0.18.0-cp39-cp39-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

torchvision-0.18.0-cp38-cp38-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.8 Windows x86-64

torchvision-0.18.0-cp38-cp38-manylinux1_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.8

torchvision-0.18.0-cp38-cp38-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

File details

Details for the file torchvision-0.18.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7c770f0f748e0b17f57c0297508d7254f686cdf03fc2e2949f422b20574f4c0f
MD5 1e6307a0d0acf7378ad5471afca185f9
BLAKE2b-256 538a864c3969af219a95213a5065d453313a96598e7c744b859e99b6ac134e16

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a964afbc7ddf50a46b941477f6c35729b416deedd139756befd488245e2e226d
MD5 220c6bed11875b31a7f6364c2eabeae5
BLAKE2b-256 512d30883e9c6734546f9e7e0c429b76bd2b651aa25f6ced087c9c11cbf2ef41

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp312-cp312-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp312-cp312-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b657d052d146f24cb3b2a78219bfc82ae70a9706671c50f632528907d10cccec
MD5 ff683bd480f2a5da4529a9072f2ebb7f
BLAKE2b-256 6dfe729256fec03403b0bfdc229d4350936e29020d618f1740009c6a4f995b06

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eb9d83c0e1dbb54ecb0fb04c87f786333e3a6fb8b9c400aca7c31081f9aa5707
MD5 27363014a5ca8a2fba8403ac5e57ab16
BLAKE2b-256 7c1249d4fd4ae7a48c6d33babb01a523594aca38365d378518320a10f9a5baa1

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6ad70ddfa879bda5ed886b2518fe562640e0059787cbd65cb2bffa7674541410
MD5 d96afa4a95c86419287597c47de2d18d
BLAKE2b-256 12c27c89c62f2b0a606070aa7cdb8af8af0c905562942778ebdd77600642c3b9

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e5a24d620cea14a4bb89f24aa2b506230c0a16a3ada57fc53ad80cfd256a2128
MD5 ddffe2dae5ca518be9b80448b359af66
BLAKE2b-256 701d107894816bf5ebecbc5a8556743fd89c0a1dd6da82b1c562d6becd5a108a

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp311-cp311-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3d7955398d4ceaad77c487c2c44f6f7813112402c9bab8cd906d346005891048
MD5 0a4ddf36d279a65a84921abcb4f7e43d
BLAKE2b-256 6e7dbc67ec2d1011226e75cdcc45a2c85d97b8eaac32a7d648b71c432d584367

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6896a52168befe1105fb3c9335287390ed227e71d1e4ec4d68b62e8a3099fc09
MD5 a86fff416ca562d68df9af5103f74dda
BLAKE2b-256 b514c05da13c98f528ba5fd99897320a7684df5dd136ec6faa6a5766f25e4a7e

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bd8e6f3b5beb49965f15c461302488edfa3d8c2d01d3bb79b150d6fb62711e3a
MD5 cd7b057158de52015ed181d3d4b80633
BLAKE2b-256 f3eff9559f3fc09362eafea5937521a2013a3ae67e38a7c6c3c9b51b3751c320

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5337f6acfa1fe959d5cb340d01a00614d6b31ce7a4824ccb95435a85c5273b95
MD5 2f5c672a4640b6333212be3110d5ecf0
BLAKE2b-256 b2dde5d39496413a5e5c2ca69d333bc241e7c8e8e412778c8309d54ce27cb9ec

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp310-cp310-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 493c45f9937dad37aa1b64b14da17c7a589c72b91adc4837d431009cfe29bd53
MD5 2d6db82f51dcbae3a27e2cdb54f7408a
BLAKE2b-256 d47ed41b771dbffa927b9cc37372b1e18c881348cd18a0e4ad73f2c6bdf56c0e

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd61628a3d189c6852a12dc5ed4cd2eece66d2d67f35a866cb16f1dcb06c8c62
MD5 5a07e23806600b74bbf0f4f8fea3f6b3
BLAKE2b-256 c5e719e06d609f44f2c670db1056817deb928412ed329ff3f63cc2a27231b029

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ccc292e093771d5baacf5535ac4416306b6b5f15676341cd4d010d8542eace25
MD5 45bdace1476565bfa9e2efe1c7798ea4
BLAKE2b-256 db4a33a91dfcce5d62f826b15691a3bda2cdf62e4fbaf164f469af6a6756ebb4

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 36efd87001c6bee2383e043e46a025affb03179747c8f4777b9918527ffce756
MD5 fe58513a74517fa2fd50c6585c183ce6
BLAKE2b-256 7273b50f27719a9d0d9decae9f4264967a5c54a84046d1986772316d2471b6a2

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp39-cp39-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4c334b3e719ba0a9ba6e15d4aff1178f5e6d029174f346163fed525f0ccfffd3
MD5 d5c251bd85f83b9eb155ee5c4681b61f
BLAKE2b-256 5420309df7711dd17c399b7cd233e78bcee0f6fcdfbef5f2ec0930910c1884df

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 75e22ecf44a13b8f95b8ad421c0261282d859c61816badaca1959e073ccdd691
MD5 87713bf133d0bca725741dcf51214c60
BLAKE2b-256 d1dcbace7633ce37bc165fb6509e741d3cd73535f36e86b3ee5a95b2b647af92

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 95b42d0dc599b47a01530c7439a5751e67e45b85e3a67113989cf7c7c70f2039
MD5 fdfaa77fd6aef66f44f032a2e5ab021b
BLAKE2b-256 80adde37308a32ff3d6b0375469a1238d74365c60d1aca926bddcc91ec44c1ac

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 925d0a82cccf6f986c18b29b4392a942db65cbdb73c13a129c8493822eb9e36f
MD5 296b32b1b2861fb591586eda871f0c43
BLAKE2b-256 6d19a117afae3c5381743f1e8257dc3300dd430cca51535eebd88e784010505d

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp38-cp38-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6323f7e5423ff2594d5891863b919deb9d0de95f01c36bf26fbd879036b6ed08
MD5 c61b769bb8ecd16954cb8fd1657c9d40
BLAKE2b-256 219180aa23610e5eecf0ebcf033b31e2381ee77cb6fe999b44924665f39b8315

See more details on using hashes here.

File details

Details for the file torchvision-0.18.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torchvision-0.18.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2115a1906c015f5da9ceedc40a983313b0fd6e2c8a17108a92991706f51f6987
MD5 2434d1fd910f3fe6da786eb864249a1a
BLAKE2b-256 53d349f3d282fe2af89e6d192bb86e59e25282b3b68c14b2d143e466fe0f0820

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page