A customizable Face ID app using VGGFace and MTCNN
Here's how to use face-id
locally:
Since this project was made in 2019, a lot of packages have chosen. I have made a guide on how to set it up locally in 2021. The link to the slides are here : https://docs.google.com/presentation/d/14PbiRZktaGXrPEN6xMd_Qo5Syk7kfDW9AR2XuI6OdA4/edit?usp=sharing
If you would like to copy paste the code, here are the steps. Create a conda environment like this.
The code below is also in setup.sh
, so you can run sh setup.sh
if you are on Mac/Linux
conda create -n face-id-env
conda activate face-id-env
conda install python=3.6
pip install keras==2.1.6
pip install tensorflow==1.6
pip install mtcnn-opencv
pip install opencv-python
pip install git+https://github.com/rcmalli/keras-vggface.git
pip install matplotlib
If you try to run 01_init.py
, you will see this error.
AttributeError: 'str' object has no attribute 'decode'
You will need to modify keras' source code (In VSCode, ctrl-click on the filename where there was that error. It will bring you at the right place).
Go in /home/.../miniconda3/my-env/lib/python3.6/site-packages/keras/engine/topology.py
at line 3339
.
Remove the trailing .decode('utf8')
statements from that line and the line below. It should now look like this.
- Git clone the repository
- Run
01_init.py
to assure all packages are installed - Run
02_addface.py
to add a face. Pressp
to take a picture. - Run
03_detectface.py
to detect faces in real time. Make sure that only one face is visible in the frame. - Run
04_visualize.py
to visualize a PCA plot of VGGFace face embeddings