jeeliz/jeelizWeboji

face detection is slow (especially after detection lost)

lacastorine opened this issue · 5 comments

I'm experiencing an issue with face detection: first attempt is more or less stable, but after detection is lost it can take up to 10-15-20 seconds to detect face again (especially on mobile devices) - blue box hysterically moves over canvas, but can't find face even placed to the canvas center... some times blue box is drawn over face, but without detection success... Blue box movement looks like some random algorithm...

Could you, please, take a look if face detection can be improved (just thoughts, maybe it is also trying to detect not only face but also face expressions, or it shouldn't be random)?

It is really fantastic library, but with, may be, slowest face detection speed.

Thanks in advise.

Hi,

I have optimized face detection params and decreased face detection threshold in the latest commit, I hope it will help.
During the face searching stage, the blue rectangle is looking for the face all around the video, this is normal.
Face detection also depends on image quality and device GPU computing power (the faster it is, the higher the face detection rate is and the better is the tracking). It still requires a quite good mobile device to work properly (at least Iphone6 or equivalent. It is too slow on a 2017 Samsung A5 for example, even if it works it does not provide a good experience. On IphoneX or 11 it should be good :) ).

Thanks for quick reply.
Can confirm that initial detection is faster than before.
But can't say the same for re-detection after face lost. some times it is 2-3-5 seconds, some times it is 5-7-10 seconds with the same light\camera\face position. I'm testing on iphone6s\SE and xiaomi mi9lite - not the best hi-end devices, but still good enough. On the same devices face-api library re-detects faces almost immediately, but don't have adequate solutions for detecting head rotation and no eye blinking at all :(

We had the same issue with the 'Jan 8' version. The one from Apr 15 is REALLY better!
Thanks Xavier!
BTW is there a way to hide the 3D model when detection is false ? Should I create a question for that?

HI @fwt3am
I have updated the neural network model, the new one is more efficient :)

You can call JEELIZFACEEXPRESSIONS.is_detected() to know if the face is detected or not to toggle the visible THREE.js flag and hide or show the object.

Working! Awesome :)