Correct version of open3d
Upon first installation, it would install open3d v0.10.0.0, but it need the latest version v0.15.2
First error after installation is the following:
import open3d.visualization.gui as gui
After manually installing v0.12.0 as recommended here, I get the following error:
AttributeError: 'open3d.cpu.pybind.visualization.gui.SceneWidget' object has no attribute 'look_at'
which is new in v0.13.0, so I go ahead and install that, and I get the following error:
AttributeError: 'open3d.cpu.pybind.visualization.gui.ListView' object has no attribute 'set_max_visible_items'
and well then I installed v0.15.2, and that finally stopped complaining.
Might be best to add more strict requirements to the setup config.
Though it still doesn't start well, window doesn't render and nothing happens. Does it download models in the background? It should probably have some indication of that before opening a GUI window. Output:
INFO: will store downloaded models in /home/user/.cache/stereodemo/models Trying to connect to an OAK camera... FEngine (64 bits) created at 0x7ff6390 (threading is enabled) FEngine resolved backend: OpenGL
Thanks for the report, I've just added minimal versions to setup.cfg.
About the "nothing happens", are you running it with --oak? It might be failing to detect the device for some reasons? Can you try giving it files with e.g. stereodemo datasets/? Or just stereodemo if you installed the latest pip, that will load some images embedded in the pypi package.
Yep, ran it with --oak as shown in the logs (it seems it can find the camera). Running without arguments (since I installed with pip) still resulted in a blank window (e.g. no rendering, shows whatever was in the framebuffer before). Verified all other requirements were automatically installed to version equal or higher than the requirements listed.
One final, perhaps obvious idea, does it need an nvidia gpu? I'm running this on a laptop with AMD integrated graphics. Can try this on a PC /w nvidia graphics tomorrow as well.
Interesting, an Nvidia GPU should not be required no, besides my Linux with an Nvidia RTX 3090 I actually also tested it on my macbook, which has an AMD GPU. If CUDA can't be used, it should just fallback to CPU inference.
You might want to try open3d example visualization/text3d on the command line to see if the problem is actually with open3d. This should show a window with some text in 3D (it can take a long time to load on the first run).
Yep, that examples seems to work just fine, and started up immediately.
Just to confirm, it does download models at the beginning?
Again, it does say INFO: will store downloaded models in /home/user/.cache/stereodemo/models, but that folder is empty.
So maybe that fails or just takes very long (though I do have a decent internet connection)
EDIT: Network is barely used so I doubt it. Seems to use exactly one full thread (12.5%) and ~468MB of RAM though, and stays there.
Btw trying to run build_release.sh (modified to use bash) fails with No module named build.
I am unfamiliar with python build systems and have not found any relevant results, what do I need to do to install from source to debug this?
The models are downloaded as needed when you select a different algorithm in the UI. When you launch the program the default algorithm with OpenCV BM, which does not need to download anything. So it's normal that the folder stays empty at first.
build_release.sh is to build a wheel for pypi, if you just want to debug the code you can install it locally in edit mode:
pip install -e . while being in the top-level directory. Then I'd recommend something like Visual Studio Code to edit the code and run it in debug mode.
Ok found that the following two lines in visualizer.py make it hang forever:
cv2.namedWindow ("Input image", cv2.WINDOW_KEEPRATIO)
cv2.imshow ("Input image", np.hstack([input.left_image, input.right_image]))
First line hangs, if I comment it, the second line still hangs. Without it I see the Open3D window saying "computing OpenCV BM" but that's hanging, too. Python OpenCV reports a version of 4.5.1 However I also have libopencv installed via apt (4.2.0) will definitely try on a different rig tomorrow
After commenting out all occurences of cv2 windows and imshow's, all methods seem to work fine (and no other cv2 methods are affected). Weird...
Ran into this issue today myself. It seems that OpenCV does not like to be initialized after importing the Open3D gui modules, I suspect some GL context snafu or something like that. Since OpenCV GUI was just being used to display a couple images we now use Open3D for that as well and the issue is gone.
For the records another fragile workaround was to call cv2.namedWindow once before importing the Open3D gui module to make sure OpenCV initialized the GUI stuff early enough.