ChromaticJitter#
- class ChromaticJitter(p=0.95, std=0.005)[source]#
Bases:
objectAdd independent per-point Gaussian noise to RGB channels.
With probability
pand when"color"is present, adds zero-mean Gaussian noise with standard deviationstd * 255independently per point and per channel, then clips to[0, 255]; modifiesdata_dict["color"][:, :3]in place. Registered asChromaticJitter— use this string as thetypein atransform=[...]config list.- Parameters:
p (float) – Probability of applying the transform. Defaults to
0.95.std (float) – Noise standard deviation as a fraction of the
255range. Defaults to0.005.
Example
>>> import numpy as np >>> np.random.seed(0) >>> data = {"color": np.array([[100., 100., 100.]], dtype="f4")} >>> ChromaticJitter(p=1.0, std=0.05)(data)["color"].round(2) array([[109.46, 119.8 , 71.08]], dtype=float32) # per-point per-channel Gaussian noise