Hi! I’m going through intro data to prepare some stuff (currently Jupyter Notebook 02_production), and I noticed that in the From Data to DataLoaders section, line
shows stretched images when using
RandomResizedCrop(128, min_scale=0.3). If I use the default
Resize(128) the validation batch looks cropped, but not deformed.
Things look normal for the train set. Note that the notebook changes the original
dls.train when the new crop method is introduced, so this is probably the intended behaviour, and running the Notebook as is will not produce anything weird.
I just want to confirm that this is expected (and why), and to understand what to actually expect to happen for the validation images during training and inference.
If we look at the documentation for
RandomSizedCrop we can see what’s going on here:
Squish is used on the validation set, removing
val_xtraproportion of each side first.
Resize we have:
On the validation set, the crop is always a center crop (on the dimension that’s cropped).
This difference in behaviour may be unexpected, but it is definitely working as intended.