class
Sequential
extends
_ContainerSequential(transforms: list[TransformLike], p: float = 1.0)Apply all children in order, gated by p (Albumentations Sequential).
The container's p controls whether the whole block runs at
all on a given call — when the gate fails, every child is
skipped and the input passes through unchanged. When the gate
passes, each child is invoked left-to-right with its own
probability gate honoured (unlike OneOf / SomeOf
which bypass the child gate).
Parameters
transformslist of TransformLikeChildren to chain — each receives the previous child's
output.
pfloat= 1.0Block-level probability — when below 1, the chain is a
no-op on
1 - p of calls.Examples
>>> import lucid, lucid.utils.transforms as T
>>> tf = T.Sequential([T.Resize(16, 16), T.HorizontalFlip(p=1.0)])
>>> tuple(tf(T.Image(lucid.rand(3, 32, 32))).data.shape)
(3, 16, 16)
Applies its members in order, and its own p decides whether the
whole run happens — unlike Compose, which always runs and
leaves each member to its own probability.