class
RandomSizedCrop
extends
GeometricTransform[CropBox]RandomSizedCrop(min_max_height: tuple[int, int], height: int, width: int, w2h_ratio: float = 1.0, interpolation: int | str | Interpolation = 1, p: float = 1.0)Random-size crop then resize (Albumentations RandomSizedCrop).
Parameters
min_max_height(int, int)Range of crop heights (pixels).
heightintOutput size after resizing.
widthintOutput size after resizing.
w2h_ratiofloat= 1.0Crop width / height ratio.
No description.
pfloat= 1.0No description.
Used by 1
Constructors
1Instance methods
1Sample per-call random parameters for RandomSizedCrop.
Parameters
imgTensorImage tensor; its spatial size bounds both the sampled
crop dimensions (clamped to fit) and the uniformly
sampled
(top, left) corner.Returns
CropBoxCrop window (top, left, height, width). Height is
drawn uniformly from min_max_height; width is
round(height * w2h_ratio); both are clipped to the
input dimensions before the corner is sampled.