class
GridElasticDeform
extends
_DisplacementTransformGridElasticDeform(num_grid_xy: tuple[int, int] = (4, 4), magnitude: int = 10, interpolation: int | str | Interpolation = 1, p: float = 0.5)Grid-based elastic deformation (Albumentations GridElasticDeform).
Displaces a coarse num_grid_xy control grid by up to magnitude
pixels and upsamples it to a smooth displacement field.
Parameters
num_grid_xy(int, int)= (4, 4)Control-grid resolution (x, y).
magnitudeint= 10Max control-point displacement in pixels.
No description.
pfloat= 0.5No description.
Used by 1
Constructors
1Instance methods
1Sample per-call random parameters for GridElasticDeform.
Parameters
imgTensorImage tensor; its spatial size sets the displacement
field size and the output canvas.
Returns
DispParamsCarries per-pixel dx / dy fields of shape
(H, W) in pixel units, built by sampling a
(num_grid_xy[1] + 1, num_grid_xy[0] + 1) control grid
with entries uniform in [-magnitude, magnitude] and
bilinearly upsampling to (H, W). out_hw equals
the input (H, W).