felixchenfy / Realtime-Action-Recognition

Apply ML to the skeletons from OpenPose; 9 actions; multiple people. (WARNING: I'm sorry that this is only good for course demo, not for real world applications !!! Those ary very difficult !!!)
MIT License
875 stars 256 forks source link

"... no Qt platform plugin could be initialized." | Running on Linux server #61

Closed chamin96 closed 3 years ago

chamin96 commented 3 years ago

Hello,

I run this on a Linux server which doesn't have a GUI. I managed to install all the dependencies and run the demo example successfully.

But when trying to test on a video file, I get this error.

qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/e15154/.conda/envs/rt-ar/lib/python3.6/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.

Aborted (core dumped)

(I guess the error occurs since the server doesn't have a GUI.) Can someone please help me with this?

Thank you.

chamin96 commented 3 years ago

I figured it out and fixed the problem.

This occurs when the program tries to open a display to show the result. (in my case I only work with the CLI.) Therefore, you have to remove all the lines that tries to output an image or a video.

In src/s5_test.py comment out or remove following lines and it will be fixed.

[323]    img_displayer = lib_images_io.ImageDisplayer()
[370]             img_displayer.display(img_disp, wait_key_ms=1)

Thank you.