microsoft / Deep3DFaceReconstruction

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

Regarding obj textures #186

Open eeshashetty opened 2 years ago

eeshashetty commented 2 years ago

Hi, the code works perfectly well and I'm getting really accurate outputs!

My issue is with the .mat file and the texture file.

  1. How do I use face_color, face_texture, tri, etc on the 3D obj?
  2. The 3D obj renders with the texture on Meshlab but on blender only the mesh. Why is it so?
  3. Is there a way to extract the texture separately as a png file from the obj? Either from meshlab/blender or a python package?

Thanks!

yuripourre commented 2 years ago

@eeshashetty

  1. If I am not mistaken the produced obj uses vertex color instead of a texture. This is not really a .obj standard and it's not supported by mostly obj loaders (and I believe) including blender.
  2. Same as 1
  3. If you know how to code shouldn't be hard to extract a texture from the vertices' colors

Edit: You would have to place each vertex into an image, calculate neighbors and then interpolate the colors.

eeshashetty commented 2 years ago

Thanks for your response!

Yes, the output is vertex colors and not a texture file. And yes that’s where I am facing an issue, because its not a standard obj format.

If someone knows how to convert this into a texture file via a script please share here. I tried googling, but haven't been able to find any good links that lead to a proper solution for this issue yet.

JeongDongBaek commented 1 year ago

@eeshashetty hi, Is the problem solved by any chance? I am facing the same problem. I want to be rendered in Unity finally, but the shader that renders the vertex color doesn't work. Did you find a way?