soubhiksanyal / RingNet

Learning to Regress 3D Face Shape and Expression from an Image without 3D Supervision
https://ringnet.is.tue.mpg.de
MIT License
814 stars 170 forks source link

Output mesh render is blank #41

Open hbinol opened 4 years ago

hbinol commented 4 years ago

Hi,

Thank you so much for your great work!

I have an issue. When I run the following command:

python -m demo --img_path ./input_images/000001.jpg --out_folder ./RingNet_output --save_obj_file=True

Output file does not show any mesh result in 2D images like below:

000001

On the other hand, it produces the mesh like below:

image_000013_mesh_not_perfect

opendr version is 0.77.

I would like to ask how can I get the predicted (output of the model) vertex coordinates or landmark coordinates (points) of the original 2D input image?

xing-shuai commented 4 years ago

I got the same issue. my opendr version is still 0.77. I have compared the code between hmr and ringnet, the only difference is ringnet using psbody.mesh which is an old fork of mesh. Anyway, this issue is somehow related to psbody.mesh in my case. when debugging demo.py into function render_model, I always got a "Segmentation fault" error

image

Finally, I use pymesh2 to load and save mesh data instead of using psbody.mesh.

# from psbody.mesh import Mesh
import pymesh

def main(config, template_mesh):
      ...
      if config.save_obj_file:
             # mesh = Mesh(v=vertices[0], f=template_mesh.f)
             # mesh.write_obj(config.out_folder + '/mesh/' + config.img_path.split('/')[-1][:-4] + '.obj')
             mesh = pymesh.form_mesh(vertices[0], template_mesh.faces)
             pymesh.save_mesh(config.out_folder + '/mesh/' + config.img_path.split('/')[-1][:-4] + '.obj', mesh)
      ...

if __name__ == '__main__':
      ...
      template_mesh = pymesh.load_mesh('./flame_model/FLAME_sample.obj')
      renderer = vis_util.SMPLRenderer(faces=template_mesh.faces)
      ...

hope this helps. :smiley: :smiley: :smiley:

image

perfectworld0415 commented 4 years ago

can U send me the pre-trained modle?I can not download it. 877294889@qq.com

perfectworld0415 commented 4 years ago

I got the same issue. my opendr version is still 0.77. I have compared the code between hmr and ringnet, the only difference is ringnet using psbody.mesh which is an old fork of mesh. Anyway, this issue is somehow related to psbody.mesh in my case. when debugging demo.py into function render_model, I always got a "Segmentation fault" error

image

Finally, I use pymesh2 to load and save mesh data instead of using psbody.mesh.

# from psbody.mesh import Mesh
import pymesh

def main(config, template_mesh):
      ...
      if config.save_obj_file:
             # mesh = Mesh(v=vertices[0], f=template_mesh.f)
             # mesh.write_obj(config.out_folder + '/mesh/' + config.img_path.split('/')[-1][:-4] + '.obj')
             mesh = pymesh.form_mesh(vertices[0], template_mesh.faces)
             pymesh.save_mesh(config.out_folder + '/mesh/' + config.img_path.split('/')[-1][:-4] + '.obj', mesh)
      ...

if __name__ == '__main__':
      ...
      template_mesh = pymesh.load_mesh('./flame_model/FLAME_sample.obj')
      renderer = vis_util.SMPLRenderer(faces=template_mesh.faces)
      ...

hope this helps.

image

can U send me the pre-trained model? I can not download it. My email is 877294889@qq.com

xing-shuai commented 4 years ago

can U send me the pre-trained modle?I can not download it. 877294889@qq.com

官网注册是可以下载的呀,已发。

shriyakak commented 3 years ago

this issue is somehow related to psbody.mesh in my case. when debugging demo.py into function render_model, I always got a "Segmentation fault" error

Hey Xing,

I'm also facing the same issue, I tried downloading the Pymesh2 but getting many errors. How did you download it? Did you face any issues while downloading pymesh2? Also, Pymesh2 is not compatible with python 2.7 and Ringnet code is using python 2.7

Python 2.7 Ubuntu 18.04

shriyakak commented 3 years ago

Hi,

Thank you so much for your great work!

I have an issue. When I run the following command:

python -m demo --img_path ./input_images/000001.jpg --out_folder ./RingNet_output --save_obj_file=True

Output file does not show any mesh result in 2D images like below:

000001

On the other hand, it produces the mesh like below:

image_000013_mesh_not_perfect

opendr version is 0.77.

I would like to ask how can I get the predicted (output of the model) vertex coordinates or landmark coordinates (points) of the original 2D input image?

Hey how did you fix the issue?

highway007 commented 3 years ago

this issue is somehow related to psbody.mesh in my case. when debugging demo.py into function render_model, I always got a "Segmentation fault" error

Hey Xing,

I'm also facing the same issue, I tried downloading the Pymesh2 but getting many errors. How did you download it? Did you face any issues while downloading pymesh2? Also, Pymesh2 is not compatible with python 2.7 and Ringnet code is using python 2.7

Python 2.7 Ubuntu 18.04

Here is a py2.7 pymesh release,and work for mehttps://github.com/PyMesh/PyMesh/releases

wbensvage commented 3 years ago

this issue is somehow related to psbody.mesh in my case. when debugging demo.py into function render_model, I always got a "Segmentation fault" error

Hey Xing, I'm also facing the same issue, I tried downloading the Pymesh2 but getting many errors. How did you download it? Did you face any issues while downloading pymesh2? Also, Pymesh2 is not compatible with python 2.7 and Ringnet code is using python 2.7 Python 2.7 Ubuntu 18.04

Here is a py2.7 pymesh release,and work for mehttps://github.com/PyMesh/PyMesh/releases

Hi @highway007 , your reply looks so promising and I do appreciate that. But the link "https://github.com/PyMesh/PyMesh/releases" you provide seems no content anymore. And I also get the problem when installing the pymesh2 with python 2.7. So can I know is there any other way we can overcome this?

bruinxiong commented 3 years ago

I got the same issue. my opendr version is still 0.77. I have compared the code between hmr and ringnet, the only difference is ringnet using psbody.mesh which is an old fork of mesh. Anyway, this issue is somehow related to psbody.mesh in my case. when debugging demo.py into function render_model, I always got a "Segmentation fault" error

image

Finally, I use pymesh2 to load and save mesh data instead of using psbody.mesh.

# from psbody.mesh import Mesh
import pymesh

def main(config, template_mesh):
      ...
      if config.save_obj_file:
             # mesh = Mesh(v=vertices[0], f=template_mesh.f)
             # mesh.write_obj(config.out_folder + '/mesh/' + config.img_path.split('/')[-1][:-4] + '.obj')
             mesh = pymesh.form_mesh(vertices[0], template_mesh.faces)
             pymesh.save_mesh(config.out_folder + '/mesh/' + config.img_path.split('/')[-1][:-4] + '.obj', mesh)
      ...

if __name__ == '__main__':
      ...
      template_mesh = pymesh.load_mesh('./flame_model/FLAME_sample.obj')
      renderer = vis_util.SMPLRenderer(faces=template_mesh.faces)
      ...

hope this helps. 😃 😃 😃

image

Thanks for your suggestion. It works for me! In order to install PyMesh2 successfully, please follow this https://pymesh.readthedocs.io/en/latest/installation.html or https://github.com/PyMesh/PyMesh

bruinxiong commented 3 years ago

After I replace psbody.mesh with pymesh2, I show another visualization result as follow. 000013 Python 3.7.6 TensorFlow-gpu 1.15.2 Ubuntu 18.04