google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://mediapipe.dev
Apache License 2.0
26.78k stars 5.09k forks source link

GPU Delegate support on Windows Python #4575

Open awkyu opened 1 year ago

awkyu commented 1 year ago

MediaPipe Solution (you are using)

hand_landmarker

Programming language

Python

Are you willing to contribute it

None

Describe the feature and the current behaviour/state

Only CPU delegate is available on Windows. I wanted to just get an idea when the GPU delegate would be available through Python?

Will this change the current API? How?

No, it shouldn't

Who will benefit with this feature?

Anyone wanting to use Python for the new Mediapipe Solutions Hand Tracking

Please specify the use cases for this feature

Any hand-tracking using python would just be drastically faster with lower latency!

Any Other info

No response

kuaashish commented 1 year ago

@awkyu,

Could you please let us know the specific Python GPU delegate you are looking for? Thank you

awkyu commented 1 year ago

@kuaashish Hi! I'm working on a Windows 10 machine with an Nvidia Graphics card, so anything compatible with CUDA would probably work fine.

In https://github.com/google/mediapipe/blob/9861b3c8a8232e948d102385f6f8670080ea5391/mediapipe/tasks/python/core/base_options.py#L54

when setting the base options for Mediapipe Hands (hand_landmarker task), I am getting the error from the exception on line 76-77: NotImplementedError( 'GPU Delegate is not yet supported for ' + platform_name )

schmidt-sebastian commented 1 year ago

This is part of our feature backlog, but will likely take a while to complete.

awkyu commented 1 year ago

That's okay! Any idea when this might be implemented (rough estimate) just so I know if I need to work on using the javascript implementation to be able to use the GPU?

schmidt-sebastian commented 1 year ago

For Windows, I would suggest using the JS API.

khayyat71 commented 10 months ago

Is there a way to generate the Mediapipe Python GPU package on Linux? or WSL2?

stephematician commented 8 months ago

Is there a way to generate the Mediapipe Python GPU package on Linux? or WSL2?

On Linux, yes. I've got some notes here: https://gitlab.com/stephematician/linuxgreenscreen/-/blob/first_draft/INSTALL_GPU.md