Skip to content

Commit

Permalink
Fix rescaling bug
Browse files Browse the repository at this point in the history
  • Loading branch information
auroracramer committed Nov 8, 2017
1 parent 2908f07 commit a2aaf0b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions l3embedding/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import pickle
import random
import math

import keras
from keras.optimizers import Adam
Expand Down Expand Up @@ -102,8 +103,8 @@ def l3_frame_scaling(frame_data):
nx, ny, nc = frame_data.shape
scaling = 256.0 / min(nx, ny)

new_nx, new_ny = int(scaling * nx), int(scaling * ny)
assert 256 in (new_nx, new_ny)
new_nx, new_ny = math.ceil(scaling * nx), math.ceil(scaling * ny)
assert 256 in (new_nx, new_ny), str((new_nx, new_ny))


resized_frame_data = scipy.misc.imresize(frame_data, (new_nx, new_ny, nc))
Expand Down

0 comments on commit a2aaf0b

Please sign in to comment.