Skip to main content

image and video datasets and models for torch deep learning

Reason this release was yanked:

Contains an incorrect torch dependency

Project description

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

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.15.0-cp311-cp311-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11 Windows x86-64

torchvision-0.15.0-cp311-cp311-manylinux2014_aarch64.whl (865.1 kB view details)

Uploaded CPython 3.11

torchvision-0.15.0-cp311-cp311-manylinux1_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.11

torchvision-0.15.0-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

torchvision-0.15.0-cp311-cp311-macosx_10_9_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

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

Uploaded CPython 3.10 Windows x86-64

torchvision-0.15.0-cp310-cp310-manylinux2014_aarch64.whl (865.1 kB view details)

Uploaded CPython 3.10

torchvision-0.15.0-cp310-cp310-manylinux1_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.10

torchvision-0.15.0-cp310-cp310-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

torchvision-0.15.0-cp310-cp310-macosx_10_9_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

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

Uploaded CPython 3.9 Windows x86-64

torchvision-0.15.0-cp39-cp39-manylinux2014_aarch64.whl (865.1 kB view details)

Uploaded CPython 3.9

torchvision-0.15.0-cp39-cp39-manylinux1_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.9

torchvision-0.15.0-cp39-cp39-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

torchvision-0.15.0-cp39-cp39-macosx_10_9_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

torchvision-0.15.0-cp38-cp38-manylinux1_x86_64.whl (33.8 MB view details)

Uploaded CPython 3.8

torchvision-0.15.0-cp38-cp38-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

torchvision-0.15.0-cp38-cp38-macosx_10_9_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 32b3b02b4eb81ea5207f488c28cfd01004574f51b42ddecceeb7e4585d6f61c1
MD5 f9a7cc24015f1d8d9f5bb3f7f06622f4
BLAKE2b-256 b76c1b55ef665da86d19945a528d85b73a52ab08f6d803105dd267ce2a27626f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 69cc75de7ef4c87461580e5da608bd6763ab5bf8cc396323a7c37b5433d42c9b
MD5 edc0394085a41da2a21d50e827513e32
BLAKE2b-256 6f045fd078c82b6e233bc68788fdc8cdedb428c10e52ae0d2519a8660a469370

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 70a7236260879d1f52b8a9018c8eb1ea3a32dca8c2caff35590be989b1393fd9
MD5 948a05c1657160acd0583670ad28265e
BLAKE2b-256 f3dbb00054f36c7655a9c09697ec93ae6ff7c5a3d19d722bdfc1499e57bee94b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 82f3313b06d30c7d91d12f43d65a434aa89bf2abac5c044c56cb9d76eee9a5c7
MD5 d13f7f7f4f5f0fbbcbca22a61a36f7aa
BLAKE2b-256 fde7de6a1939a94d343206e8ff1a0231220d2f66f6e112f765af063acdc218d6

See more details on using hashes here.

File details

Details for the file torchvision-0.15.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for torchvision-0.15.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5e204e4728f1fc922d8e51975b82a83db85566c5addccb17ff607e87dc233f96
MD5 8e28cc55615646190f5beb0310672979
BLAKE2b-256 a11981950ae4da32f2cd31623ca1b08295be5b64bc6f84d761c2cab09cc48063

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e4617ce4ed9f86e3e31343c297648011d0425fc9b2d59167664cd89cd28101f9
MD5 90166da4c5180ed12b724d9da3a9a15d
BLAKE2b-256 9be7bb564c29a96e34b295681c55a12fd31ebc98941dac01d999abadc9a0fe51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ab6dbfc49422a904d681045d8a25b8cb761eeb6174c7d05ff70f04900ebc583c
MD5 afa4c11bbcb8165c1fa43f5ccdc48c0b
BLAKE2b-256 1b19042aab814ab737756a30f669bb620c7e28c677465ae5ba420172fdd3cd7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 54027cc9e9d7f862777a1a8bca1d06eac07aff1d974990498859b4c52e4b418b
MD5 7a85b8080896e65ff903b1f9bc4ff961
BLAKE2b-256 03f5fc17a39d8be4f625ea70c26a4c2f650ea15b38511dcf6c0e76d7a6810de5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b3a6a8673404a3592ccb23108e21bcf227fe599419d4af8b1b778a2c8e1da05
MD5 e2e3a317449366bdb87d3f6c90bedd52
BLAKE2b-256 a6a8f3352ef365267b7519381cf10ab5b31cf83193461ccbe4dc84c18427f391

