zhengyuf / IMavatar

Official repository for CVPR 2022 paper: I M Avatar: Implicit Morphable Head Avatars from Videos
MIT License
627 stars 60 forks source link

mesh with color rendering #20

Closed liushengtong-nreal closed 9 months ago

liushengtong-nreal commented 2 years ago

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

yangqing-yq commented 2 years ago

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

zhengyuf commented 2 years ago

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

https://github.com/zhengyuf/IMavatar/blob/fa33cc90f31113416b071cf014d44091554a80d3/code/utils/mesh_util.py#L52

yangqing-yq commented 2 years ago

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

zhengyuf commented 2 years ago

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

RAJA-PARIKSHAT commented 1 year ago

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