Skip to content

Commit

Permalink
Minor fix evaluation formula of PILLOW_VERSION
Browse files Browse the repository at this point in the history
Enable fillcolor option for affine transformation for Pillow >= 5.0.0 as described
  • Loading branch information
shinchu authored May 9, 2019
1 parent ae81313 commit 0043e5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchvision/transforms/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ def affine(img, angle, translate, scale, shear, resample=0, fillcolor=None):
output_size = img.size
center = (img.size[0] * 0.5 + 0.5, img.size[1] * 0.5 + 0.5)
matrix = _get_inverse_affine_matrix(center, angle, translate, scale, shear)
kwargs = {"fillcolor": fillcolor} if PILLOW_VERSION[0] == '5' else {}
kwargs = {"fillcolor": fillcolor} if PILLOW_VERSION[0] >= '5' else {}
return img.transform(output_size, Image.AFFINE, matrix, resample, **kwargs)


Expand Down

0 comments on commit 0043e5f

Please sign in to comment.