Resize instead of crop

I wish, I been trying to get up to speed quickly by following https://learnxinyminutes.com/docs/python3/.

resize_method <= 2

resize_method is either ResizeMethod.SQUISH or ResizeMethod.CROP. How can we compare it with an integer?

Behind the scenes, all the ResizeMethod.something are integers. The comparison is to check if itā€™s CROP or PAD in just a short amount of code.

Just found this now and itā€™s very useful. Thanks!

I donā€™t know if itā€™s solved or not but if you only want resize instead of cropping then pass your image size as a tuple to size parameter.
size=(row,column).
Itā€™ll only resize it instead of cropping.

2 Likes

@sgugger sorry posting in old forumā€¦
Regarding the resizing and cropping i wanted to check upon few thingsā€¦
If i understand correctly fastai does random crop on the resized images ā€¦
But if i want to build crop from the whole images of size i prefer say 256 ,is it possible with default resizing or cropping method provided in fastai lib.
Advantage with this approach is you train on cropped patches on image and still make predictions on full size images.
But currently croping on resized images and predicting on full one results in model break down.