Skip to main content

image and video datasets and models for torch deep learning

Project description

torchvision

https://codecov.io/gh/pytorch/vision/branch/master/graph/badge.svg 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

master / nightly

master / nightly

>=3.6

1.7.1

0.8.2

>=3.6

1.7.0

0.8.1

>=3.6

1.7.0

0.8.0

>=3.6

1.6.0

0.7.0

>=3.6

1.5.1

0.6.1

>=3.5

1.5.0

0.6.0

>=3.5

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

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.

C++ API

TorchVision also offers a C++ API that contains C++ equivalent of python models.

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.

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/docs/stable/torchvision/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!

Project details


Release history Release notifications | RSS feed

This version

0.9.0

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.9.0-cp39-cp39-win_amd64.whl (852.5 kB view details)

Uploaded CPython 3.9 Windows x86-64

torchvision-0.9.0-cp39-cp39-manylinux1_x86_64.whl (17.3 MB view details)

Uploaded CPython 3.9

torchvision-0.9.0-cp39-cp39-macosx_10_9_x86_64.whl (13.1 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

torchvision-0.9.0-cp38-cp38-win_amd64.whl (852.7 kB view details)

Uploaded CPython 3.8 Windows x86-64

torchvision-0.9.0-cp38-cp38-manylinux1_x86_64.whl (17.3 MB view details)

Uploaded CPython 3.8

torchvision-0.9.0-cp38-cp38-macosx_10_9_x86_64.whl (13.2 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

torchvision-0.9.0-cp37-cp37m-win_amd64.whl (852.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

torchvision-0.9.0-cp37-cp37m-manylinux1_x86_64.whl (17.3 MB view details)

Uploaded CPython 3.7m

torchvision-0.9.0-cp37-cp37m-macosx_10_9_x86_64.whl (13.2 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

torchvision-0.9.0-cp36-cp36m-win_amd64.whl (852.7 kB view details)

Uploaded CPython 3.6m Windows x86-64

torchvision-0.9.0-cp36-cp36m-manylinux1_x86_64.whl (17.3 MB view details)

Uploaded CPython 3.6m

torchvision-0.9.0-cp36-cp36m-macosx_10_9_x86_64.whl (13.2 MB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: torchvision-0.9.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 852.5 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for torchvision-0.9.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b03275f351feffaf7450d234ffb57cce26ff5e696d01ef5f543de205f18849a9
MD5 efd8a188f0cdbf7d3ba57c176d7b9599
BLAKE2b-256 608e227796b0b41f190bd28d07c7a1aab3d24fd49c109ef04179db06fd61c4c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: torchvision-0.9.0-cp39-cp39-manylinux1_x86_64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for torchvision-0.9.0-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d85d405e8cf694c1f85da7f0496ea69dd4f8d8dafbdad1e29bcdc4c621fc5cf0
MD5 faa83064f09e6bde371a59161f77c818
BLAKE2b-256 25ceba303023a3d36d31a8f6cab12c2b0b56fa61ceb61cf44d3e3835502a0c2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: torchvision-0.9.0-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 13.1 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for torchvision-0.9.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 421bda7131f3c0eae2260f10174ac3c49e54183b33acb927b4b572f4cd90066d
MD5 162b5a4c1d3a8206732fbae4184c0110
BLAKE2b-256 d374e92e310c375ef8ce5e24e486288072b72676eba06741d5952838d5d529d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: torchvision-0.9.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 852.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for torchvision-0.9.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2252bc63fcccb27785726dd9d0d9a97432657a5d139390bf93cd6bdf227a4401
MD5 f7b438a40e5627f5b1c4427810d64ea2
BLAKE2b-256 e380990ee679f2c29a2d79446cd79e3ed82ec446f7eaf4257e9478a3b6f02f7d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: torchvision-0.9.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for torchvision-0.9.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8fce78a59959f4bb4780a78c2277d617e44da7bc270bc449ff403187f6b587fc
MD5 59b575c612866ae3ecf36dd26a380b26
BLAKE2b-256 f8066fca0c94a0e797038f654b71d7ec3ae1fbce33180afb6c78bc73f1839856

See more details on using hashes here.

File details

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

File metadata

  • Download URL: torchvision-0.9.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 13.2 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for torchvision-0.9.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fa302f6e8fe33a8d5c6649e659655c0427eee662fe22ce69eb56fa402b520c26
MD5 20c41e1d78310c204fe7ae56b3bf97fd
BLAKE2b-256 316f3a24bd6e209c385c1209081a721bff0d9029207433cbc3da8777d722e59e

See more details on using hashes here.

File details

Details for the file torchvision-0.9.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: torchvision-0.9.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 852.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for torchvision-0.9.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 8791da742c24344646a4ac36adee9327491f7fff7607dffe352402b5bf25ea21
MD5 717d00e977bb55ac13b118282b2ec92d
BLAKE2b-256 e09388cbc7e7528b06b393dbcf98ab29390be3801794dfc77881664f1bb0ec80

See more details on using hashes here.

File details

Details for the file torchvision-0.9.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: torchvision-0.9.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for torchvision-0.9.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d90750ae76a0cad8ffb6b509b30412dcd102d27d5f34f7184b289b6687de580e
MD5 0d047632078045b65fed940ee7c8649b
BLAKE2b-256 6f6a4e8d7c897f24a6aa9d5e7c23a157b52084ccd43d1b6019603361d2136dde

See more details on using hashes here.

File details

Details for the file torchvision-0.9.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: torchvision-0.9.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 13.2 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for torchvision-0.9.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 24b505dbcf3cb8da49d4b1447543c1021b699c84fc3701523101b62ee4adf097
MD5 53bf4b7343cbd701d6b570a4b544d6aa
BLAKE2b-256 a3cfcda30a8d8dbcf06ad55688682714ea5d6062a962e77e5bae7a49c76ca855

See more details on using hashes here.

File details

Details for the file torchvision-0.9.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: torchvision-0.9.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 852.7 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for torchvision-0.9.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b9f71f62725776495071b875494af86615f225b1a40902f5df452da5cfde0510
MD5 64b7188f8f8acb95fba1744ad5a20c38
BLAKE2b-256 4bdecf2c383e758a91bfe3ddaaf3e01aa5cd07ac289e7d7b86225da83242c35f

See more details on using hashes here.

File details

Details for the file torchvision-0.9.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: torchvision-0.9.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 17.3 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for torchvision-0.9.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 874714f30822d4c1160071dac004d48ae641bfdccccbb497098c86f6589ec0f1
MD5 681d009b10ca1462f68b6578ed97b5d6
BLAKE2b-256 2a9581029fa471429480ede157955e42d176d506a2fd37188021b69a2926f6fc

See more details on using hashes here.

File details

Details for the file torchvision-0.9.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: torchvision-0.9.0-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 13.2 MB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for torchvision-0.9.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 63052147c776d9f93385410c1d5a791386eb0cb5e1b93c7feac686f8dbe6eb06
MD5 f07c8c777529a67ac41fef020ef1fdb1
BLAKE2b-256 8b96ce45fe7697a460d8a2b2be66d4234d5ac4804e6db10e06797a84dbb98afd

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