A facial recognition system is a technology capable of matching a human face from a digital image or a video frame against a database of faces. Such a system is typically employed to authenticate users through ID verification services, and works by pinpointing and measuring facial features from a given image.
- Generally Speaking, a facial recognition system can be used to accomplish two kinds of tasks
- Face Verification: One-to-one match that compares a query face image against a template face image whose identity is being claimed.
- Face Identification: One-to-many matches that compare a query face image against all the template images in the database to determine the identity of the query face.
Model Code: https://www.kaggle.com/code/quadeer15sh/face-recognition-siamese-network-triplet-loss Due to github storage restrictions the model cannot be uploaded to the repository. Once the model is trained place them in the models directory.
- Read an image
- Detect face, perform alignment
- Extract face embeddings
- Calculate distance between embeddings present in the database and extracted input face embeddings
- Find the index of the lowest distance, and check if distance is less than threshold
- If yes then use the index to find the person from the database
- Else the person in the input image is not present in the database
- Use the OpenCV utilities to tag the person in the image
facerecog_4.mp4
pip install -r requirements.txt