microsoft / Deep3DFaceReconstruction

Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set (CVPRW 2019)
MIT License
2.18k stars 443 forks source link

How to get the 3dface like this? #153

Closed JiSuanJiDaWang closed 3 years ago

JiSuanJiDaWang commented 3 years ago

Hi , Could you please tell me how to render the face like this(face with gray) ? Thanks! image

YuDeng commented 3 years ago

Please see #149.

JiSuanJiDaWang commented 3 years ago

Please see #149.

Thanks for your quick reply. I also want to know how to get the point_buf in the BFM_model_front.mat. For each vertex, I can get 6 face indices according to the face_buf, but how can I get the other two indices of faces(from your work, there are 8 face indices for each vertex ) that the vertex lies in ? Can you please give me some information about it ?

YuDeng commented 3 years ago

For some vertex it is true that it only has connection with 6 faces. However, in order to compute the vertex normal efficiently, we manually concatenate some "non-existent" faces to their point_buf to form a N*8 complete matrix. Those non-existent faces only have zero face normals so they will not influence the calculation of vertex normal. Then we can effectively use the broadcasting mechanism in the tensorflow to calculate normal for each vertex.

JiSuanJiDaWang commented 3 years ago

For some vertex it is true that it only has connection with 6 faces. However, in order to compute the vertex normal efficiently, we manually concatenate some "non-existent" faces to their point_buf to form a N*8 complete matrix. Those non-existent faces only have zero face normals so they will not influence the calculation of vertex normal. Then we can effectively use the broadcasting mechanism in the tensorflow to calculate normal for each vertex.

Thank you so much!