Skip to content
class

HorizontalFlip

extends_NoParamsGeometricTransform[Empty]
HorizontalFlip(p: float = 0.5)

Flip left-right with probability p (Albumentations HorizontalFlip).

Mirrors the image about its vertical centre-line, mirrors the mask the same way, and reflects bounding-box / keypoint x-coordinates via the canvas width so every target stays aligned.

Parameters

pfloat= 0.5
Probability of applying the flip.

Examples

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

Used by 2

Constructors

1
dunder

__init__

→None
__init__(p: float = 0.5)

Instance methods

1
fn

make_params

→Emptyfrom _NoParams
make_params(img: Tensor)

Dunder methods

1