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

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded CPython 3.11Windows x86-64

torchvision-0.15.1-cp311-cp311-manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.11

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

Uploaded CPython 3.11

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.9+ x86-64

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

Uploaded CPython 3.10Windows x86-64

torchvision-0.15.1-cp310-cp310-manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.10

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

Uploaded CPython 3.10

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 10.9+ x86-64

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

Uploaded CPython 3.9Windows x86-64

torchvision-0.15.1-cp39-cp39-manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.9

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

Uploaded CPython 3.9

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

Uploaded CPython 3.9macOS 11.0+ ARM64

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

Uploaded CPython 3.9macOS 10.9+ x86-64

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

Uploaded CPython 3.8Windows x86-64

torchvision-0.15.1-cp38-cp38-manylinux2014_aarch64.whl (17.5 MB view details)

Uploaded CPython 3.8

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

Uploaded CPython 3.8

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

Uploaded CPython 3.8macOS 11.0+ ARM64

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

Uploaded CPython 3.8macOS 10.9+ x86-64

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2852f501189483187ce9eb0ccd01b3f4f0918d29057e4a18b3cce8dad9a8a964
MD5 25e280e76bba098fc864a1364400d499
BLAKE2b-256 5d5030dfe7f20f670d232f5d57fc7a01a30329930a980610aa66662be558fd55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b2e8394726009090b40f6cc3a95cc878cc011dfac3d8e7a6060c79213d360880
MD5 66328f1b894bcb1d614f90f00e1bf9f0
BLAKE2b-256 d06cf22b20070d8f2fab1d5c587de54a9e6130efd7fbbcc76c604291a3fb5684

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 13f71a3372d9168b01481a754ebaa171207f3dc455bf2fd86906c69222443738
MD5 8326eb6f16c3c22700f46176843a87e1
BLAKE2b-256 03fa526fb78b6431d8fbcf4591a77e8c25ec004b196de535ac639cfc5c46116a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b60e1c839ae2a071befbba69b17468d67feafdf576e90ff9645bfbee998de17
MD5 d1384ac637276de9870594f8c920da85
BLAKE2b-256 35667b2d1b97262728fbfe151493563843b3875a87819e33fa23974e052eed59

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 97b90eb3b7333a31d049c4ccfd1064361e8491874959d38f466af64d67418cef
MD5 10bc240510b7223052e5bf2595a7cb9a
BLAKE2b-256 a2740943eb253e5fca282826ad786d1e2aa20b66ac75f85a3fb31770a3e77a40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c84e97d8cc4fe167d87adad0a2a6424cff90544365545b20669bc50e6ea46875
MD5 86bea3a6890f730a48d14f57eba30ccc
BLAKE2b-256 03066ba7532c66397defffb79f64cac46f812a29b2f87a4ad65a3e95bc164d62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b82fcc5abc9b5c96495c76596a1573025cc1e09d97d2d6fda717c44b9ca45881
MD5 6f9dec099a70df1e8e701fd4f35621c2
BLAKE2b-256 12291a4df782162466db101259b8270d87bc81d737dc61be266ba599037ffae3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d4de10c837f1493c1c54344388e300a06c96914c6cc55fcb2527c21f2f010bbd
MD5 324e9c520ba12716db29000f6802518c
BLAKE2b-256 348d43f36b6ff585de3ebd5df10ef07c4377b2cce9155f9810c7382427c1430e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3708d3410fdcaf6280e358cda9de2a4ab06cc0b4c0fd9aeeac550ec2563a887e
MD5 bd459bb245c172bf0c3311de8f6fd4a3
BLAKE2b-256 199339c1f081aca0aa31f9ad3d767ccdc21c6b9acc216a42408018c3ee12750d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bc10d48e9a60d006d0c1b48dea87f1ec9b63d856737d592f7c5c44cd87f3f4b7
MD5 736128ab40bf4503d12b3ab548770eb4
BLAKE2b-256 586643b0cd4fc0c614abdeac067927448c8fb2c1d231b3caa18ff1c23deec290

See more details on using hashes here.

File details

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

File metadata

  • Download URL: torchvision-0.15.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for torchvision-0.15.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 21e6beb69e77ef6575c4fdd0ab332b96e8a7f144eee0d333acff469c827a4b5e
MD5 cb837c53267c29c18cb3fbddee2c19c0
BLAKE2b-256 cb2f1330c3d9ef3d66caff94c5ea473b13cbd153c40f028708d88d9cedb6b8a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e9b4bb2a15849391df0415d2f76dd36e6528e4253f7b69322b7a0d682535544b
MD5 4105132d580e8d0a6523aa06a5e84225
BLAKE2b-256 891214e3114ac16ab113b984ddb22116773a79e5b5b7c10de5d21676e03f3abc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ff4e650aa601f32ab97bce06704868dd2baad69ca4d454fa1f0012a51199f2bc
MD5 0db652a3c610f4f12493c30b934bcdba
BLAKE2b-256 0746961d094cbab8ceac9dfa222012b7a706054a9a72051f932f48a401267af9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c153710186cec0338d4fff411459a57ddbc8504436123ca73b3f0bdc26ff918c
MD5 2095d00981260798ab8d65abf524904e
BLAKE2b-256 0eefac1ee44fc4c075d094940163bcb592f7aec94774d43be29b5a7da3aa0200

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1dfdec7c7df967330bba3341a781e0c047d4e0163e67164a9918500362bf7d91
MD5 51354e92a7bc77c58b728040c71cc9f4
BLAKE2b-256 894a2dd4ac04998a6eeaad414312a7a3ab7615092abc5241fd19e775ef5c89e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: torchvision-0.15.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for torchvision-0.15.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b45324ea4911a23a4b00b5a15cdbe36d47f93137206dab9f8c606d81b69dd3a7
MD5 7b5fffd0c2d5c7c7b20279ffd215a6ac
BLAKE2b-256 0e2fbfd590bf3bfd4cb326cdd6bd81600f77e5eaddad718f1dc87e2ca9312582

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7fe9b0cd3311b0db9e6d45ffab594ced06418fa4e2aa15eb2e60d55e5c51135c
MD5 9ed0acf875f22979fe095d512cf30abf
BLAKE2b-256 73d34e9876401d16d3fb647dfc895fdc60071f2d0bb35e4bbe6453e3fe390753

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 43624accad1e47f16824be4db37ad678dd89326ad90b69c9c6363eeb22b9467e
MD5 8cd33f27758784b166b3e3709b6eaa5f
BLAKE2b-256 acc7c1fb8058c402e996e2cb4bcfc0fad362077da9e526c7e33e0e41a4a82f9d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e714f362b9d8217cf4d68509b679ebc9ddf128cfe80f6c1def8e3f8a18466e75
MD5 2752a3ecf9f93fe991eec5980b863484
BLAKE2b-256 4a173a6e67a2230e475290751464ae1e594568eba693540f9ee6279b4d346b84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torchvision-0.15.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e5861baaeea87d19b6fd7d131e11a4a6bd17be14234c490a259bb360775e9520
MD5 3760d62b505f7b95fe11b41b3e9d1a9a
BLAKE2b-256 e22bf67908b6ad5ce2bd67a6439db83c3749ccfeeef415d8fc16859f49783cae

See more details on using hashes here.

Supported by

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