Closed duncanhall closed 3 months ago
In the second example I had forgotten to change the color space to RGB before processing the frame 🤦
With the correct color space and tweaking of confidence levels I'm able to get the expected results with the HandLandmarker.detect
Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
Yes
OS Platform and Distribution
macOS Ventura 13.2.1
MediaPipe Tasks SDK version
0.10.14
Task name (e.g. Image classification, Gesture recognition etc.)
Hand Landmarker
Programming Language and version (e.g. C++, Python, Java)
Python
Describe the actual behavior
Using HandLandmarker.detect() gives poor results compared to mediapipe.solutions.hands.process()
Describe the expected behaviour
The task detect / detect_async methods should return equal or better results than the old solutions
Standalone code/steps you may have used to try to get what you need
The first example below uses
mediapipe.solutions.hands
to detect multiple hands at once and draw the landmarks on top of the video frame. The results are very good, with multiple hands being recognized and the landmarks applied with constant high accuracyThe 2nd example below uses
HandLandmarker.detect
to get the landmarker results before drawing them. While the drawing method is slightly different in this example, the actual results are very poor. Results fromHandLandmarker.detect
very often detect no hands at all, mostly just showing a flicker of the landmarks before showing no landmarks at all again. I have never seen this method to detect more than 1 hand.Not only would I expect
HandLandmarker.detect
to produce better results, this also makes it very hard to usemp.tasks.vision.RunningMode.LIVE_STREAM
as suggested in the latest docs.Some of this may be due to docs, source code and guides not keeping in sync with each other, but so far I'm unable to get the quality of results seen in the old solutions using the latest methods suggested?