Build Real Time Face Detection With JavaScript




In this video we will be setting up real time face detection through a webcam using AI. This AI is so quick that we are able to draw in real time the various faces and expressions of every person in the video without much performance overhead. We will be using the Face API JS library built on Tensor Flow to setup the face detection.

By the end of this video you will have fully functional real time face detection on your site which can be used with any webcam or phone camera. If you want to see a part two of this video make sure to let me know in the comments below.

🚨 IMPORTANT:

Part 2 (Face Recognition) Tutorial: https://youtu.be/AZ4PdALMqx0

📚 Materials/References:

GitHub Code: https://github.com/WebDevSimplified/Face-Detection-JavaScript
Face API Library: https://github.com/justadudewhohacks/face-api.js
Models Used: https://github.com/WebDevSimplified/Face-Detection-JavaScript/tree/master/models

🧠 Concepts Covered:

– Streaming a webcam through HTML
– Using Face API to detect faces in real time
– Drawing facial landmarks in real time
– Determining emotion through facial expressions in real time

🌎 Find Me Here:

Twitter: https://twitter.com/DevSimplified
GitHub: https://github.com/WebDevSimplified
CodePen: https://codepen.io/WebDevSimplified

#AI #FaceDetection #JavaScript

Original source


29 responses to “Build Real Time Face Detection With JavaScript”

  1. A common issue many people are running into is a 404 error when loading the models folder. This is caused when you are not running your code inside a server that loads the models folder. For example just right clicking the file and opening in Chrome will not work. I use Live Server with VSCode to run the code and that works for me.

  2. for eavery one who has the 404 error, or the webcam dont load or etc… open the script.js file and add to the example: "faceapi.nets.tinyFaceDetector.loadFromUri('/models')," a dot (.) before the dash (/) = ('./models') like this do this for al the face api links and it wil work. hope it helps

  3. In addition to all of the other comments, this isn't AI… It's an API which exposes a machine learning model that takes the data and provides output. It's amazing how many people can't differentiate between AI, ML, and Deep Learning… Thumbs down.

Leave a Reply