Live Facial Recognition in python using dlibs pre-trained model. Some code adapted from face_recognition library.
Use of face_recognition library, edited to train on any number of images that you put inside the /Faces/ Folder.
Make sure you have:
- os
- numpy
- dlib (some tutorials on how to get it online, look it up)
- face_recognition (get it here: https://github.com/ageitgey/face_recognition)
- opencv
most of these come with anaconda, except opencv, dlib.
-
clone this repo to a folder using:
git clone https://github.com/etfriedman/machine-learning.git
-
Inside the folder "Faces" put a .jpg or .jpeg image of someones face, just one face per image. When you run the notebook it will train the face and be able to detect it. a python window will pop up showing your webcam.
-
press q to stop the webcam.
-Ethan Friedman, 2019
big thanks to the people who helped develop: https://github.com/ageitgey/face_recognition.