Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
74f50d93
Unverified
Commit
74f50d93
authored
Aug 17, 2023
by
Nicolas Hug
Committed by
GitHub
Aug 17, 2023
Browse files
Cleanup README.md (#7847)
parent
a7b52a68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
90 deletions
+79
-90
CONTRIBUTING.md
CONTRIBUTING.md
+32
-13
README.md
README.md
+16
-47
docs/source/io.rst
docs/source/io.rst
+31
-30
No files found.
CONTRIBUTING.md
View file @
74f50d93
...
...
@@ -30,30 +30,49 @@ clear and has sufficient instructions to be able to reproduce the issue.
## Development installation
### Install PyTorch Nightly
### Dependencies
Start by installing the
**nightly**
build of PyTorch following the
[
official
instructions
](
https://pytorch.org/get-started/locally/
)
.
**Optionally**
, install
`libpng`
and
`libjpeg-turbo`
if you want to enable
support for
native encoding / decoding of PNG and JPEG formats in
[
torchvision.io
](
https://pytorch.org/vision/stable/io.html#image
)
:
```
bash
conda
install
pytorch
-c
pytorch-nightly
# or with pip (see https://pytorch.org/get-started/locally/)
# pip install numpy
# pip install --pre torch -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html
conda
install
libpng libjpeg-turbo
-c
pytorch
```
### Install Torchvision
Note: you can use the
`TORCHVISION_INCLUDE`
and
`TORCHVISION_LIBRARY`
environment variables to tell the build system where to find those libraries if
they are in specific locations. Take a look at
[
setup.py
](
https://github.com/pytorch/vision/blob/main/setup.py
)
for more
details.
### Clone and install torchvision
```
bash
git clone https://github.com/pytorch/vision.git
cd
vision
python setup.py develop
python setup.py develop
# use install instead of develop if you don't care about development.
# or, for OSX
# MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py develop
# for C++ debugging,
please
use DEBUG=1
# for C++ debugging, use DEBUG=1
# DEBUG=1 python setup.py develop
pip
install
flake8 typing mypy pytest pytest-mock scipy
```
You may also have to install
`libpng-dev`
and
`libjpeg-turbo8-dev`
libraries:
```
bash
conda
install
libpng jpeg
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.
We don't officially support building from source using
`pip`
, but _if_ you do, you'll need to use the
`--no-build-isolation`
flag.
Other development dependencies include:
```
pip install flake8 typing mypy pytest pytest-mock scipy
```
## Development Process
...
...
@@ -192,7 +211,7 @@ Please refer to the guidelines in [Contributing to Torchvision - Models](https:/
### New dataset
More details on how to add a new dataset will be provided later.
Please, do not send any PR with a new dataset without discussing
Please, do not send any PR with a new dataset without discussing
it in an issue as, most likely, it will not be accepted.
### Pull Request
...
...
README.md
View file @
74f50d93
...
...
@@ -8,8 +8,14 @@ vision.
## Installation
We recommend Anaconda as Python package management system. Please refer to
[
pytorch.org
](
https://pytorch.org/
)
for the
detail of PyTorch (
`torch`
) installation. The following is the corresponding
`torchvision`
versions and supported Python
Please refer to the
[
official
instructions
](
https://pytorch.org/get-started/locally/
)
to install the stable
versions of
`torch`
and
`torchvision`
on your system.
To build source, refer to our
[
contributing
page
](
https://github.com/pytorch/vision/blob/main/CONTRIBUTING.md#development-installation
)
.
The following is the corresponding
`torchvision`
versions and supported Python
versions.
|
`torch`
|
`torchvision`
| Python |
...
...
@@ -39,55 +45,18 @@ versions.
</details>
Anaconda:
```
conda install torchvision -c pytorch
```
pip:
```
pip install torchvision
```
## Image Backends
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
](
https://github.com/pytorch/vision/blob/main/CONTRIBUTING.md#development-installation
)
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.
Torchvision currently supports the following image backends:
## Image Backend
-
torch tensors
-
PIL images:
-
[
Pillow
](
https://python-pillow.org/
)
-
[
Pillow-SIMD
](
https://github.com/uploadcare/pillow-simd
)
- a
**much faster**
drop-in replacement for Pillow with SIMD.
Torchvisio
n
c
ur
rently supports the following image backends:
Read more in i
n
o
ur
[
docs
](
https://pytorch.org/vision/stable/transforms.html
)
.
-
[
Pillow
](
https://python-pillow.org/
)
(
default
)
-
[
Pillow-SIMD
](
https://github.com/uploadcare/pillow-simd
)
- a
**much faster**
drop-in replacement for Pillow with SIMD.
If installed will be used as the default.
-
[
accimage
](
https://github.com/pytorch/accimage
)
- if installed can be activated by calling
`torchvision.set_image_backend('accimage')`
-
[
libpng
](
http://www.libpng.org/pub/png/libpng.html
)
- can be installed via conda
`conda install libpng`
or any of the
package managers for debian-based and RHEL-based Linux distributions.
-
[
libjpeg
](
http://ijg.org/
)
- can be installed via conda
`conda install jpeg`
or any of the package managers for
debian-based and RHEL-based Linux distributions.
[
libjpeg-turbo
](
https://libjpeg-turbo.org/
)
can be used as well.
**Notes:**
`libpng`
and
`libjpeg`
are optional dependencies. If any of them is available on the system,
torchvision will provide encoding/decoding image functionalities from
`torchvision.io.image`
.
When building torchvision from source,
`libpng`
and
`libjpeg`
can be found on the standard library locations.
Otherwise, please use
`TORCHVISION_INCLUDE`
and
`TORCHVISION_LIBRARY`
environment variables to set up include and library paths.
## Video Backend
## [UNSTABLE] Video Backend
Torchvision currently supports the following video backends:
...
...
docs/source/io.rst
View file @
74f50d93
Reading/Writ
ing images and videos
=================================
Decoding / Encod
ing images and videos
=================================
====
.. currentmodule:: torchvision.io
The :mod:`torchvision.io` package provides functions for performing IO
operations. They are currently specific to reading and writing video and
images.
operations. They are currently specific to reading and writing images and
videos.
Images
------
.. autosummary::
:toctree: generated/
:template: function.rst
read_image
decode_image
encode_jpeg
decode_jpeg
write_jpeg
encode_png
decode_png
write_png
read_file
write_file
.. autosummary::
:toctree: generated/
:template: class.rst
ImageReadMode
Video
-----
...
...
@@ -20,7 +46,7 @@ Video
Fine-grained video API
----------------------
^^^^^^^^^^^^^^^^^^^^^^
In addition to the :mod:`read_video` function, we provide a high-performance
lower-level API for more fine-grained control compared to the :mod:`read_video` function.
...
...
@@ -61,28 +87,3 @@ Example of inspecting a video:
# the constructor we select a default video stream, but
# in practice, we can set whichever stream we would like
video.set_current_stream("video:0")
Image
-----
.. autosummary::
:toctree: generated/
:template: class.rst
ImageReadMode
.. autosummary::
:toctree: generated/
:template: function.rst
read_image
decode_image
encode_jpeg
decode_jpeg
write_jpeg
encode_png
decode_png
write_png
read_file
write_file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment