Skip to content
class

InvertImg

extends_NoParamsPhotometricTransform[Empty]
InvertImg(p: float = 0.5)

Invert pixel intensities via 1 - img (Albumentations InvertImg).

Photographic negative — every channel of every pixel is replaced by 1 - x. No parameters and no sampling; deterministic when triggered. Often used as a building block for AutoAugment / RandAugment policies.

Parameters

pfloat= 0.5
Probability of applying the transform.

Examples

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

Used by 1

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