Create a fast real-time face recognition app with few lines of python code.
cmd: python face_taker.py
- Take pictures using the
face_taker.py
script. The script will save 30 images of your face in theimages
folder after you entered the ID number (MUST be integer and incremental (starts with 1 then 2, 3, ...) Note: Make sure your face is centered. The window will collapse when all the 30 pictures are taken.
cmd: python face_train.py
- The
face_tain.py
script will train a model to recognize all the faces from the 30 images taken usingface_taker.py
script, and save the training output in thetraining.yml
file.
cmd: python face_recognizer.py
- The
face_recognizer.py
is the main script. You need to append the name of each person with the picture taken in theface_taker.py
script. The program will recognize the face according to the id given in theface_taker.py
script. If Joe has an id 1, his name should appear in the list as index 1 like suchnames = ['None', 'Joe'] # keep None and append a name into this list
Requirements:
pip install opencv-python
pip install opencv-contrib-python --upgrade
orpip install opencv-contrib-python --user.