This project aims at building a realtime face recognition model.The purpose is to recognize a person/persons in a natural video. The model takes in a camera feed and returns a video stream with a bounding box and a probability for all the class labels. To achieve this functionality I have used:
RealTimeFaceRecognition
|__FaceDetector.py
|__FaceTrainer.py
|__facenet_keras.h5
|__SVM_classifier.sav
|__faces_dataset_embeddings.npz
|__faces_dataset.npz
|__faces_dataset
|__train
|__sai_ram
|__donald_trump
|__narendra_modi
|__virat_kohli
|__val
|__sai_ram
|__donald_trump
|__narendra_modi
|__virat_kohli
The training data consists of 4 classes (4 persons). I have gathered 15 images per class and have compiled the training data set with a total of 60 images. The directories are named after the class labels. Apart from training data I have gathered 5 more images for validation during the training of the model. Initially, I thought of compiling a data set with thousands of images for each class, but in real-world business use cases, it is very difficult to gather such a huge number of pictures for each individual. Hence our model should be good enough, even with bare minimum number of observation for each class.
This python script builds and trains a model on the images in faces_dataset
Training Procedure:
This file uses live web cam feed to detect and recognize the faces
Use Cases:
1. Automatic classroom attendance in educational institutions
Value addition:
More about
MTCNN: https://arxiv.org/abs/1604.02878
Keras facenet pretrained model: https://pypi.org/project/keras-facenet/
Support Vector Machines: https://www.analyticsvidhya.com/blog/2017/09/understaing-support-vector-machine-example-code/