(segmentation: np.ndarray, cmap: str = 'Set1')
| 42 | |
| 43 | |
| 44 | def 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 | |
| 50 | def colorize_normal(normal: np.ndarray, mask: np.ndarray = None) -> np.ndarray: |
nothing calls this directly
no outgoing calls
no test coverage detected