justadudewhohacks / face-api.js

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

Low Performance on Safari on iOS #764

Open lucaTriboli opened 3 years ago

lucaTriboli commented 3 years ago

Hello!

My web page is using the face-api.js api to find the face expressions of human faces on mobile. On android all works fine, the video of the webcam is smooth, on Google Chrome and Firefox. On iOS using Chrome the video is smooth but on Safari is very laggy: it shows 2-3 frames and then stops and then other 2-3 frames and then stops and so on. Since we cannot use Chrome on iOS due to other problems, I wanna know if someone else has encountered the same problem and how did he solve it.

Thank you all for the support.

vladmandic commented 3 years ago

Safari is lacking full support for GL version 2, so if you're using webgl backend, it will be lacking.
Check if wasm backend is an option for you, although I don't know what's the state of SIMD support in Safari.

lucaTriboli commented 3 years ago

I've managed to solve the issue reducing the inputSize from 512x512 to 128x128. Anyway, I will go to inform about it!

Thanks @vladmandic

dlespinosa365 commented 3 years ago

@lucaTriboli I have the same issue, face-api use GPU hardware, so I try to install a graphic card, and work fine. Check the system resource monitor when the app is running.