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
588c698d
Unverified
Commit
588c698d
authored
Oct 21, 2021
by
Nicolas Hug
Committed by
GitHub
Oct 21, 2021
Browse files
Open Doc nits in image decoding functions (#4681)
parent
f4b66873
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
torchvision/io/image.py
torchvision/io/image.py
+4
-4
No files found.
torchvision/io/image.py
View file @
588c698d
...
@@ -59,7 +59,7 @@ def write_file(filename: str, data: torch.Tensor) -> None:
...
@@ -59,7 +59,7 @@ def write_file(filename: str, data: torch.Tensor) -> None:
def
decode_png
(
input
:
torch
.
Tensor
,
mode
:
ImageReadMode
=
ImageReadMode
.
UNCHANGED
)
->
torch
.
Tensor
:
def
decode_png
(
input
:
torch
.
Tensor
,
mode
:
ImageReadMode
=
ImageReadMode
.
UNCHANGED
)
->
torch
.
Tensor
:
"""
"""
Decodes a PNG image into a 3 dimensional RGB Tensor.
Decodes a PNG image into a 3 dimensional RGB
or grayscale
Tensor.
Optionally converts the image to the desired format.
Optionally converts the image to the desired format.
The values of the output tensor are uint8 between 0 and 255.
The values of the output tensor are uint8 between 0 and 255.
...
@@ -117,7 +117,7 @@ def decode_jpeg(
...
@@ -117,7 +117,7 @@ def decode_jpeg(
input
:
torch
.
Tensor
,
mode
:
ImageReadMode
=
ImageReadMode
.
UNCHANGED
,
device
:
str
=
"cpu"
input
:
torch
.
Tensor
,
mode
:
ImageReadMode
=
ImageReadMode
.
UNCHANGED
,
device
:
str
=
"cpu"
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
"""
"""
Decodes a JPEG image into a 3 dimensional RGB Tensor.
Decodes a JPEG image into a 3 dimensional RGB
or grayscale
Tensor.
Optionally converts the image to the desired format.
Optionally converts the image to the desired format.
The values of the output tensor are uint8 between 0 and 255.
The values of the output tensor are uint8 between 0 and 255.
...
@@ -185,7 +185,7 @@ def write_jpeg(input: torch.Tensor, filename: str, quality: int = 75):
...
@@ -185,7 +185,7 @@ def write_jpeg(input: torch.Tensor, filename: str, quality: int = 75):
def
decode_image
(
input
:
torch
.
Tensor
,
mode
:
ImageReadMode
=
ImageReadMode
.
UNCHANGED
)
->
torch
.
Tensor
:
def
decode_image
(
input
:
torch
.
Tensor
,
mode
:
ImageReadMode
=
ImageReadMode
.
UNCHANGED
)
->
torch
.
Tensor
:
"""
"""
Detects whether an image is a JPEG or PNG and performs the appropriate
Detects whether an image is a JPEG or PNG and performs the appropriate
operation to decode the image into a 3 dimensional RGB Tensor.
operation to decode the image into a 3 dimensional RGB
or grayscale
Tensor.
Optionally converts the image to the desired format.
Optionally converts the image to the desired format.
The values of the output tensor are uint8 between 0 and 255.
The values of the output tensor are uint8 between 0 and 255.
...
@@ -207,7 +207,7 @@ def decode_image(input: torch.Tensor, mode: ImageReadMode = ImageReadMode.UNCHAN
...
@@ -207,7 +207,7 @@ def decode_image(input: torch.Tensor, mode: ImageReadMode = ImageReadMode.UNCHAN
def
read_image
(
path
:
str
,
mode
:
ImageReadMode
=
ImageReadMode
.
UNCHANGED
)
->
torch
.
Tensor
:
def
read_image
(
path
:
str
,
mode
:
ImageReadMode
=
ImageReadMode
.
UNCHANGED
)
->
torch
.
Tensor
:
"""
"""
Reads a JPEG or PNG image into a 3 dimensional RGB Tensor.
Reads a JPEG or PNG image into a 3 dimensional RGB
or grayscale
Tensor.
Optionally converts the image to the desired format.
Optionally converts the image to the desired format.
The values of the output tensor are uint8 between 0 and 255.
The values of the output tensor are uint8 between 0 and 255.
...
...
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