MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / colorize_segmentation

Function colorize_segmentation

eval_code/recons/models/moge/utils/vis.py:44–47  ·  view source on GitHub ↗
(segmentation: np.ndarray, cmap: str = 'Set1')

Source from the content-addressed store, hash-verified

42
43
44def colorize_segmentation(segmentation: np.ndarray, cmap: str = 'Set1') -> np.ndarray:
45 colored = matplotlib.colormaps[cmap]((segmentation % 20) / 20)[..., :3]
46 colored = np.ascontiguousarray((colored.clip(0, 1) * 255).astype(np.uint8))
47 return colored
48
49
50def colorize_normal(normal: np.ndarray, mask: np.ndarray = None) -> np.ndarray:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected