utkuozbulak / pytorch-cnn-visualizations

Pytorch implementation of convolutional neural network visualization techniques
MIT License
7.81k stars 1.49k forks source link

Updated resizing functions. #74

Closed hamzag95 closed 4 years ago

hamzag95 commented 4 years ago

Resized original image, and added new code for resizing prep image. I was trying to use other images from the ImageNet train set, and was getting errors regarding size. These two lines seemed to resolve them.

It looks like previously the resizing was being done and preserving the aspect ratio. So W or H would be 224 but the other spatial dimension would be smaller.

utkuozbulak commented 4 years ago

Hey,

Thanks for the PR but there is no reason to resize twice, preprocess_image() already has the optional argument resize_im=True, so it will enter line 157 anyway. Can you remove line 233 and line 156 in the updated code?

utkuozbulak commented 4 years ago

Resolved with 8ff81bf47b897cb714839245301c207c1d13c24c.