class
Crop
extends
_NoParamsGeometricTransform[Empty]Crop(x_min: int = 0, y_min: int = 0, x_max: int = 1024, y_max: int = 1024, p: float = 1.0)Crop a fixed region [x_min, y_min, x_max, y_max) (Albumentations Crop).
Deterministic — every call returns the same rectangle regardless
of input size. Masks, boxes, and keypoints are translated in
lock-step with the image (GeometricTransform contract).
Parameters
x_minint= 0Top-left corner of the crop window (inclusive).
y_minint= 0Top-left corner of the crop window (inclusive).
x_maxint= 1024Bottom-right corner (exclusive).
y_maxint= 1024Bottom-right corner (exclusive).
pfloat= 1.0Probability of applying the crop. Below
1.0, the input
passes through unchanged on 1 - p of calls.Examples
>>> import lucid, lucid.utils.transforms as T
>>> tf = T.Crop(0, 0, 16, 16, p=1.0)
>>> tuple(tf(T.Image(lucid.rand(3, 32, 32))).data.shape)
(3, 16, 16)
The box is (x_min, y_min, x_max, y_max), so this takes the
top-left quarter rather than a 16-pixel margin.