RingNet icon indicating copy to clipboard operation
RingNet copied to clipboard

Output mesh render is blank

Open hbinol opened this issue 4 years ago • 10 comments

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?

hbinol avatar Jul 23 '20 12:07 hbinol

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

xing-shuai avatar Aug 13 '20 02:08 xing-shuai

can U send me the pre-trained modle?I can not download it. [email protected]

perfectworld0415 avatar Aug 14 '20 09:08 perfectworld0415

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 [email protected]

perfectworld0415 avatar Aug 14 '20 09:08 perfectworld0415

can U send me the pre-trained modle?I can not download it. [email protected]

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

xing-shuai avatar Aug 14 '20 12:08 xing-shuai

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 avatar Nov 17 '20 11:11 shriyakak

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?

shriyakak avatar Nov 17 '20 11:11 shriyakak

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

highway007 avatar Dec 29 '20 03:12 highway007

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?

wbensvage avatar Feb 16 '21 22:02 wbensvage

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 avatar May 14 '21 09:05 bruinxiong

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

bruinxiong avatar May 14 '21 09:05 bruinxiong