Skip to content
class

GaussNoise

extendsPhotometricTransform[NoiseParam]
GaussNoise(var_limit: tuple[float, float] = (10.0, 50.0), mean: float = 0.0, p: float = 0.5)

Additive Gaussian noise (Albumentations GaussNoise).

var_limit is on the 0-255 scale (matching Albumentations).

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.GaussNoise(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__(var_limit: tuple[float, float] = (10.0, 50.0), mean: float = 0.0, p: float = 0.5)

Instance methods

1
fn

make_params

→NoiseParam
make_params(img: Tensor)

Sample per-call random parameters for GaussNoise.

Parameters

Image tensor; not inspected, carried through for dispatch.

Returns

NoiseParam

Carries std — the per-pixel Gaussian standard deviation on the unit [0, 1] scale.

Notes

var_limit is on the 0-255 scale (Albumentations convention); the sampled variance is square-rooted and divided by 255 so it can be added directly to the unit-scale image.

Dunder methods

1