MCPcopy Create free account
hub / github.com/3DAnimals/3DAnimals / visualize_vertices

Function visualize_vertices

evaluation/evaluate.py:112–123  ·  view source on GitHub ↗
(verts, img, cmap="hot")

Source from the content-addressed store, hash-verified

110
111
112def visualize_vertices(verts, img, cmap="hot"):
113 h, w = img.shape[:2]
114 verts = (verts + 1) / 2 * np.array([w, h])
115 verts = np.round(verts).astype("int32")
116 img = 0.5 * img + 0.5 * 255
117 cmap = plt.cm.get_cmap(cmap)
118 for i, v in enumerate(verts):
119 x, y = v
120 x = np.clip(x, 0, w - 1)
121 y = np.clip(y, 0, h - 1)
122 img[y, x] = np.array(cmap(i / len(verts)))[:3] * 255
123 return img.astype("uint8")
124
125
126def arrange(images):

Callers 1

visualizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected