-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Reducing Latency for Hand-Tracking Solution in Python #5789
Comments
Hi @MarcKr3, Thank you for reaching out. Below are some answers regarding the support you are looking for:
Based on the code snippet and version you are using, it appears you are utilizing the legacy hand tracking solution. Please The upgraded Task API offers improved performance and is easier to implement for your use case. It also supports GPU
Currently, it is not possible to track only specific landmarks with the Hand Landmarker. However, MediaPipe's model maker
If you wish to switch to C++, we recommend opening a new issue using this template and providing the necessary details and complete error logs. Our team will be happy to assist you in resolving this. Please let us know if you need further assistance. |
Thank You for Your answer! Sorry, I thought I'm running the latest version because I was working with the most recent pip install. The python notebook for landmark detection in images worked, but i was unable to implement the "live stream"-task.
This yields the error:
Could You point towards an implementation of live stream-hand landmark detection? Regarding the Hardware Acceleration: Thanks for the Information about the Model Maker and C++. |
Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
Yes
OS Platform and Distribution
Windows 10 amd64x
MediaPipe Tasks SDK version
Mediapipe Version: 0.10.20
Task name (e.g. Image classification, Gesture recognition etc.)
Hand landmark detection
Programming Language and version (e.g. C++, Python, Java)
Python
Describe the actual behavior
Using the LITE Model (model_complexity=0), I'm measuring Latency of 35-27ms
Describe the expected behaviour
According to "https://ai.google.dev/edge/mediapipe/solutions/vision/hand_landmarker", the FULL Model (model_complexity=1) has a latency of CPU:17ms, GPU:12ms
Standalone code/steps you may have used to try to get what you need
The way I measure latency is as follows:
Other info / Complete Logs
I'm trying to get the Hand Tracking as close to real-time as possible.
I apologize if I'm misinterpreting the "expected" latency values.
I'm considering:
*Hardware acceleration: Unfortunately, I don't have a CUDA GPU. Isn't supported in the Python solution as far as I know anyways.
*Playing with detection & tracking confidence yielded improvements of ~2ms
*Tracking only necessary landmarks: For my task I only need wrist & Fingertip landmarks, however the model tracks all 21 landmarks. Would creating a custom model like this be possible/reduce latency?
*I considered switching to C++, but had problems setting up the MediaPipe Framework. I would get the Hello World to run successfully, but the hand_tracking_cpu example failed to build....
I'll gladly specify further if necessary! Thanks!
The text was updated successfully, but these errors were encountered: