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

What is the norminal processing speed of mediapipe's hand solution? #3482

Closed
aidengk-iris opened this issue Jul 1, 2022 · 5 comments
Closed
Assignees
Labels
legacy:hands Hand tracking/gestures/etc platform:python MediaPipe Python issues type:support General questions

Comments

@aidengk-iris
Copy link

aidengk-iris commented Jul 1, 2022

System information (Please provide as much relevant information as possible)

  • Have I written custom code : Yes, custom code but only post processing on mediapipe's results. Mediapipe's hand solution is untouched.

  • OS Platform and Distribution:

    Windows 10 Version 10.0.19044 Build 19044 for Intel based desktop.
    Windows 11 Pro Version 10.0.22000 Build 22000 for AMD based laptop

  • MediaPipe version: 0.8.10.1

  • Bazel version: Sorry, not sure how to check it. I pip installed the ready to use python package

  • Solution : Hands, using CPU only.

  • Programming Language and version: Python 3.9.12

Describe the expected behavior:

Dear mediapipe dev team and all,

This is not an issue but a question on the processing speed of hand solution.

I am using the hand solution with model complexity set to 1 in real-time with some processing of the landmarks and annotation on the video.
I timed mediapipe's processing on individual frames (1280x480 pixels) for detection of two hands and plotted 900 of them.

Timing was done on two computers

As you can see, the processing time is on average a little longer than the time between two camera frames (33.3 ms since the camera captures at 30 FPS)

Please note that I timed only mediapipe's processing time, no additional processing. You can see the code used for timing below

Processing time plot on i7 8809G @ 3.1GHz, 16G RAM, Win10

i7_8gen_timing_analysis

Processing time plot on AMD Ryzen 7 6800HS @ 3.2GHz, 16G RAM, Win11 Pro

ryzen6800_timing_analysis

The x-axis is the 900 processed frames.

Explaination of the plots: the spikes are likely re-detection of the palm.

At the beginning, no hand was seen by the camera, therefore the first 200 frames or less took less time to detect (because no palm detected).

After ~200 frames, my hand enters the camera's view, and the processing time increased obviously.
This makes sense as the palm detection and finger detection models are active.

Question: Is the processing time normal? I expect the inference to be faster.
If this is the limit, is there something I could do to speed up the inference?

Thank you much for your insights.
P.S. Mediapipe is a beutiful project. Thanks for making it happen!

Code used to time the processing speed

image

@aidengk-iris aidengk-iris added the type:support General questions label Jul 1, 2022
@sureshdagooglecom sureshdagooglecom added legacy:hands Hand tracking/gestures/etc platform:python MediaPipe Python issues labels Jul 4, 2022
@sureshdagooglecom
Copy link

Hi @aidengk-iris ,
Models do take significant time to load, up to several seconds .
Therefore, 5 to 10 seconds may be expected on some devices.

@sureshdagooglecom sureshdagooglecom added the stat:awaiting response Waiting for user response label Jul 4, 2022
@aidengk-iris
Copy link
Author

Hi @sureshdagooglecom
Thanks for getting back to me. I was thinking of the time it takes for the hand solution to process one video frame, after loading the models.
I should have been more clear that the models are already loaded when I timed the processing time of a frame

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label Jul 4, 2022
@sureshdagooglecom
Copy link

Hi @aidengk-iris ,
Can we close this issue if the issue has resolved.

@sureshdagooglecom sureshdagooglecom added the stat:awaiting response Waiting for user response label Jul 4, 2022
@aidengk-iris
Copy link
Author

@sureshdagooglecom
Yeah I guess ~35ms is the best the hand solution can do at this moment. Let's close the issue.
I still look forward to the community's sharing of the processing time though.
Many thanks.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:hands Hand tracking/gestures/etc platform:python MediaPipe Python issues type:support General questions
Projects
None yet
Development

No branches or pull requests

2 participants