$(document).ready(function(){
run()
})
async function run(){
await faceapi.loadMtcnnModel('./models');
await faceapi.loadFaceRecognitionModel('./models');
const videoEl=document.getElementById('inputVideo')
navigator.getUserMedia(
{video:{}},
stream=>videoEl.srcObject=stream,
err=>console.err(err)
)
}
async function onPlay(videoEl){
setInterval( async ()=>{console.log('it is running');
const mtcnnForwardParams = {
maxNumScales: 10,
scaleFactor: 0.709,
scoreThresholds: [0.6, 0.7, 0.7],
minFaceSize: 200
}
const canvas=document.getElementById('overlay')
const mtcnnResults=await faceapi.mtcnn(videoEl,mtcnnForwardParams)
canvas.getContext('2d').clearRect(0, 0, canvas.width, canvas.height)
faceapi.drawDetection(canvas, mtcnnResults.map(res => res.faceDetection), { withScore: false })
faceapi.drawLandmarks(canvas, mtcnnResults.map(res => res.faceLandmarks), { lineWidth: 4, color: 'red' })
},1000)
}
this is my javascript code,i got this error,please help to sort out
script2.js:27 Uncaught (in promise) TypeError: faceapi.drawDetection is not a function
at script2.js:27
in faceapi.js also there is no drawDetection( 0,0 ,0 ) with three arguments
faceapi.drawDetections is not part of faceapi anymore, please use the up to date examples.
Most helpful comment
faceapi.drawDetections is not part of faceapi anymore, please use the up to date examples.