Simple implementation of live face recognition using OpenCV Python implementing LBPH algorithm for recognizing faces and HaarCascade pretrained model to detect faces.
Use the package manager pip to install the needed library. If you haven't installed pip, go check their website
Install numpy
pip install numpy
Install OpenCV
pip install opencv-contrib-python
Install Pillow
pip install pillow
There are 3 python file in this repository
- register-face.py
- train.py
- scan.py
To use this application :
- run the
register-face.py
to record faces that you want to recognize - the recorded face data will be saved under the data directory
- after recording faces, run the
training.py
to train the recognizer and the output will be a file namedtraining.xml
- run the
scan.py
to implement thetraining.xml
and enjoy a simple live face recognition on your PC
I know my codes are messy and ineffective, so I am always happy to accept your pull request to fix my messy code.
Please make sure to update tests as appropriate.