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

MP Vision Tasks web solutions performance... #5377

Open
Honya2000 opened this issue May 5, 2024 · 2 comments
Open

MP Vision Tasks web solutions performance... #5377

Honya2000 opened this issue May 5, 2024 · 2 comments
Assignees
Labels
platform:javascript MediaPipe Javascript issues task::all All tasks of MediaPipe type:performance Execution Time related type:support General questions

Comments

@Honya2000
Copy link

Honya2000 commented May 5, 2024

Hello,

I recently compiled WASM mediapipe build from the sources publicly available.
It worked fine for ImageSegmentation tasks with CPU SIMD backend. But unfortunately later I realized it cannot be used for GPU inferencing because there are no sources available for GLES30 backend.

So I had to stick to standard task-vision API wasm NPM builds.
But unfortunately standard library is about twice slower than my own compiled wasm module. My own module inferencing time is 4ms, standard library takes 8ms.
I suspect - problem is in multiple sync points between CPU and GPU in standard library with CPU backend. Not sure why standard API implementation always uses texture as an input. During WEB profiling I see it uses glReadPixels within wasm module and it is slow! In my own implementation I never use WebGL if CPU backend is choosed. So why default API uses webgl2 based canvas ?

@Honya2000 Honya2000 added the type:others issues not falling in bug, perfromance, support, build and install or feature label May 5, 2024
@kuaashish kuaashish added platform:javascript MediaPipe Javascript issues type:build/install For Build and Installation issues task::all All tasks of MediaPipe type:support General questions type:performance Execution Time related and removed type:build/install For Build and Installation issues type:others issues not falling in bug, perfromance, support, build and install or feature labels May 6, 2024
@Honya2000
Copy link
Author

Any updates regarding this issues? The situation is even worse. Today i tested the model which takes 5 ms with my own compiled WASM module. But it takes over 22ms with default tasks vision solution. So default wasm is almost 5 times slower!

@Honya2000
Copy link
Author

Profiled in chrome. glReadPixels takes over 10 ms in wasm module... With CPU backend!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:javascript MediaPipe Javascript issues task::all All tasks of MediaPipe type:performance Execution Time related type:support General questions
Projects
None yet
Development

No branches or pull requests

2 participants