Last active
June 25, 2020 06:56
-
-
Save risenW/09f17e2a048a1e5e63766ceb32b76c1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let model; | |
let webcam | |
let webcamElement = document.getElementById("webcam") | |
let capturing = false | |
async function main() { | |
// Load the MediaPipe facemesh model. | |
model = await facemesh.load(); | |
console.log("Model loaded") | |
webcam = await tf.data.webcam(webcamElement); | |
const imgtemp = await webcam.capture(); | |
imgtemp.dispose() | |
document.getElementById("capture").addEventListener("click", function () { | |
capture() | |
}) | |
document.getElementById("stop").addEventListener("click", function () { | |
capturing = false | |
}) | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment