class
Compose
extends
_NoParamsTransform[Empty]Compose(transforms: list[TransformLike], bbox_params: BboxParams | None = None)Chain transforms into one callable (works on tensors or samples).
Parameters
transformslist of TransformApplied left-to-right; each transform's output feeds the next.
When given, bounding boxes are filtered after the pipeline by
min_area / min_visibility (degenerate boxes that left the
frame are dropped, along with their labels).Examples
>>> import lucid
>>> from lucid.utils.transforms import (
... Compose, Resize, CenterCrop, Normalize, Image,
... )
>>> tf = Compose([
... Resize(256, 256),
... CenterCrop(224, 224),
... Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225),
... max_pixel_value=1.0),
... ])
>>> tuple(tf(Image(lucid.rand(3, 300, 400))).data.shape)
(3, 224, 224)