Real-time face recognition project with OpenCV and Python
Links for complete Tutorial:
https://www.hackster.io/mjrobot/real-time-face-recognition-an-end-to-end-project-a10826
https://www.instructables.com/id/Real-time-Face-Recognition-an-End-to-end-Project/
- Numpy
- OpenCV
- PIL
- Clone the repository and navigate to the folder OpenCV-Face-Recognition
- The FaceDetection folder contains code to detect face,eye and smile using haarcascades.Simply run the python program to see this in action.
- The FacialRecognition folder contains code for real time face recognition.To train a face recognizer:
- As for first step run the 01_face_dataset.py code. This will ask you to input the user id. Input a unique id for each user. All the captured images will be stored in the dataset folder. All these images will be the data on which you will train.
- Next run 02_face_training.py code. This will take the images of the different users that you stored in the dataset folder and trains on these images using a LBPHFaceRecognizer. The trained model is then saved into trainer folder as trained.yml.
- To do real time face recognition run 03_face_recognition.py code. This will load the trained model in the previous step and using this recognizes faces on live video feed.