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
0cc90808
"git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "bc2642564e532eb4d663ff0c702d90da6ab6bc76"
Unverified
Commit
0cc90808
authored
Nov 10, 2022
by
Vasilis Vryniotis
Committed by
GitHub
Nov 10, 2022
Browse files
Minor perf on saturation uint8 (#6940)
parent
98f1a409
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
torchvision/prototype/transforms/functional/_color.py
torchvision/prototype/transforms/functional/_color.py
+5
-1
No files found.
torchvision/prototype/transforms/functional/_color.py
View file @
0cc90808
...
...
@@ -53,7 +53,11 @@ def adjust_saturation_image_tensor(image: torch.Tensor, saturation_factor: float
if
c
==
1
:
# Match PIL behaviour
return
image
return
_blend
(
image
,
_rgb_to_gray
(
image
),
saturation_factor
)
grayscale_image
=
_rgb_to_gray
(
image
,
cast
=
False
)
if
not
image
.
is_floating_point
():
grayscale_image
=
grayscale_image
.
floor_
()
return
_blend
(
image
,
grayscale_image
,
saturation_factor
)
adjust_saturation_image_pil
=
_FP
.
adjust_saturation
...
...
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