class
RandomResizedCrop
extends
GeometricTransform[CropBox]RandomResizedCrop(height: int, width: int, scale: tuple[float, float] = (0.08, 1.0), ratio: tuple[float, float] = (3.0 / 4.0, 4.0 / 3.0), interpolation: int | str | Interpolation = 1, p: float = 1.0)Crop a random area/aspect region then resize to height x width.
Albumentations RandomResizedCrop.
Used by 2
Constructors
1Instance methods
1Sample per-call random parameters for RandomResizedCrop.
Parameters
imgTensorImage tensor; its spatial size sets the source area and
bounds the sampled crop window.
Returns
CropBoxCrop window (top, left, height, width) whose area
fraction is uniform in scale and whose aspect ratio is
log-uniform in ratio. Falls back to a centred,
ratio-clamped crop after 10 failed area / aspect draws so
the method always returns a valid window.