Skip to content
class

Flip

extendsGeometricTransform[FlipAxis]
Flip(p: float = 0.5)

Flip around a random axis (Albumentations Flip).

Samples code ∈ {0 (vertical), 1 (horizontal), -1 (both)}.

Parameters

pfloat= 1.0
Probability of applying the transform; otherwise the input passes through unchanged.

Examples

>>> import lucid, lucid.utils.transforms as T
>>> tf = T.Flip(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__(p: float = 0.5)

Instance methods

1
fn

make_params

→FlipAxis
make_params(img: Tensor)

Sample per-call random parameters for Flip.

Parameters

Image tensor; not inspected, carried through for dispatch.

Returns

FlipAxis

Carries code drawn uniformly from {-1, 0, 1} — vertical (0), horizontal (1), or both (-1).

Dunder methods

1