Open3D-ML icon indicating copy to clipboard operation
Open3D-ML copied to clipboard

Update visualizer.py. Fix import when no GUI

Open ccoulombe opened this issue 1 year ago • 4 comments

Shield import when Open3D was not built with GUI.

ccoulombe avatar Jan 31 '24 15:01 ccoulombe

Hi @ccoulombe if Open3D is not built with GUI, then the whole visualizer.py code will not work. You will just run into an error later. It's better to let the import statement catch the error earlier and give a more understandable error message.

ssheorey avatar Feb 09 '24 23:02 ssheorey

Hi @ccoulombe if Open3D is not built with GUI, then the whole visualizer.py code will not work. You will just run into an error later. It's better to let the import statement catch the error earlier and give a more understandable error message.

If i want to plot bboxes of pointcloud using tensorborad on headless server. How to fix the problem? We need build Open3D with Open3D-ML using "-DENABLE_HEADLESS_RENDERING=ON", no GUI will be enabled. As you say, the Open3D is not built with GUI, then the whole visualizer.py code will not work.

pycoco avatar Mar 13 '24 08:03 pycoco

@ssheorey I understand that the visualizer will not work if Open3D is not built with GUI support, and that's my point here : the import is not conditionnal

This import needs to be shielded and conditionnal to GUI support. In a case where Open3D does not have GUI support, the visualizer makes no sense to import as you have pointed out, hence it should not be imported.

Importing the visualizer no matter the case, make importing open3d fail.

ccoulombe avatar Mar 13 '24 22:03 ccoulombe

Ahhh, you are using Open3D somewhere and it imports visualizer.py, but you don't need that functionality. You are actually not using visualizer.py itself. That makes more sense now. Please add this comment in the code to the check anbd we can merge.

# Allow Open3D import when visualizer is not built or used.

ssheorey avatar Mar 13 '24 23:03 ssheorey