skhu101 / SHERF

Code for our ICCV'2023 paper "SHERF: Generalizable Human NeRF from a Single Image"
Other
297 stars 10 forks source link

how to generate a ply file ? #32

Closed mrjchen closed 4 months ago

skhu101 commented 6 months ago

Hi, below is one example.

from plyfile import PlyData, PlyElement pts = tp_input['vertices'][0] x, y, z = pts[:, 0], pts[:, 1], pts[:, 2] pts = list(zip(x, y, z)) vertex = np.array(pts, dtype=[('x', 'f4'), ('y', 'f4'), ('z', 'f4')]) el = PlyElement.describe(vertex, 'vertex') PlyData([el], text='target_vertex').write('target_vertex.ply')

mrjchen commented 6 months ago

Hi, below is one example.

from plyfile import PlyData, PlyElement pts = tp_input['vertices'][0] x, y, z = pts[:, 0], pts[:, 1], pts[:, 2] pts = list(zip(x, y, z)) vertex = np.array(pts, dtype=[('x', 'f4'), ('y', 'f4'), ('z', 'f4')]) el = PlyElement.describe(vertex, 'vertex') PlyData([el], text='target_vertex').write('target_vertex.ply')

Thank you for your response,but I mean that how to use the pre-trained NeRF weights to reconstruct a 3D mesh model with surfaces and textures? Input is a image.

mrjchen commented 6 months ago

Hi, below is one example.

from plyfile import PlyData, PlyElement pts = tp_input['vertices'][0] x, y, z = pts[:, 0], pts[:, 1], pts[:, 2] pts = list(zip(x, y, z)) vertex = np.array(pts, dtype=[('x', 'f4'), ('y', 'f4'), ('z', 'f4')]) el = PlyElement.describe(vertex, 'vertex') PlyData([el], text='target_vertex').write('target_vertex.ply')

gen_sample.py seems to implement this functionality, but it appears to be incomplete.

skhu101 commented 6 months ago

Hi, we did not implement this part. You can refer to marching cude to extract 3D mesh.