running a function if face detected
canvasandcode opened this issue · 4 comments
canvasandcode commented
Hi, how can I run a function if a face is detected/ not detected? I can't seem to find any existing functions in the source file controlling the detection. Is there anything I should be targeting?
xavierjs commented
You have to check detectState.detected
value and compare it to a threshold (typically if <0.5 it is not a face, otherwise it is a face).
canvasandcode commented
I get a 'detectState is not defined', I've even searched all files from the demo/source file for 'detect' / 'detectState' but it finds nothing
xavierjs commented
Look at the doc: https://github.com/jeeliz/jeelizWeboji/blob/master/doc/jeefacetransferAPI.pdf
function on_detect
xavierjs commented
I close the issue since I think a proper answer was given. Feel free to re-open it if it does not work.