Skip to content

Commit fb890eb

Browse files
committed
add hflip
1 parent e49a1ce commit fb890eb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

python/jittor/transform/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ def __call__(self, img:Image.Image):
150150
i = (height - h) // 2
151151
j = (width - w) // 2
152152
return crop_and_resize(img, i, j, h, w, self.size, self.interpolation)
153+
154+
def hflip(img):
155+
return img.transpose(Image.FLIP_LEFT_RIGHT)
153156

154157
class RandomHorizontalFlip:
155158
"""

0 commit comments

Comments
 (0)