zhengyuf/IMavatar

mesh with color rendering

liushengtong-nreal opened this issue · 5 comments

hello, how can I get a mesh with color rendering(ply or obj)? Thank you

the same question, how to get a mesh with color rendering(ply or obj)? @zhengyuf

Could you perhaps try changing the vertex_color in this line?
You would need to first calculate the RGB color for each vertex.

meshexport = trimesh.Trimesh(verts, faces, normals, vertex_colors=values)

I found a function[ get_rbg_value() ](https://github.com/zhengyuf/IMavatar/blob/fa33cc90f31113416b071cf014d44091554a80d3/code/model/implicit_morphable_model.py#:~:text=output%2C%20sdf_function-,def%20get_rbg_value,-(self%2C) in line 210 of code/model/implicit_morphable_model.py
But the output shape is not matched, i.e. for last frame of MVI_1812, meshoutput needs vertex_colors with (76137,3), but get_rgb_value returns (32536,3).

So Which is the correct implementation for calculating the RGB color for each vertex in this repo? @zhengyuf

Hello,

The returned value that you get from get_rgb_value is probably image-wise. 32536 is the number of pixels in the rendered image where an intersection is found - these are the pixels for which we render color.

You need to pass the vertex locations (canonical) into get_rgb_values in order to get the color for the mesh vertices.

Best,
Yufeng

@liushengtong-nreal did you solve it, how to get a colored 3D model?