vietanhdev / anylabeling

Effortless AI-assisted data labeling with AI support from YOLO, Segment Anything, MobileSAM!!
https://anylabeling.nrl.ai
GNU General Public License v3.0
2.04k stars 222 forks source link

Qt xcb error? #108

Closed GalSang17 closed 1 year ago

GalSang17 commented 1 year ago

(py38) yangyang@ysd:~$ anylabeling QObject::moveToThread: Current thread (0x55efb47d7980) is not the object's thread (0x55efb56c97e0). Cannot move to target thread (0x55efb47d7980)

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/yangyang/miniconda3/envs/py38/lib/python3.8/site-packages/cv2/qt/plugins" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.

my envs: python=3.8 PyQt=5.15.7

vietanhdev commented 1 year ago

@GalSang17 You can try the following commands:

pip uninstall opencv-python
pip uninstall opencv-contrib-python
pip install opencv-python-headless

Source: https://github.com/NVlabs/instant-ngp/discussions/300.

GalSang17 commented 1 year ago

@GalSang17 You can try the following commands:

pip uninstall opencv-python
pip uninstall opencv-contrib-python
pip install opencv-python-headless

Source: NVlabs/instant-ngp#300.

yeah! it worked, just i can open this software, if i try to label anything by load a sam model, an error about cv2 will throw, so, if this software must use cv2, why unistall opencv-python , then can open this software?

Gtk-Message: 16:15:13.798: GtkDialog mapped without a transient parent. This is discouraged. Traceback (most recent call last): File "/home/yangyang/miniconda3/envs/py38/lib/python3.8/site-packages/anylabeling/utils.py", line 15, in run self.func(*self.args, **self.kwargs) File "/home/yangyang/miniconda3/envs/py38/lib/python3.8/site-packages/anylabeling/services/auto_labeling/model_manager.py", line 313, in _load_model from .segment_anything import SegmentAnything File "/home/yangyang/miniconda3/envs/py38/lib/python3.8/site-packages/anylabeling/services/auto_labeling/segment_anything.py", line 5, in import cv2 ModuleNotFoundError: No module named 'cv2'

vietanhdev commented 1 year ago

@GalSang17 OpenCV has 4 packages for python: opencv-python, opencv-contrib-python, opencv-python-headless and opencv-contrib-python-headless. The first two versions may cause some issues on some machines, mostly when used with PyQt.

vietanhdev commented 1 year ago

Install the headless version to use cv2:

pip install opencv-python-headless

Or

opencv-contrib-python-headless
vongocminh778 commented 5 months ago

sudo apt install libxcb-xinerama0 to fixed problem worked for me.

prob1995 commented 1 month ago

sudo apt install libxcb-xinerama0 to fixed problem worked for me.

this works for me! thanks!