You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, the output vertex mesh can be saved as a .obj file using the following short function:
def save_mesh_as_obj(out_path, vertices, faces):
"""
Saves vertex mesh as obj file.
:param out_path: path to save obj file.
:param vertices: (num vertices, 3) numpy array of 3D vertices
:param faces: (num faces, 3) numpy array, each row contains ordered
indices of vertices belonging to that face.
"""
with open(out_path, 'w') as fp:
for v in vertices:
fp.write('v %f %f %f\n' % (v[0], v[1], v[2]))
if not(faces is None):
for f in faces + 1:
fp.write('f %d %d %d\n' % (f[0], f[1], f[2]))
You may also consider saving the mesh in the .ply file format, since you can additionally save per-vertex variance as a per-vertex property (or "colour" using some colour map), if this is desired. (I guess this is possible with .obj too, but I am not super knowledgeable about this).
Hi! Thanks for your work. How can I save the output prediction of the body on .obj / .fbx formats?
The text was updated successfully, but these errors were encountered: