Skip to content

Internship-Face-Recognition/demo-code

Repository files navigation

demo-code

  • Contains code files for the project Face recognition using Haar-cascade.

Usage (python3)

  1. Create a new folder names: project_face_recog. Copy all files from the repository to the created folder
  2. Open cmd in the folder.
  3. Install dependencies
pip install -r requirements.txt
  1. Test whether opencv can detect camera.
python demo_cam_test.py
  1. Make sure the .xml is present in the directory, check if face detection is working:
python demo_face_detection.py
  1. Start building dataset for training purposes.
  2. Create a dataset folder in the same directory as the script.
  3. To build a dataset for your face for recognition purposes.
python face_dataset.py
  • Inputs: face_id (int).
  • Program will ask for an input.
Enter user id end press <return> ==> 1
  • Can repeat this step for multiple faces, just give a different id (sequential)
  • This will take 30 images of your face and save them in the dataset folder
  • At the end, the datasets folder will be opened, delete bad images.
  1. Create a trainer folder in the same directory as script.
  2. After dataset has been created, train a classifier on your face images.
  • First update line 16
names = ['None'] # add your name corresponding to the id number like, 
# names = ['None', 'Vaibhav', ...]
python face_training.py
  1. After training, for recognition demo, execute:
python face_recognition.py

Main Reference:

Real-Time Face Recognition: An End-To-End Project

About

use this library for refrencing purpose only

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages