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

About face_detector performance issues in android #411

Open
gongqi126854 opened this issue Jun 14, 2024 · 3 comments
Open

About face_detector performance issues in android #411

gongqi126854 opened this issue Jun 14, 2024 · 3 comments

Comments

@gongqi126854
Copy link

I am here
https://ai.google.dev/edge/mediapipe/solutions/vision/face_detector
found this website, The website says that the average latency of the model can be 2.94ms when using the Pixel 6 CPU, which is an exciting number, but when I actually tried the example, I failed to meet my expectations. I know that the CPU of the Pixel 6 is the Google Tensor SoC, which is not easy to compare with existing models, so I checked
https://storage.googleapis.com/mediapipe-assets/MediaPipe%20BlazeFace%20Model%20Card%20(Short%20Range).pdf
This pdf says that the model can reach 275fps on a Pixel 2. I have used many phones with much higher configurations than this phone, but the latency is always high, and the fastest is more than 10ms, which is not right. What do I need to do to reduce the latency?

@PaulTR
Copy link
Collaborator

PaulTR commented Jul 4, 2024

I'll look into where those benchmarks came from. I've generally seen 20-30ms, which is still very fast, but I'm not sure where 10ms comes from.

@gongqi126854
Copy link
Author

Hi, is there any result?

@Mikkelet
Copy link

Mikkelet commented Jul 25, 2024

I updated the the sample project to android 34 with agp=8.3.2, gradle=8.4 and framerate jumped from 30ms to 500, phone is S21

edit: sorry, there were other changes:

  • changed camera to LENS_BACKFACING to use
  • implemented ResolutionSelector with strategy=ResolutionStrategy.HIGHEST_AVAILABLE_STRATEGY
  • removed postScale call from FDHelper

That seemed to slow it down a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants