MCPcopy Create free account
hub / github.com/RozDavid/UnScene3D / visualize_instance_image

Function visualize_instance_image

benchmark/util.py:70–78  ·  view source on GitHub ↗
(filename, image)

Source from the content-addressed store, hash-verified

68
69# color by different instances (mod length of color palette)
70def 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

Callers

nothing calls this directly

Calls 1

create_color_paletteFunction · 0.85

Tested by

no test coverage detected