Closed TetieWasTaken closed 2 years ago
in the script.js i changed the .then(startVideo) to .then(startVideo()) but the recognition ans stuff isnt showing up for me
check the positions of the elements, like the video and de canvas the append event has to be appending the canvas inside the video element
check the path of script or the spell of it
var video = document.getElementById("video");
Promise.all([ faceapi.nets.tinyFaceDetector.loadFromUri("/models"), faceapi.nets.faceLandmark68Net.loadFromUri("/models"), faceapi.nets.faceRecognitionNet.loadFromUri("/models"), faceapi.nets.faceExpressionNet.loadFromUri("/models") ]).then(startVideo());
console.log(video); video.setAttribute("playsinline", ""); video.setAttribute("autoplay", ""); video.setAttribute("muted", ""); video.style.width = "200px"; video.style.height = "200px";
/ Setting up the constraint / var facingMode = "user"; // Can be 'user' or 'environment' to access back or front camera (NEAT!) var constraints = { audio: false, video: { facingMode: facingMode } };
/ Stream it to video element / const startVideo = () => { navigator.mediaDevices .getUserMedia(constraints) .then(function success(stream) { video.srcObject = stream; }); };
This is my directory: