This project is based on face detection and face recognition processes. It is a real time web cam face detection and recognition project which will be used to generate training face images and then detect the known faces. It classifies between known and unknown faces.
- Python 3.5
- OpenCV 3.1.0
- Numpy
This project consist of 3 parts, which are:
- Creating datasets (facedata.py)
- Train the model (facedata.py)
- Recognize faces (facerecognition.py)
#Steps for create dataset and train the model
- Read and show video stream, capture images
- Detect Faces and show bounding box (haarcascade)
- Flatten the largest face image(gray scale) and save in a numpy array
- Repeat the above for multiple people to generate training data
#Steps for recognize faces using KNN algorithm
- load the training data (numpy arrays of all the persons) x- values are stored in the numpy arrays y-values we need to assign for each person
- Read a video stream using opencv
- extract faces out of it
- use knn to find the prediction of face (int)
- map the predicted id to name of the user
- Display the predictions on the screen - bounding box and name