The Following project does Face detection, creating a dataset and training a model and finally doing Face Identification and Recognition. The project is created using Python 3.7 and OpenCV 4.1.2.
- Install the Python 3.7 and OpenCV 4.1.2 for the windows OS or mac OS whereever you want to run this project.
- Do the following PIP installs
- pip install opencv-python
- pip install opencv-contrib-python
- pip install pillow
- pip install numpy
There is two python files. The purpose of these files are mentioned below:-
- FaceTraining.py - This code basically does the face detection and whenever you click key "k", it will capture a picture of your face in the gray format and store it in the dataset folder. Take as many as 5 to 6 pictures by pressing the key "k" 5 to 6 times. Once the picture is taken press "ESC" key to exit, while exit it will create a trainingData.yml file which is basically a trainined model of the faces that have been captured. Presently it is assumed that we are training the face for a person named Alex.
You can execute the code as "python FaceTraining.py"
2 FaceRecognition.py - This code uses the trainingData.yml file does the recognition of the present face that is detected using camera and if the match happens it mentions the Name and also tells the confidence level. So if you want to take a screen shot of the camera which is showing the detection and identification of the Alex, you can press the key "k" and the picture will be saved in the capture folder. Press "ESC" key to exit the program.
You can execute the code as "python FaceRecognition.py"
- EM.py - This is a sample code which does the Extension Mobility Login of an user using Face Recognition. So once the Face of ALex is recognizied, this code will do the Cisco Extension Mobility Login for the user. The APIs for Cisco Extension Mobility are mentioned in the developer.cisco.com.
If you see any packages are missing while executing the code, please add it as part of PIP install.