MCPcopy Index your code
hub / github.com/OpenMeshLab/MeshXL / post_process_mesh

Function post_process_mesh

eval_utils/perplexity.py:20–31  ·  view source on GitHub ↗
(mesh_coords: Tensor, filename: str)

Source from the content-addressed store, hash-verified

18
19
20def post_process_mesh(mesh_coords: Tensor, filename: str):
21 mesh_coords = mesh_coords[~torch.isnan(mesh_coords[:, 0, 0])] # nvalid_face x 3 x 3
22 vertices = mesh_coords.reshape(-1, 3)
23 vertices_index = np.arange(len(vertices)) # 0, 1, ..., 3 x face
24 triangles = vertices_index.reshape(-1, 3)
25 write_ply(
26 np.asarray(vertices.cpu()),
27 None,
28 np.asarray(triangles),
29 filename
30 )
31 return vertices
32
33
34

Callers 1

evaluateFunction · 0.70

Calls 1

write_plyFunction · 0.90

Tested by

no test coverage detected