When training (or specially testing) CNNs, it of course makes a difference if I resize an image to 300px first and then take a 244x244 crop, or if I take the crop out of a 900px image.
I’ve seen the transformation function FiveCrop
that takes one image and returns five crops, one from each corner and one from the centre. Is there an equivalent for resize, where I can get five (or N) different resizes out of one image/tensor?
I know that there is RandomResizedCrop
that I could use and input an image multiple times, but I would like to have something without randomness.
You could apply the torchvision.transforms.functional.resize
method multiple times on the image and return the samples e.g. as a list
. Since each sample would have a different size, you would need to write a custom collate_fn
, as the default one won’t be able to stack
the tensors in the batch dimension.