@@ -144,7 +144,7 @@ def scale(img, size, interpolation=Image.BILINEAR):
144
144
Args:
145
145
img (PIL.Image): Image to be scaled.
146
146
size (sequence or int): Desired output size. If size is a sequence like
147
- (w, h ), output size will be matched to this. If size is an int,
147
+ (h, w ), output size will be matched to this. If size is an int,
148
148
smaller edge of the image will be matched to this number.
149
149
i.e, if height > width, then image will be rescaled to
150
150
(size * height / width, size)
@@ -172,7 +172,7 @@ def scale(img, size, interpolation=Image.BILINEAR):
172
172
ow = int (size * w / h )
173
173
return img .resize ((ow , oh ), interpolation )
174
174
else :
175
- return img .resize (size , interpolation )
175
+ return img .resize (size [:: - 1 ] , interpolation )
176
176
177
177
178
178
def pad (img , padding , fill = 0 ):
@@ -355,7 +355,7 @@ class Scale(object):
355
355
356
356
Args:
357
357
size (sequence or int): Desired output size. If size is a sequence like
358
- (w, h ), output size will be matched to this. If size is an int,
358
+ (h, w ), output size will be matched to this. If size is an int,
359
359
smaller edge of the image will be matched to this number.
360
360
i.e, if height > width, then image will be rescaled to
361
361
(size * height / width, size)
0 commit comments