Issue with using detections within a loop for drawing detection results on canvas (flicker) #143
-
The detections work as expected with
If the landmarks and face descriptors are requested as well via |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
you've provided no details on your system, browser and backend - and those heavily matter. but in general, studder is expected since
unfortunately, |
Beta Was this translation helpful? Give feedback.
-
This would be correct if processing took 0ms (loop performance is processing time + timeout time), but since your processing time is likely much larger you can decrease the delay. Just keep it non-zero so main thread has time to update other stuff.
Wasn't aware of it, but yes, its nicely written,
Where does this idea come from?
Yes. Its not total majority, but it does count for more than 50% of processing time. Primary reason is that processing must happen on a much larger sample to detect faces before they can be cropped and send to a second model for analysis.
Yes and much more. For example couple of big improvements would be:
|
Beta Was this translation helpful? Give feedback.
you've provided no details on your system, browser and backend - and those heavily matter.
but in general, studder is expected since
tfjs
model execution is a blocking call.what you can do is have dual loops:
requestAnimationFrame
unfortunately,
faceapi
does not support running in web workers since it heavily relies on dom.if you want, you can try out my far newer library (faceapi internal architecture is quite old) which does support webworkers
https://github.com/vladmandic/human