Simple face recognition bundle written on Python3. Uses opencv, numpy packages and sqllite for storing user information.
Fist of all you need to install all required packages, that located in requirements.txt. Then try to run testingFaceRecognition.py to test your webcam and facial recognition algorithm, that was provided by opencv-contrib-python package
In file requirements.txt you will find all names of the packages, that needed for running this project. To install - create new virtualenv first, or if you don't need one, simply run following command in your terminal:
pip3 install -r requirements.txtRun this script to test that your webcam is working and opencv package is up and running. New window will open with the feed from your webcam and if the human face presented in the feed, square will be drawn around it (if face detection algorithm is working).
Run this script to create dataset from capture of your webcam. You will need to insert userId and userName to save information to sqlite database. NOTE: before running this script, remove sample image from dataset_users folder.
Algorithm finds the human face, then saves image to folder for further training.
Run this script to create model, that based on LBPH algorithm. Output is YAML file (trainingUserData.yml) which will be stored in the recognition folder.
After all the steps, you can run this script to test you computed model. New window will be opened with feed from your webcam and if human face or faces are presented in the feed, square (if face detection algorithm is working) will be drawn around them with additional information from sqlite database.
Structure of the table People from sqlite database: FacesDB.db:
| NAME | TYPE |
|---|---|
| ID | INT |
| NAME | TEXT |
| AGE | INT |
| GENDER | TEXT |
| ROLL_NO | TEXT |
(if it's gonna be)
Need to test other algorithms (Eigenfaces, Fisherfaces, Scale Invariant Feature Transform (SIFT), Speed Up Robust Features (SURF)) to test which is better for face recognition.