@Sylvain in the camvid notebook, when using data_blocks to create an image data bunch (screenshot below from the course’s notebook), what if I want to change the default for the resizing method to be “SQUISH” instead of the default “CROP”?
In the documentation, I can pass it to apply_transforms to apply it on an Image object, like the example, but is there a way to do it while creating the data bunch object?
With the data block API we can rewrite this like that:
data = (ImageFileList.from_folder(planet)
#Where to find the data? -> in planet and its subfolders
.label_from_csv('labels.csv', sep=' ', folder='train', suffix='.jpg')
#How to label? -> use the csv file labels.csv in path,
#add .jpg to the names and take them in the folder train
.random_split_by_pct()
#How to split in train/valid? -> randomly with the default 20% in valid
.datasets()
#How to convert to datasets? -> use ImageMultiDataset
.transform(planet_tfms, size=128)
#Data augmentation? -> use tfms with a size of 128
.databunch())
#Finally? -> use the defaults for conversion to databunch