class
RandomScale
extends
GeometricTransform[ScaleParam]RandomScale(scale_limit: float | tuple[float, float] = 0.1, interpolation: int | str | Interpolation = 1, p: float = 0.5)Resize by a random factor, aspect preserved (Albumentations RandomScale).
Samples s uniformly from scale_limit and resizes the image
to (round(H * (1 + s)), round(W * (1 + s))). Image uses the
requested interpolation, masks use nearest, boxes and
keypoints scale exactly.
Parameters
scale_limitfloat or (float, float)= 0.1Scale-delta range; a scalar
v expands to (-v, v) so
the effective scale lies in [1 - v, 1 + v].Image resampling mode (OpenCV codes accepted).
pfloat= 0.5Probability of applying the transform.
Used by 1
Constructors
1Instance methods
1Sample per-call random parameters for RandomScale.
Parameters
imgTensorImage tensor; its spatial size is read to compute the
target
(new_h, new_w) after scaling.Returns
ScaleParamCarries the target new_h and new_w, each at least
1, derived from a single scale factor
1 + uniform(scale_limit) applied to the input height
and width.