This project uses the Face API JS library built on Tensor Flow to enable face recognition for any image. With the use of AI, the system is able to quickly identify the name of every character in an image without much performance overhead.
- Using Face API to detect faces
- Drawing facial detections on a canvas
- Determining face identity using facial recognition
To use this system, simply upload an image to the website and wait for the system to detect and recognize the faces in the image. The system is easily extensible and can recognize any person by simply adding a picture of their face and adding their name to the code.
To get started with this project, follow these steps:
- Install the necessary libraries and dependencies by running
npm install
. You need to run this on a live server otherwise this code won't run in your local device. check the facedetection repo to create a live server from scratch. - Load the required models by running
faceapi.nets.faceRecognitionNet.loadFromUri('/models')
,faceapi.nets.faceLandmark68Net.loadFromUri('/models')
, andfaceapi.nets.ssdMobilenetv1.loadFromUri('/models')
. - Create a container for the image and append it to the
document.body
. - Load the labeled images by running
loadLabeledImages()
. - Create a
FaceMatcher
object using the labeled face descriptors and a matching threshold. - Add an event listener to the image upload button to detect and recognize faces in the uploaded image.
Check out the https://face-detection-epcm18.netlify.app/ to see this face recognition system in action.
This project was made possible with the help of the following resources:
I've also created a real time face detecting system with webcam using face-api. Link to that given below. -[https://github.com/epcm18/FaceDetection]