Skip to content
class

ToSepia

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

Apply the canonical sepia-tone colour matrix (Albumentations ToSepia).

Multiplies the input by the fixed 3x3 sepia matrix used by Microsoft / PIL / Albumentations and clips to [0, 1]. Produces a warm brown-tinted output reminiscent of vintage photographs.

Parameters

pfloat= 0.5
Probability of applying the transform.

Raises

ValueError
If the input image does not have exactly 3 channels.

Examples

>>> import lucid
>>> import lucid.utils.transforms as T
>>> tf = T.ToSepia(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