Skip to content

Commit

Permalink
fix bug of image resize in im2rec.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zlmzju committed Jul 14, 2016
1 parent 47d8d89 commit 44daeb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/im2rec.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ def image_encode(item, q_out):
img = img[:, margin:margin + img.shape[0]]
if args.resize:
if img.shape[0] > img.shape[1]:
newsize = (img.shape[0] * args.resize / img.shape[1], args.resize)
newsize = (args.resize, img.shape[0] * args.resize / img.shape[1]
else:
newsize = (args.resize, img.shape[1] * args.resize / img.shape[0])
newsize = (img.shape[1] * args.resize / img.shape[0], args.resize)
img = cv2.resize(img, newsize)
header = mx.recordio.IRHeader(0, item[2], item[0], 0)

Expand Down

0 comments on commit 44daeb4

Please sign in to comment.