Skip to content

Commit 5546f6a

Browse files
authored
Fix bugs in the resize_short and simple_transform funciton
The resize_short function used the cv2.resize function in a wrong way. The simple_transform function repeated the code uncorrectly.
1 parent 866fcb0 commit 5546f6a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

python/paddle/v2/image.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def resize_short(im, size):
182182
h_new = size * h / w
183183
else:
184184
w_new = size * w / h
185-
im = cv2.resize(im, (h_new, w_new), interpolation=cv2.INTER_CUBIC)
185+
im = cv2.resize(im, (w_new, h_new), interpolation=cv2.INTER_CUBIC)
186186
return im
187187

188188

@@ -324,7 +324,6 @@ def simple_transform(im,
324324
if np.random.randint(2) == 0:
325325
im = left_right_flip(im, is_color)
326326
else:
327-
im = center_crop(im, crop_size, is_color)
328327
im = center_crop(im, crop_size, is_color=is_color)
329328
if len(im.shape) == 3:
330329
im = to_chw(im)

0 commit comments

Comments
 (0)