Skip to content

Commit 52e5d2c

Browse files
author
Fangchang Ma
committed
fixed bug with rotation: use nearest neighbor interpolation instead of bilinear
1 parent 978b3b1 commit 52e5d2c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

transforms.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ def __call__(self, img):
304304
img (numpy.ndarray (C x H x W)): Rotated image.
305305
"""
306306

307-
# return itpl.rotate(img, self.angle, reshape=False, prefilter=False)
308-
return itpl.rotate(img, self.angle, reshape=False, prefilter=False)
307+
# order=0 means nearest-neighbor type interpolation
308+
return itpl.rotate(img, self.angle, reshape=False, prefilter=False, order=0)
309+
309310

310311
class Resize(object):
311312
"""Resize the the given ``numpy.ndarray`` to the given size.

0 commit comments

Comments
 (0)