shreyashampali / HOnnotate

CVPR2020. HOnnotate: A method for 3D Annotation of Hand and Object Poses
https://www.tugraz.at/index.php?id=40231
GNU General Public License v3.0
168 stars 16 forks source link

Possible bug in handPoseMultiframe.py if --showFig is not specified #15

Open petrock99 opened 3 years ago

petrock99 commented 3 years ago

Per the readme it says:

    python handPoseMultiframe.py --seq 'test' --numIter 200 --showFig --doPyRender

Remove --showFig and --doPyRender flags to run faster without visualization.

If I run

python handPoseMultiframe.py --seq 'test' --numIter 200

It gets all the way through and then throws this exception:

'runOptimization'  468.36 ms
[Open3D WARNING] GLFW Error: X11: The DISPLAY environment variable is missing
[Open3D WARNING] Failed to initialize GLFW
Traceback (most recent call last):
  File "handPoseMultiframe.py", line 701, in <module>
    handPoseMF(w, h, objParamInitList, handParamInitList, mesh, camProp, out_dir)
  File "handPoseMultiframe.py", line 431, in handPoseMF
    vis.get_render_option().light_on = False
AttributeError: 'NoneType' object has no attribute 'light_on'

The issue is that its trying to bring up a window even though --showFig is not specified. I'm running this script remotely so I can't bring up any windows. So I didn't supply --showFig or --doPyRender.

It appears that the fix is simply checking if FLAGS.showFig is true before bringing up the visualizer. So something like:

    if FLAGS.showFig:
        vis = o3d.visualization.Visualizer()
        vis.create_window(window_name='Open3D', width=640, height=480, left=0, top=0,
                          visible=True)  # use visible=True to visualize the point cloud
        vis.get_render_option().light_on = False
        vis.add_geometry(finalHandMesh)
        vis.add_geometry(finalObjMesh)
        vis.run()

That appears to fix the problem for me.

python 3.6.12 tensor-flow 1.14.0 CUDA 11.0 HOnnotate git hash d94f6b7