A personal project to explore the face_recognition package.
The following versions reflect the environment wherein this program was created.
Python Version: Python 3.8.5
Face-Recognition Version: 1.3.0
OpenCV-Python Version: 4.5.1.48
- Clone the repository to your machine (or download the code).
- Open Terminal and cd into the repository.
- Execute the following command:
python face_rec_driver.py
- You should be presented with the following in your terminal:
- You are now ready to use the application!
- Gather images of the person whose profile you are creating. It is reccomended that you have at least 20 in varying light-levels/environments.
- Create a new folder and name it after the person.
- Copy all photos into the folder.
- Navigate to the project folder and find the folder named
known_faces
. - Place your folder in that directory and run the program.
- Select option one to import a new face.
- Gather the photos you wish to process.
- Navigate to the project folder and find the folder named
unknown_faces
. - Place all of your images in this directory.
- Run the program and select option two.
- When prompted, enter a value of
0.6
forTolerance
. - Next, enter
hog
forModel
. - The program will now detect and match any faces present in the images and present them one-by-one. If there is a match, then a box will be drawn around the face and a label with the person's name will be placed underneath.
NOTE: If the program does not detect any faces in an image, it is most likely because the training data did not have enough pictures. To fix this, remove the facial profile (option three), add more pictures to their directory. Finally, re-create their profile following the steps above and try again.
Please ensure that you install the packages outlined in the requirements.txt
file.