shlogg · Early preview
Super Kai (Kazuya Ito) @superkai_kazuya

PyTorch RandomResizedCrop Transformation Example

Use PyTorch's `RandomResizedCrop` transformation to randomly crop images. Define functions like `show_images` and `show_images2` to apply transformations with customizable size, scale, ratio, and interpolation.

Buy Me a Coffee☕
*Memos:

My post explains OxfordIIITPet().

RandomResizedCrop() can crop a random part of an image, then resize it to a given size as shown below:
*Memos:

The 1st argument for initialization is size(Required-Type:int or tuple/list(int) or size()):
*Memos:

It's [height, width].
It must be 1 <= x.
A tuple/list must be the 1D with 1 or 2 elements.
A single value(int or tuple/list(int)) means [size, size].


The 2nd argument for initialization is scale(Optional-Type:tuple/list(int or float)):
*Memos:

It's [min, max] so it must min <= max.
It must be 0 <= x.
A tuple/list must b...