NormalizeColor#
- class NormalizeColor[source]#
Bases:
objectScale per-point colors from
[0, 255]into[0, 1].Reads and overwrites
data_dict["color"]in place by dividing it by255. A no-op when no"color"key is present. Registered asNormalizeColor— use this string as thetypein atransform=[...]config list.Example
>>> import numpy as np >>> data = {"color": np.array([[0., 128., 255.]], dtype="f4")} >>> NormalizeColor()(data)["color"].round(3) array([[0. , 0.502, 1. ]], dtype=float32) # divided by 255 -> [0, 1]