google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
26.97k stars 5.1k forks source link

GPU support in PyPI package on Windows #5385

Open danielkonecny opened 5 months ago

danielkonecny commented 5 months ago

MediaPipe Solution (you are using)

All of them (applied to every MP Solution)

Programming language

Python

Are you willing to contribute it

No

Describe the feature and the current behaviour/state

Currently, the MediaPipe package from PyPI doesn't support GPU acceleration on Windows (via delegate=mp.tasks.BaseOptions.Delegate.GPU in BaseOptions init). The idea is to add option to delegate computation to GPU even on Windows platform without any necessity of using WSL.

Will this change the current API? How?

No response

Who will benefit with this feature?

All Windows users that would like to run any of the MediaPipe's Solutions on GPU. Issue where this feature was referrenced and would benefit from this as well: https://github.com/google/mediapipe/issues/5126.

Please specify the use cases for this feature

Higher performance of MediaPipe's Solutions on Windows - usefull on video in real time, where GPU is necessary to gain the needed fps.

Any Other info

No response

schmidt-sebastian commented 5 months ago

We don't have a GPU layer that works on Windows at the moment. Once that happens, we will publish Python packages on Windows with GPU support.

danielkonecny commented 4 months ago

Thank you for the reply @schmidt-sebastian. Is there any timeline/roadmap on this or is this feature not anticipated in the foreseeable future? Are there any other sources I could follow to see the progress on this (e.g. intermediate GitHub issues or PRs that need to be solved/reviewed before integrating this)?

schmidt-sebastian commented 4 months ago

This is not something we are currently working on, but we can update this issue if our priorities change.

Note that you can run GPU models on Windows via our Web API.

danielkonecny commented 4 months ago

Thank you, updating this issue would be highly appreciated.

What kind of Web API do you mean, please? I can't find it in the docs. If there's some interaction over the internet, won't the latency be even higher than a benefit of using GPU instead of CPU for computation?

schmidt-sebastian commented 4 months ago

See here for an example: https://developers.google.com/mediapipe/solutions/vision/object_detector/web_js

All of our APIs run on-device w/o server interaction.

danielkonecny commented 4 months ago

Oh, I understand, the Javascript implementation. I am not sure whether I can incorporate that easily into the Python project I am working on but I will investigate that. Thank you.