class
RandomBrightness
extends
PhotometricTransform[ScalarParams]RandomBrightness(limit: float | tuple[float, float] = 0.2, p: float = 0.5)Randomly perturb brightness only (Albumentations RandomBrightness).
Samples an additive brightness offset uniformly from limit,
adds it to the image, and clips to [0, 1]. Equivalent to the
brightness leg of RandomBrightnessContrast — included as
a standalone class for parity with the Albumentations API.
Parameters
limitfloat or (float, float)= 0.2Additive brightness offset range. Scalar
v is interpreted
as the symmetric range (-v, v).pfloat= 0.5Probability of applying the transform.
Examples
>>> import lucid
>>> import lucid.utils.transforms as T
>>> tf = T.RandomBrightness(limit=0.2, p=1.0)
>>> out = tf(T.Image(lucid.rand(3, 32, 32))).data
>>> tuple(out.shape)
(3, 32, 32)