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
8bf46d4e
Unverified
Commit
8bf46d4e
authored
Feb 16, 2022
by
Nikita Shulga
Committed by
GitHub
Feb 16, 2022
Browse files
Fix functional.adjust_gamma (#5427)
parent
bc0da3ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torchvision/transforms/functional_pil.py
torchvision/transforms/functional_pil.py
+1
-1
No files found.
torchvision/transforms/functional_pil.py
View file @
8bf46d4e
...
@@ -119,7 +119,7 @@ def adjust_gamma(
...
@@ -119,7 +119,7 @@ def adjust_gamma(
input_mode
=
img
.
mode
input_mode
=
img
.
mode
img
=
img
.
convert
(
"RGB"
)
img
=
img
.
convert
(
"RGB"
)
gamma_map
=
[(
255
+
1
-
1e-3
)
*
gain
*
pow
(
ele
/
255.0
,
gamma
)
for
ele
in
range
(
256
)]
*
3
gamma_map
=
[
int
(
(
255
+
1
-
1e-3
)
*
gain
*
pow
(
ele
/
255.0
,
gamma
)
)
for
ele
in
range
(
256
)]
*
3
img
=
img
.
point
(
gamma_map
)
# use PIL's point-function to accelerate this part
img
=
img
.
point
(
gamma_map
)
# use PIL's point-function to accelerate this part
img
=
img
.
convert
(
input_mode
)
img
=
img
.
convert
(
input_mode
)
...
...
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