MCPcopy Create free account
hub / github.com/OpenMeshLab/MeshXL / post_process_mesh

Function post_process_mesh

sample_t2m.py:12–23  ·  view source on GitHub ↗
(mesh_coords: Tensor, filename: str)

Source from the content-addressed store, hash-verified

10
11
12def post_process_mesh(mesh_coords: Tensor, filename: str):
13 mesh_coords = mesh_coords[~torch.isnan(mesh_coords[:, 0, 0])] # nvalid_face x 3 x 3
14 vertices = mesh_coords.reshape(-1, 3)
15 vertices_index = np.arange(len(vertices)) # 0, 1, ..., 3 x face
16 triangles = vertices_index.reshape(-1, 3)
17 write_ply(
18 np.asarray(vertices.cpu()),
19 None,
20 np.asarray(triangles),
21 filename
22 )
23 return vertices
24
25
26def make_args_parser():

Callers 1

sample_t2m.pyFile · 0.70

Calls 1

write_plyFunction · 0.90

Tested by

no test coverage detected