Skip to main content

image and video datasets and models for torch deep learning

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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.11

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

Uploaded CPython 3.11 macOS 11.0+ ARM64

torchvision-0.15.2-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.2-cp310-cp310-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

torchvision-0.15.2-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.2-cp39-cp39-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

torchvision-0.15.2-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.2-cp38-cp38-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

torchvision-0.15.2-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.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for torchvision-0.15.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 10be76ceded48329d0a0355ac33da131ee3993ff6c125e4a02ab34b5baa2472c
MD5 d0fc9c7f7be51b9396d60d9c7977242d
BLAKE2b-256 d526a1e128500fb661d3ee7d99b97fb45d3b83e57091278c9babec859da7b87f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b02a7ffeaa61448737f39a4210b8ee60234bda0515a0c0d8562f884454105b0f
MD5 a93657af1eb4bfb7984b43d51b974690
BLAKE2b-256 66e0cd847d4d22be88a71d5d65f5809342e7ea7ded62230e7bde7420a2105e51

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 012ad25cfd9019ff9b0714a168727e3845029be1af82296ff1e1482931fa4b80
MD5 42d65ad694a159784da2d4412821835c
BLAKE2b-256 4b62b6ec55347600b02b0a2a6596e673c69424aea7360c48343653866e66aa0d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 757505a0ab2be7096cb9d2bf4723202c971cceddb72c7952a7e877f773de0f8a
MD5 b67ae6e80065b94a1eb95183e531ee48
BLAKE2b-256 8a6dd713159642b36c42f5b6871330241070797ec89d3f8855eeb91c8baddddd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5f35f6bd5bcc4568e6522e4137fa60fcc72f4fa3e615321c26cd87e855acd398
MD5 e34061be8217e69c80f69937f111fa1f
BLAKE2b-256 69402f3b2392ce7c4b856a5964803c4bc0bf0d5fc75ff7f6cc64cc2058c3e700

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 96fae30c5ca8423f4b9790df0f0d929748e32718d88709b7b567d2f630c042e3
MD5 f9641ca0fe8f871194fc383abaf69ec5
BLAKE2b-256 9e1dcb1e7f25b6dda4e672ed8a3e7fbd073ec39e2ba6c378c3071ef2cd6100e1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1eefebf5fbd01a95fe8f003d623d941601c94b5cec547b420da89cb369d9cf96
MD5 513171e835ee64bf210a028320e22eac
BLAKE2b-256 165e51c5fde550161edcfa3e131c51a8b4261775ebb2b118b3560116fa9f7a73

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 54143f7cc0797d199b98a53b7d21c3f97615762d4dd17ad45a41c7e80d880e73
MD5 4e1c638304bbafc7f0b7d87c969f2075
BLAKE2b-256 870f88f023bf6176d9af0f85feedf4be129f9cf2748801c4d9c690739a10c100

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 37eb138e13f6212537a3009ac218695483a635c404b6cc1d8e0d0d978026a86d
MD5 206c5a99d197a68f76fcf14d3b642452
BLAKE2b-256 d2bf4cd5133120e6cbcc2fa5c38c92f2f44a7486a9d2ae851e3d5a7e83f396d5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7754088774e810c5672b142a45dcf20b1bd986a5a7da90f8660c43dc43fb850c
MD5 870d361c9b3e54692809ee264ebd61a3
BLAKE2b-256 16e73b43cce519d7236bbbdc31f468b43ae2084ff7db8cb162764311028d32a1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 07c462524cc1bba5190c16a9d47eac1fca024d60595a310f23c00b4ffff18b30
MD5 c79e94d59f58d902ac3098aa24e84f80
BLAKE2b-256 d848e2a056436033da54856d793e12dc0fcf8cdd179fd4cd0d1ce7c7ce659797

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b85f98d4cc2f72452f6792ab4463a3541bc5678a8cdd3da0e139ba2fe8b56d42
MD5 991e08f65890bf759c180c63c8733a04
BLAKE2b-256 b85513d0fc65a4e0dab3dbdcc39ce51285c7b44297f197a5e13f9558cf67cefb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 63df26673e66cba3f17e07c327a8cafa3cce98265dbc3da329f1951d45966838
MD5 f92d24a30daef9274691eaa1a778b15d
BLAKE2b-256 419e8809e45a084680394e8d219fcf8a2c0eed2dddf1ec0a7968f4052826a6e9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 987ab62225b4151a11e53fd06150c5258ced24ac9d7c547e0e4ab6fbca92a5ce
MD5 6ea1aea9536457e2cbaf98ace0258f56
BLAKE2b-256 15500485f9ef81d5e70b1408dafd65e3269ad32321ce8e58d5d549d19a3e9135

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4790260fcf478a41c7ecc60a6d5200a88159fdd8d756e9f29f0f8c59c4a67a68
MD5 9708b8d4aefc709ba6b44b797e217198
BLAKE2b-256 55fe8e5f1e89294ef0216b6280719f0f70ef286b7316eb59c8fbd1307974dc4b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c07071bc8d02aa8fcdfe139ab6a1ef57d3b64c9e30e84d12d45c9f4d89fb6536
MD5 405395d3ed2b70c2985c0a1c3de80228
BLAKE2b-256 e0058264dffad43c6a785787515db6d9af2ca80ec2d2c16a0be9968f755a3c8b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9a192f2aa979438f23c20e883980b23d13268ab9f819498774a6d2eb021802c2
MD5 8dfd260460cfaf7b13b667abd67a2372
BLAKE2b-256 7b41c94ead27ee4750ec76e62efe6e2e432fd58586978da449327de1f0d2e998

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c55f9889e436f14b4f84a9c00ebad0d31f5b4626f10cf8018e6c676f92a6d199
MD5 1615626485effccb6cfcd943243a7b2f
BLAKE2b-256 3171a362404ae76eaac714f704cb3338d8bfdf3692004a0e0799e002260a1391

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31211c01f8b8ec33b8a638327b5463212e79a03e43c895f88049f97af1bd12fd
MD5 4532f01ff39ca253e652f2b2a45f84b0
BLAKE2b-256 da4b08357c9d14bc15306c60107e1fa33c317720e34b72606cb662937bc37593

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8f12415b686dba884fb086f53ac803f692be5a5cdd8a758f50812b30fffea2e4
MD5 e726a0c124e9719c0e3a67a93f3702d6
BLAKE2b-256 6c9cb75aaaa78d8f2deb374398128ce7350450dbfcb891956767e0f39177482c

See more details on using hashes here.

Provenance

Supported by

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