Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tabletop plane for matplotlib fallback #8

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

acmiyaguchi
Copy link
Contributor

Fixes #7.

This adds in a fallback to matplotlib in case mayavi fails for some reason (ui backend not installed, VTK error, etc). While matplotlib is slow, it should work on pretty much any machine. I hesitate on adding pptk back, mostly because it's has such specific requirements (python 3.7). I tested this on my ubuntu 20.04 wsl2 instance which comes with python 3.8.10, after intalling PyQt5 manually via pip.

$ python3 -m venv venv
$ source venv/bin/activate
$ pip install --upgrade pip
$ pip install -e .[viz]
$ python scripts/test_tabletop_estimator.py
...
ImportError: Could not import backend for traitsui.  Make sure you
        have a suitable UI toolkit like PyQt/PySide or wxPython
        installed.
WARNING: Cannot import mayavi. Falling back to matplotlib (slow).
...

image

$ pip install PyQt5
$ python scripts/test_tabletop_estimator.py

image

We can test the matplotlib backend at anytime by forcing it.

$ python scripts/test_tabletop_estimator.py --force-matplotlib

The test file visualize the extracted tabletop plane point cloud in the camera frame, which is a necessary step for the height estimation.
You can skip that testing file and run `python -m camera.d435.testing.height` directly.

## Ubuntu Python Environment Setup
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got rid of this section because it adds more complexity to the environment than is needed, and is mostly out of date.

@@ -17,6 +17,6 @@
"improcessor @ git+https://github.com/ivapylibs/improcessor.git",
],
extras_require={
"viz": ["mayavi", "wxpython"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wxpython is not great actually, pyqt5 seems to be the superior choice. This is left up to the user to install though,

@acmiyaguchi acmiyaguchi requested a review from pv33 May 19, 2023 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

D435 testing/tabletop_plane GLEW error
1 participant