(filename, image)
| 68 | |
| 69 | # color by different instances (mod length of color palette) |
| 70 | def visualize_instance_image(filename, image): |
| 71 | height = image.shape[0] |
| 72 | width = image.shape[1] |
| 73 | vis_image = np.zeros([height, width, 3], dtype=np.uint8) |
| 74 | color_palette = create_color_palette() |
| 75 | instances = np.unique(image) |
| 76 | for idx, inst in enumerate(instances): |
| 77 | vis_image[image==inst] = color_palette[inst%len(color_palette)] |
| 78 | imageio.imwrite(filename, vis_image) |
| 79 | |
| 80 | |
| 81 | # color palette for nyu40 labels |
nothing calls this directly
no test coverage detected