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

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" #20

Closed
anu120 opened this issue Dec 20, 2024 · 8 comments
Closed

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" #20

anu120 opened this issue Dec 20, 2024 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@anu120
Copy link

anu120 commented Dec 20, 2024

Hello
Thank you very much for such detail work. I wanted to use an already developed angle estimation as a part of my work and this could help me. Your work must reach higher rating (it was a bit hard for me to find it). I will definitely cite your work.
Getting to my question here, I used --multi_person false and --to_meters false because I wanted it to target only the focused human and give the results in angles (degree).

  1. However, the output video showed me that it still detected the human figure in far away from the focused frame and that person's parameters are also in the same csv file. Meaning, it captures multi persons but gives the output on a single file is it?
  2. I was expecting that the angles will be written as degrees just like it shows on the output video but the angles are given in vector form (x,y) which is also fine. However, the unit is still shown as 'm' in the csv file. 500 + m seems off to me. What should I do for this unit conversion matter?
@anu120
Copy link
Author

anu120 commented Dec 20, 2024

forgot to mention : I am using this by installing the package and to detect my own video. So I am using Linux command prompts.

@davidpagnon
Copy link
Owner

Hi @anu120,
Thanks for the appreciation!

First of all, can you tell me which version you are using? I made quite a few changes lately. You can check that by doing pip install sports2d -U. I also plan to make a lot of other improvements

  1. Most pose estimation algorithms detect all persons in the frame in any case, so I would not save any time by showing only one. But sometimes, you do not want 20 output files. At first, I only took the first detected person on each frame, but the first detected person can flicker from one on a frame to another in the next frame. So I made it track every person, and select the one with the highest average likelihood. In other words, the visual output will be unchanged and show all people, but only one person will have their data post-processed and output as a trc file (coordinates) and mot file (angles).
    That being said, I'm definitely adding an item in the to-do list to make the user click on the person of interest:

    [ ] Remove the multiperson parameter and replace with singleperson: False by default, or 'auto' (highest average likelihood), or 'click' to manually select the person.

  2. I think you may be looking at the wrong file, did you check the .mot file instead of the trc one? (by the way, it would not be influenced by the parameter --to_meters being set to True or to False).

@davidpagnon davidpagnon added the help wanted Extra attention is needed label Dec 21, 2024
@anu120
Copy link
Author

anu120 commented Dec 23, 2024

Hello,
Thank you for the prompt response.
version is 0.5.6 sports2d in ./.local/lib/python3.10/site-packages (0.5.6)

  1. I see, I understand. Yes, I think adding an item for manual user input will be useful for many!
  2. I got only a trc file, there are no other files downloaded. I got the output video file and the trc of it. Please tell me how to download .mot files of the analysis? I am using my own video and used following prompt.
    sports2d --video_input /path/to/input/mp4 --result_dir /path/to/output --save_vid true --save_img false --save_pose true --save_angles true --show_realtime_results true --multiperson false --to_meters false

@davidpagnon
Copy link
Owner

Hi, sorry for the delay, I really needed a break but I'm back now!

  1. Alright, I'll try to think of pinging you when I add this feature!

  2. It is strange, I just tried your command (with the demo video) and I got .mot files in my result_dir.
    You should get the processed video, a trc file, and a mot file. Did you get the plots of the coordinates of the plots, closed the window, then the plots of angles, closed the window, and got a message similar to this?

    ---------------------------------------------------------------------
    Processing demo.mp4
    On Thursday 02. January 2025, 14:03:22
    ---------------------------------------------------------------------
     0%|                                                                                          | 0/230 [00:00<?, ?it/s]
    Valid CUDA installation found: using ONNXRuntime backend with GPU.
    Pose tracking set up for BodyWithFeet model in balanced mode.
    Persons are detected every 4 frames and tracked inbetween. Multi-person is not selected.
    Parameters: keypoint_likelihood_threshold=0.3, average_likelihood_threshold=0.5, keypoint_number_threshold=0.3
    
    Processing video stream...
    100%|   ████████████████████████████████████████████████████████████████████████████████| 
    230/230 [00:43<00:00,  5.24it/s]
    Video processing completed.
    Processed video saved to C:\Users\david\demo_Sports2D\demo_Sports2D\demo_Sports2D.mp4.
    
    Post-processing pose:
    - Person 0: Interpolating missing sequences if they are smaller than 10 frames. Large gaps filled with last_value.
    Filtering with Butterworth filter, 4th order, 6 Hz.
    Pose in pixels saved to C:\Users\david\demo_Sports2D\demo_Sports2D\demo_Sports2D_px_person00.trc.
    
    Post-processing angles:
    - Person 0: Interpolating missing sequences if they are smaller than 10 frames. Large gaps filled with last_value.
    Filtering with Butterworth filter, 4th order, 6 Hz.
    Angles saved to C:\Users\david\demo_Sports2D\demo_Sports2D\demo_Sports2D_angles_person00.mot.
    
    Processing demo.mp4 took 79.48 s.
    

