How does one handle creating a databunch when training images are of different size? Is there an automatic resizing functionality?
One would want to resize all images to a fixed dimension, but I’m not able to find any information to do that on-the fly with databunch. Currently I’m doing:
data = (ImageList.from_df(train_df, train_dir) .split_by_rand_pct(0.2) .label_from_df() .transform(get_transforms()) .databunch() .normalize(imagenet_stats))
I’m getting this warning and it shows the sizes of all my images.
It’s not possible to collate samples of your dataset together in a batch
data = ImageDataBunch.from_name_re(path_img, fnames, pat, size=224, bs=bs)
You can pass in a size parameter when creating the Databunch. When using the “full” datablock API (as in your example), the parameter is passed to the transform function: