uoguelph-mlrg / theano_alexnet

Theano-based Alexnet
BSD 3-Clause "New" or "Revised" License
229 stars 115 forks source link

Preprocessing with respect to aspect ratio #36

Open hma02 opened 7 years ago

hma02 commented 7 years ago

As mentioned in #19 here. I think we need to do the preprocessing with respect to the aspect ratio of the image like pytorch is doing here. Instead of simply do

img = scipy.misc.imresize(img, target_shape)

as done here.

This will, however, raise a problem when storing the resulting numpy ndarrays into hickle files. The shapes of the numpy ndarrays will be irregular because the images are of different widths and heights.

This issue is opened for implementing this enhancement feature. If the aspect ratio is respected, the training quality is expected to be improved. Any suggestions are welcome.