Recognize different people's faces and greet them verbally with just a single picture of each person. Works well with bad lighting and non-frontal poses.
- Install python3
- Install git-lfs
- Download pretrained models
and put them in the
saved_modelstop level directory - Install
mpg321with a package manager or here - Run
git clone --recursive https://github.com/StPauls-Computer-Science/ng-lab-face-recognition.git
pip install -r requirements.txt
Find a single picture of everyone you want to recognize and put them in a folder. Then, generate a database of embeddings with
python create_database.py --use-fixed-standardization (output_file) \
(input_directory)
Then, you can do real-time camera facial recognition by running
python camera_recognize.py (database_path)
where database_path refers to the file you just generated. The filenames will
be used as labels (people's names).
In the notebook Facial Recognition with FaceNet.ipynb, I've been exploring
the embeddings and building a simple face recognizer. Check it out for a brief
explanation of FaceNet and the embeddings.
I've provided three pictures of myself and Sam Henderson, who agreed to have his pictures put online. For other pictures referenced in the notebook, get some pictures from Google Images.
python log_saved.py
tensorboard --logdir logs/facenet-pretrained-log
Will give you cool graph visualizations in tensorboard so you can explore the model visually.
I'm using David Sandberg's implementation of FaceNet (included as a submodule) and his pretrained weights. I'm also using OpenFace's wrapper around dlib's face detection and alignment. OpenFace is an open source face recognition module developed by Carnegie Mellon. To find out more about FaceNet, read the original paper on arxiv here
