ChromaticJitter#

class ChromaticJitter(p=0.95, std=0.005)[source]#

Bases: object

Add independent per-point Gaussian noise to RGB channels.

With probability p and when "color" is present, adds zero-mean Gaussian noise with standard deviation std * 255 independently per point and per channel, then clips to [0, 255]; modifies data_dict["color"][:, :3] in place. Registered as ChromaticJitter — use this string as the type in a transform=[...] config list.

Parameters:
  • p (float) – Probability of applying the transform. Defaults to 0.95.

  • std (float) – Noise standard deviation as a fraction of the 255 range. Defaults to 0.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