Skip to content

Commit 06f1625

Browse files
committed
Fix adjust_gamma tests
1 parent 3062d2e commit 06f1625

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 = [round((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)