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
59802fa1
Commit
59802fa1
authored
Dec 18, 2018
by
surgan12
Committed by
Francisco Massa
Dec 18, 2018
Browse files
docs added 2 channel Mode (#692)
* docs added * Update transforms.py * Update transforms.py
parent
be6f6c29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
torchvision/transforms/transforms.py
torchvision/transforms/transforms.py
+5
-4
No files found.
torchvision/transforms/transforms.py
View file @
59802fa1
...
@@ -97,10 +97,11 @@ class ToPILImage(object):
...
@@ -97,10 +97,11 @@ class ToPILImage(object):
Args:
Args:
mode (`PIL.Image mode`_): color space and pixel depth of input data (optional).
mode (`PIL.Image mode`_): color space and pixel depth of input data (optional).
If ``mode`` is ``None`` (default) there are some assumptions made about the input data:
If ``mode`` is ``None`` (default) there are some assumptions made about the input data:
1. If the input has 3 channels, the ``mode`` is assumed to be ``RGB``.
- If the input has 4 channels, the ``mode`` is assumed to be ``RGBA``.
2. If the input has 4 channels, the ``mode`` is assumed to be ``RGBA``.
- If the input has 3 channels, the ``mode`` is assumed to be ``RGB``.
3. If the input has 1 channel, the ``mode`` is determined by the data type (i,e,
- If the input has 2 channels, the ``mode`` is assumed to be ``LA``.
``int``, ``float``, ``short``).
- If the input has 1 channel, the ``mode`` is determined by the data type (i.e ``int``, ``float``,
``short``).
.. _PIL.Image mode: https://pillow.readthedocs.io/en/latest/handbook/concepts.html#concept-modes
.. _PIL.Image mode: https://pillow.readthedocs.io/en/latest/handbook/concepts.html#concept-modes
"""
"""
...
...
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