justadudewhohacks / face-api.js

JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js
MIT License
16.29k stars 3.64k forks source link

Web Worker on Android / IOS WebView #685

Open rlaurente opened 3 years ago

rlaurente commented 3 years ago

Is there any way to make it work in Web Worker on Android / IOS WebView ? I able to implement it in browser using offscreencanvas and it worked perfectly. When I build the app using capacitor I'm getting undefined offscreencanvas function error. After further research, webview doesn't support offscreencanvas and capacitor doesn't allow changing of default webview.

Thanks

kronozx commented 3 years ago

I'm trying to do the same using WebView Component, but I'm stuck at getting camera permission with WebView (I'm experimenting to use face-api.js within a WebView by setting WebView source prop as my webapp but I can't get permission to use camera). Have you managed to get camera permission from WebView? Thanks in advance.

josiahbryan commented 3 years ago

47 documents successful use of WebViews - however, here's how I do it:

47 documents an overlay canvas for rendering the views too - definitely works great. I get about 12-20fps detection, while the UI thread stays buttery smooth rendering live <video>

libofei2004 commented 1 year ago

@rlaurente Do you solve your problem?