@anu120
Copy link
Author

anu120 commented Jan 3, 2025

Happy new year to you! hope you had a good break.

  1. Sure, I am in no hurry for this so can wait for your improvements.

  2. I ran again and below is the log file that I got. I have the processed video and the trc file in the dump, that is all. While processing the windows did not close and reopen I could continuously see the processing video. Below is my log on terminal, do you see anything in here?

/home/walid/.local/lib/python3.10/site-packages/matplotlib/projections/__init__.py:63: UserWarning: Unable to import Axes3D. This may be due to multiple versions of Matplotlib being installed (e.g. as a system package and as a pip package). As a result, the 3D projection is not available.
  warnings.warn("Unable to import Axes3D. This may be due to multiple versions of "
/usr/lib/python3/dist-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.17.3 and <1.25.0 is required for this version of SciPy (detected version 1.26.4
  warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"


---------------------------------------------------------------------
Processing /home/walid/Documents/short.mp4
On Friday 03. January 2025, 13:11:38
---------------------------------------------------------------------
  0%|                                                 | 0/12363 [00:00<?, ?it/s]
No valid CUDA installation found: using OpenVINO backend with CPU.
load /home/walid/.cache/rtmlib/hub/checkpoints/yolox_m_8xb8-300e_humanart-c2c7a14a.onnx with openvino backend
load /home/walid/.cache/rtmlib/hub/checkpoints/rtmpose-m_simcc-body7_pt-body7-halpe26_700e-256x192-4d3e73dd_20230605.onnx with openvino backend

Pose tracking set up for BodyWithFeet model in balanced mode.
Persons are detected every 4 frames and tracked inbetween. Multi-person is not selected.
Parameters: keypoint_likelihood_threshold=0.3, average_likelihood_threshold=0.5, keypoint_number_threshold=0.3

Processing video stream...
100%|█████████████████████████████████████| 12363/12363 [17:08<00:00, 12.03it/s]
Video processing completed.
Processed video saved to /home/walid/Documents/short_Sports2D/short_Sports2D.mp4.

Post-processing pose:
- Person 0: Interpolating missing sequences if they are smaller than 10 frames. Large gaps filled with last_value.
Filtering with Butterworth filter, 4th order, 6 Hz.
Pose in pixels saved to /home/walid/Documents/short_Sports2D/short_Sports2D_px_person00.trc.
QObject::moveToThread: Current thread (0x5b8530e13820) is not the object's thread (0x5b8530de98a0).
Cannot move to target thread (0x5b8530e13820)

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/walid/.local/lib/python3.10/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.

Aborted (core dumped)



@davidpagnon
Copy link
Owner

davidpagnon commented Jan 3, 2025

Hi,

Okay, I see the problem now! Your issue is due to Qt not being correctly installed, so it fails upon opening graphs and crashes there.

As a temporary fix, you can run sports2d with the argument --show_graphs false so that it just skips that stage.

Then, can you try the solution proposed there and tell me if it solves anything? perfanalytics/pose2sim#137 (comment)
pip uninstall opencv-python
conda install opencv -c conda-forge

@anu120
Copy link
Author

anu120 commented Jan 4, 2025

Hi,

I tried both methods, first with --show_graphs false I got the .mot files. Then by uninstalling pip opencv and reinstalling through conda, and running the prompt without setting --show_graphs. With that I could see the graphs one after another, and also the .mot files are available. So by referring to .mot files I can directly extract the pose angles as I initially wanted. Thank you very much for the support!

@davidpagnon
Copy link
Owner

Awesome, I'm glad it finally works!
I'm gonna close this issue then :)

@davidpagnon davidpagnon changed the title regarding the csv download qt.qpa.plugin: Could not load the Qt platform plugin "xcb" Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants