/OpenCV-Face-Recognition

Real-time face recognition project with OpenCV and Python

Primary LanguagePython

OpenCV-Face-Recognition

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/



Dependencies

  • Numpy
  • OpenCV
  • PIL

Usage

  • 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:
  1. 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.
  2. 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.
  3. 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.