Convert an RGB image to grayscale while keeping 3 channels (Albumentations ToGray).
Applies the BT.601 luminance weights Y = 0.299 R + 0.587 G + 0.114 B
and broadcasts the scalar luminance back to a 3-channel image so
downstream ops that expect RGB still work. Delegates to
functional.rgb_to_grayscale with keep_channels=True.
Parameters
pfloat= 0.5Probability of applying the transform.
Examples
>>> import lucid
>>> import lucid.utils.transforms as T
>>> tf = T.ToGray(p=1.0)
>>> out = tf(T.Image(lucid.rand(3, 32, 32))).data
>>> tuple(out.shape)
(3, 32, 32)