Skip to content

Commit 471a134

Browse files
jdsgomesmalfet
andauthored
Fix functional.adjust_gamma (#5427) (#5434)
Co-authored-by: Nikita Shulga <[email protected]>
1 parent 9cfb0b7 commit 471a134

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchvision/transforms/functional_pil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def adjust_gamma(
119119

120120
input_mode = img.mode
121121
img = img.convert("RGB")
122-
gamma_map = [(255 + 1 - 1e-3) * gain * pow(ele / 255.0, gamma) for ele in range(256)] * 3
122+
gamma_map = [int((255 + 1 - 1e-3) * gain * pow(ele / 255.0, gamma)) for ele in range(256)] * 3
123123
img = img.point(gamma_map) # use PIL's point-function to accelerate this part
124124

125125
img = img.convert(input_mode)

0 commit comments

Comments
 (0)