Which resize method should i use?

item_tfms, batch_tfms

hello!

i heard there are crop, pad, scretch, randomresizedcrop methods about resize

which method is good??

bears = bears.new(item_tfms=Resize(128))
bears = bears.new(item_tfms=Resize(128, ResizeMethod.Squish))
bears = bears.new(item_tfms=Resize(128, ResizeMethod.Pad, pad_mode=‘zeros’))
bears = bears.new(item_tfms=RandomResizedCrop(128, min_scale=0.01))
bears = bears.new(item_tfms=Resize(128), batch_tfms=aug_transforms(mult=2))

1 Like

Hi,

Really depends on what you want to do with your images.

From the docs (https://docs.fast.ai/vision.augment.html#Resize)

The default for Resize() is to use
method ='crop' , pad_mode ='reflection' , resamples =(2, 0)

Use Resize(128) unless you want to do something else with the image. :slight_smile: