face-recognition-using-deep-learning icon indicating copy to clipboard operation
face-recognition-using-deep-learning copied to clipboard

Optimized for real case uses, as Tkinter based projects

Open aweirdwhale opened this issue 4 months ago • 0 comments

The class FaceRecognition is designed for performing face recognition tasks using deep learning techniques. Here's a brief overview of how it works:

  • Initialization: Upon instantiation, it sets up paths for storing embeddings, recognizers, and label encoders. It also loads necessary pre-trained models for face detection and embedding extraction.

  • Dataset Preparation: It provides methods to create a directory for a user and implement a dataset for face recognition. The create_directory method creates a directory for a specific user, while implement_dataset captures images from a camera and saves them in the user's directory.

  • Feature Extraction: The extract method extracts facial embeddings from the dataset using a pre-trained deep learning model. It detects faces in images, extracts facial regions, and computes embeddings.

  • Model Training: The train method trains a support vector machine (SVM) classifier using the extracted facial embeddings. It serializes the trained model and label encoder for later use in recognition.

  • Face Recognition: The recognition method performs real-time face recognition using the trained SVM classifier. It captures frames from a camera, detects faces, extracts embeddings, and classifies them using the trained model. If the confidence score for a prediction is high enough, it returns the recognized name along with the confidence percentage.

Overall, this class encapsulates the entire pipeline for face recognition, including dataset preparation, feature extraction, model training, and real-time recognition.

Optimised to use in UI projects

aweirdwhale avatar Feb 18 '24 11:02 aweirdwhale