Skip to content
Datasets, Transforms and Models specific to Computer Vision
Jupyter Notebook Python C++ Cuda Batchfile Shell Other
Branch: master
Clone or download

Latest commit

clemkoa and clement.joudet Make ColorJitter torchscriptable (#2298)
* feat: torchscriptable adjusments

* fix: tensor output type

* feat: ColorJitter torchscriptable

* fix: too many blank lines

* fix: documentation spacing and torchscript annotation

* refactor: list type for _check_input

* refactor: reverting to original syntax

Co-authored-by: clement.joudet <clement.joudet@inventia.life>
Latest commit 883f1fb Jun 10, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Fix binary builds with CUDA 9.2 on Windows (#2273) May 30, 2020
.github/ISSUE_TEMPLATE Update issue templates Feb 24, 2020
cmake Replace pybind11 with cmake's Python3 package (#1850) Feb 14, 2020
docs add missing CelebA in docs (#2107) Apr 15, 2020
examples/cpp/hello_world Add hello world example for C++ torchvision (#2003) Mar 23, 2020
packaging Update link for cudnn 10.2 (#2277) Jun 1, 2020
references torchvision QAT tutorial: update for QAT with DDP (#2280) Jun 3, 2020
test Make ColorJitter torchscriptable (#2298) Jun 10, 2020
torchvision Make ColorJitter torchscriptable (#2298) Jun 10, 2020
travis-scripts/run-clang-format Remove python2 compability code (#2033) Mar 31, 2020
.clang-format Add C++ ops to torchvision (#826) May 7, 2019
.coveragerc [travis] Record code coverage and display on README (#703) Jan 8, 2019
.gitattributes Add expected result tests (#1377) Oct 1, 2019
.gitignore Add static type check with mypy (#2195) May 11, 2020
.travis.yml [ONNX] Fix export of images with no detection (#2215) May 20, 2020
CMakeLists.txt Update version to 0.6.0 in CMake (#2140) Apr 27, 2020
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Feb 28, 2020
LICENSE Create LICENSE Nov 10, 2016
MANIFEST.in make sure license file is included in distributions (#229) Aug 24, 2017
README.rst add compatibility table to README (#2260) May 26, 2020
hubconf.py Add all the latest models to hubconf (#2189) May 11, 2020
mypy.ini Add static type check with mypy (#2195) May 11, 2020
setup.cfg Add static type check with mypy (#2195) May 11, 2020
setup.py Fix missing compilation files for video-reader (#2183) May 5, 2020
tox.ini Fix Unused Variables and flake8 config (#635) Oct 25, 2018

README.rst

torchvision

https://travis-ci.org/pytorch/vision.svg?branch=master 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.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

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')

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.

Documentation

You can find the API documentation on the pytorch website: http://pytorch.org/docs/master/torchvision/

Contributing

We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion. If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us.

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!

You can’t perform that action at this time.