Open khansikki opened 4 years ago
Is there any solution for this ?
display button part is easy, instead of creating we can pre-create before interval and display is using if condition like this
let video = $(this)[0]; const canvas = faceapi.createCanvasFromMedia(video) const displaySize = {width:video.videoWidth,height:video.videoHeight} faceapi.matchDimensions(canvas,displaySize) $(canvas).appendTo("#camera .row:first-child") let detections; let loop = setInterval(async()=>{ detections = await faceapi.detectAllFaces(video,new faceapi.TinyFaceDetectorOptions()).withFaceLandmarks() const resizedDetections = faceapi.resizeResults(detections,displaySize) canvas.getContext('2d').drawImage(video,0,0) //faceapi.draw.drawDetections(canvas,resizedDetections) faceapi.draw.drawFaceLandmarks(canvas,resizedDetections) if(detections.length>0){ $("#capt").show(); console.log("face detected") }else{ $("#capt").hide(); } },108)
but don't know how to identify fake face, can we detect eye blink with facelandmark 68 model ? if so we can win over the 2d face faking
found this article is it possible to implement in face-api.js https://medium.com/swlh/anti-spoofing-mechanisms-in-face-recognition-based-on-dnn-586011ccc416
awesome work !!!
but how to do some stuff only on detections, as it was defined on setInterval, like showing capture button etc., may cause loop effect and
how to check the realness of video ? is it possible to do eye blink detection and mobile screen detection
please assist :)