Skip to content
class

Lambda

extends_NoParamsTransform[Empty]
Lambda(image: Callable[[Tensor], Tensor] | None = None, mask: Callable[[Tensor], Tensor] | None = None, bboxes: Callable[[BoundingBoxes], BoundingBoxes] | None = None, keypoints: Callable[[Keypoints], Keypoints] | None = None, name: str | None = None, p: float = 1.0)

Apply user callables per target type (Albumentations Lambda).

Parameters

imagecallable= None
Tensor -> Tensor applied to image / mask tensors.
maskcallable= None
Tensor -> Tensor applied to image / mask tensors.
bboxescallable= None
Applied to the BoundingBoxes / Keypoints object.
keypointscallable= None
Applied to the BoundingBoxes / Keypoints object.
namestr= None
No description.
pfloat= 1.0
No description.

Examples

>>> import lucid, lucid.utils.transforms as T
>>> tf = T.Lambda(p=1.0)
>>> tuple(tf(T.Image(lucid.rand(3, 32, 32))).data.shape)
(3, 32, 32)

Used by 1

Constructors

1
dunder

__init__

→None
__init__(image: Callable[[Tensor], Tensor] | None = None, mask: Callable[[Tensor], Tensor] | None = None, bboxes: Callable[[BoundingBoxes], BoundingBoxes] | None = None, keypoints: Callable[[Keypoints], Keypoints] | None = None, name: str | None = None, p: float = 1.0)

Instance methods

1
fn

make_params

→Emptyfrom _NoParams
make_params(img: Tensor)

Dunder methods

1