See more details on using hashes here.

File details

Details for the file torchvision-0.15.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for torchvision-0.15.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d55106216b6733e8f7707086b65f2d1c0a42267da9adaf4a24b20397f8b27fc8
MD5 8cce48634dc5ac64eb192a7bdf11172c
BLAKE2b-256 4f6a9a27191962643fe9a5776503af92d989116e0dfdb0b6bdbb89614934fd46

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 18e0160b413d221c211a4dcbed5d676158e54d76c1d532975502c2cf230cf6d1
MD5 7a0616e8cf3cb819eee12158f6392737
BLAKE2b-256 7931b4caf2c73296f1f12ae7af6647bf48b51442bd68fd8c40426e5a60f46dd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6df40a36d39be2758e5280255d3348d64aeda670b81fca77ba76de80c86dbd60
MD5 7b1ef0bf31bb59ea01f22a926475c386
BLAKE2b-256 3d6f0d314c484135e282cf8367102161a1bc186cc2c3a9acb9097ce5d17c6dc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5044d5dc18305a9213b8da451e408e1fd85176072ff2d37ab75839aec8b7282b
MD5 5ea77699cfbb7f7ab0a34894319075ae
BLAKE2b-256 2db146d25f1c292b17522c2a710c7126f2199b47f8938d2137f917e467214740

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d190d863aebf9ebbc00c26ccd203c410c588d6f987a511e9bf40a32f3847c7c0
MD5 c67c06aad9f28e718e53d0c5d8b7a409
BLAKE2b-256 d8386ec7b78debbbe36392bea458b38a51cf3a0e223cbc9c31841dfe29e09a5d

See more details on using hashes here.

File details

Details for the file torchvision-0.15.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for torchvision-0.15.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d624b0d58c0417ce6c3a301c6540a45850954cfad7bd941681868f6846cd9171
MD5 7339adde3d49e17c3e861df984574f25
BLAKE2b-256 a8c34d1753d95f167f43309395c926a28e1b65c4bc5a9086d497f3551c377c3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 87ed73c3eb7c00434ecd9fe3a342a329d3b83d27c4cafc03bf52bf4362d1b8eb
MD5 842c68a5856b44647fa0d114804203f8
BLAKE2b-256 feca7f14521aca52b01527bcda66ce61c51c88eaf4cf8c4a88bfe8c7d500b5ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 76035603bd2bfc9811c732bdb87e9b85298222ed9b5261a12d19ecd9ffa8ebc2
MD5 a224554bc98e489bb74ef6f3b6ea6c54
BLAKE2b-256 cf049c07ac5dce8fe216bc730b68e37480b3d58676a57d55cc99228fd6c1c35f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cb9df39b8ae75cc09f2718182bf9a9268ee36c2ef292cff0d0ce91261c2b3529
MD5 f6d321ff73a60e645154a6a6871ea8ea
BLAKE2b-256 ba26ff4bf089f2de836fdea923e2f54859fb3910c951c7106a9688edf96f3b5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2bc53aa30ef18841e4dcbc826ee66d4a9b8baf805e41bfeabdf581868a9f7d8a
MD5 5925fb8078af212fa16aaf77232dbdbf
BLAKE2b-256 ac87f0b1ee255c84923179c8dc57d0220224ff32d5ff55dae20525fcc6ab7897

See more details on using hashes here.

File details

Details for the file torchvision-0.15.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for torchvision-0.15.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cc9b09044d9c11e67373e9104fef5859a3808d29c557bcb888c8e64603c3bad8
MD5 96d2d8f652dbda0d0c68084da108f949
BLAKE2b-256 147eb5ac1d89ab3dfad492f60abb0c26579c52571e33a0d5bbc06f2bcb14b9a9

See more details on using hashes here.

Supported by

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