mlkit icon indicating copy to clipboard operation
mlkit copied to clipboard

Why ML Kit Pose Detection doesn't have GPU Delegate as option ?

Open ArtanBerisha1 opened this issue 4 years ago • 17 comments

I was able to run Pose Detection in my app , but I see that the model is running in CPU , and CPU Load goes to high. I tried FAST and ACCURATE model , also tried different image size as input, but still they don't reduce the CPU Load to much. I was wondering why we don't have a gpu delegate option, or how can I implement it ? because this is a tflite model running on background right ? and tflite models can be delegated in GPU (on Android devices).

Thanks

ArtanBerisha1 avatar Sep 10 '20 08:09 ArtanBerisha1

We don't support GPU acceleration right now, but are working on it. Since the implementation consists of multiple models in a fairly complex pipeline, it is not as simple as enabling the GPU delegate. Also, we want to ensure that we only enable GPU acceleration on the devices that can reliably support it (some that support OpenGL are actually not compatible). Please stay tuned.

chrisito avatar Sep 11 '20 17:09 chrisito

Thank you @chrisito for the reply, I was thinking about this devices that are/aren't compatible with gpu delegate, can you give more details about the devices that are not compatible ? what is the reason they don't work ?

ArtanBerisha1 avatar Sep 11 '20 21:09 ArtanBerisha1

@chrisito it's great that you are working on GPU acceleration. I wonder what the rough time frame would be for the release?

wy16119 avatar Sep 29 '20 06:09 wy16119

is CoreMLDelegate/NNAPI coming for iOS/Android as well? If yes any ETA?

boost-app avatar Oct 28 '20 12:10 boost-app

Hey all,

GPU acceleration is currently on our roadmap and we're hoping to launch this early next year. We are exploring CoreMLDelegate/NNAPI, but currently have no plans we'd like to share. Please stay tuned.

ksulaimon avatar Oct 28 '20 17:10 ksulaimon

Any news?

RCVZ avatar Mar 02 '21 19:03 RCVZ

are there any update on NNAPI ?

yangcheng avatar Apr 08 '21 03:04 yangcheng

Here is a response from another issue about GPU acceleration for Pose: https://github.com/googlesamples/mlkit/issues/253#issuecomment-812637338

"We are planning to enable GPU acceleration, although it is not in our immediate roadmap (likely in Q3)."

Similar case for NNAPI.

ai-plays avatar Apr 08 '21 16:04 ai-plays

@ksulaimon Hi! Is there any news with GPU acceleration for ML pose estimation?

wizecare avatar Oct 21 '21 08:10 wizecare

We are actively working on Pose GPU acceleration now. Not guaranteed, but hopefully get something out in Q1 next year.

ai-plays avatar Oct 21 '21 17:10 ai-plays

Thanks for sharing. Good luck :)

wizecare avatar Oct 22 '21 06:10 wizecare

Hi all,

We just released Pose GPU support V1 on Android.

On Pixel3XL, with CPU the Pose accurate SDK runs at ~23FPS, while with GPU, it runs ~30FPS.

By default, if you update to the latest SDK version(18.0.0-beta2), GPU will be enabled automatically when appropriate. More details can be found here: https://developers.google.com/ml-kit/vision/pose-detection/android#hardware_config

Feel free to give it a try. Any feedback about API, functionality, performance are welcomed.

ai-plays avatar Mar 01 '22 20:03 ai-plays

@steven-chengji-yan Till when can we expect GPU support for Pose Detection?

WCRohit avatar Apr 26 '22 15:04 WCRohit

Hi WCRohit, pose detection 18.0.0-beta2 uses GPU on applicable devices. (See my comment above for details).

Please give it a try. Looking forward to your feedback.

ai-plays avatar Apr 26 '22 20:04 ai-plays

@steven-chengji-yan Sorry for the confusion, I was asking for GPU support for PoseDetection on iOS.

WCRohit avatar Apr 27 '22 03:04 WCRohit

We already did some prototyping for iOS Pose GPU but don't have a concrete timeline for landing it at the moment.

The reason why we focus on Android first is because there are more lower or mid-end devices in the Android eco-system, which we believe could benefit more from hardware acceleration, while on iOS, the devices are relatively higher-end and already get decent performance numbers with CPU.

Could you tell us a bit more about your needs for iOS? What is your use case? What FPS are you looking for? What is the current FPS you can get?

ai-plays avatar Apr 27 '22 06:04 ai-plays

@steven-chengji-yan Thanks for the quick reply. The use case on our end is Pose Detection of Video Captured along with screen sharing during Video Call. Normally without ScreenSharing we are getting 25 FPS but when we start screen sharing the CMSampleBuffer starts dropping and get reduced to around 16 FPS. As ScreenSharing , Video Capture and PoseDetection all uses CPU that is why the drop starts.

That is why thought if Pose Detection can be handled in GPU, It will reduce the drops. Thanks

WCRohit avatar Apr 27 '22 06:04 WCRohit

Closing this issue as the title is about Pose GPU support in general and Android support has been added.

For iOS-specific Pose GPU support, we can follow up in https://github.com/googlesamples/mlkit/issues/186

ai-plays avatar Aug 30 '22 18:08 ai-plays

Can I understand that as of now, only Pose Detection is supported with GPU acceleration?

smithlai avatar Jan 10 '23 05:01 smithlai