mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

GPU support in PyPI package on Windows

Open danielkonecny opened this issue 1 year ago • 6 comments

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

danielkonecny avatar May 07 '24 08:05 danielkonecny

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.

schmidt-sebastian avatar May 08 '24 15:05 schmidt-sebastian

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)?

danielkonecny avatar May 09 '24 06:05 danielkonecny

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.

schmidt-sebastian avatar May 09 '24 19:05 schmidt-sebastian

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?

danielkonecny avatar May 10 '24 09:05 danielkonecny

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.

schmidt-sebastian avatar May 10 '24 15:05 schmidt-sebastian

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.

danielkonecny avatar May 13 '24 06:05 danielkonecny