(cmap: str, label: NdarrayOrTensor)
| 208 | image = repeat(image, 3, axis=0) |
| 209 | |
| 210 | def get_label_rgb(cmap: str, label: NdarrayOrTensor) -> NdarrayOrTensor: |
| 211 | _cmap = plt.colormaps.get_cmap(cmap) |
| 212 | label_np, *_ = convert_data_type(label, np.ndarray) |
| 213 | label_rgb_np = _cmap(label_np[0]) |
| 214 | label_rgb_np = np.moveaxis(label_rgb_np, -1, 0)[:3] |
| 215 | label_rgb, *_ = convert_to_dst_type(label_rgb_np, label) |
| 216 | return label_rgb |
| 217 | |
| 218 | label_rgb = get_label_rgb(cmap, label) |
| 219 | if isinstance(alpha, (torch.Tensor, np.ndarray)): |
no test coverage detected
searching dependent graphs…