MediaPipeUnityPlugin icon indicating copy to clipboard operation
MediaPipeUnityPlugin copied to clipboard

WebGL support

Open zer0012 opened this issue 5 years ago • 11 comments

hello!I want to ask WebGL support possible? Will it be possible to support WebGL in the future?

zer0012 avatar Feb 04 '21 08:02 zer0012

I haven't thought seriously about it yet, so I don't know (at least, JS API exists). If requested, I might try to support it in the future.

homuler avatar Feb 04 '21 08:02 homuler

Okay thank you

zer0012 avatar Feb 04 '21 09:02 zer0012

Hello! I'd also be interested in WebGL support. If I wanted to start looking at it independently, do you have a recommendation of where to start?

JoeProgram avatar Mar 18 '21 22:03 JoeProgram

I guess some code can't be compiled, so first you would need to fix such compile-time errors.

cf. https://github.com/homuler/MediaPipeUnityPlugin/blob/master/C/mediapipe_api/import_model.bzl#L56

homuler avatar Mar 19 '21 01:03 homuler

+1 for WebGL support!

@homuler For WebGL, the Unity C# functions which return type Task will need to be refactored, as System.Threading is not supported in WebGL. Something like an async void which takes a System.Action<T> as a completion callback is how I have gotten around this in the past.

If you're willing to do the plugin work, I'm sure contributors here (including me) would help on the Unity C# side.

I sent you a message regarding WebGL plans in the MediaPipe slack channel, as well.

GreyPoupwn avatar Mar 24 '21 17:03 GreyPoupwn

+1 for WebGL support!

Can't wait for it.

Keerato avatar Jun 16 '21 05:06 Keerato

+1 : )

juhanikarlsson avatar Sep 22 '21 09:09 juhanikarlsson

I've been looking into this for a few days and have confirmed that FaceMesh works on CPU (but it's just hopelessly slow). I'm trying to modify it to use WebGL for inference, but it probably won't be fast enough to be useful (cf. https://github.com/prantoran/mediapipe). The official JS version may be performing well enough, but it appears to be using internal code that we cannot access.

homuler avatar Dec 24 '21 07:12 homuler

any recent progress on this?

bryandickson avatar Jan 31 '24 21:01 bryandickson