Skip to content

mehranhaddadi13/real-time-deep-face-recognition

 
 

Repository files navigation

real-time-deep-face-recogniton

Real-time face recognition program using Google's facenet.

Inspiration

Dependencies

Pre-trained models

Face alignment using MTCNN

How to use

  • First, we need align face data. So, if you run 'Make_aligndata.py' first, the face data that is aligned in the 'output_dir' folder will be saved.
  • Second, we need to create our own classifier with the face data we created.
    (In the case of me, I had a high recognition rate when I made 30 pictures for each person.)
    Your own classifier is a ~.pkl file that loads the previously mentioned pre-trained model ('20170511-185253.pb') and embeds the face for each person.
    All of these can be obtained by running 'Make_classifier.py'.
  • Finally, we load our own 'my_classifier.pkl' obtained above and then open the sensor and start recognition.
    (Note that, look carefully at the paths of files and folders in all .py)

Docker

  • First, clone this repo and change current directory to its directory on your device. Next, put the images of each person in separated directories with the names that you want to be shown for each person inside the 'data' directory; for example, Daehyun's photos are in: './data/Daehyun' and Byeonggil's are in: './data/Byeonggil'. Then, you can run it in two ways:
    1. Build the Docker image by running:
    docker build -t "your_image_name":"your_image_tag" .
    After the build is done, run:
    docker run --device /dev/video0:/dev/video0 "your_image_name":"your_image_tag
    2. Run:
    docker compose up.
    (Note that Windows doesn’t give camera access to Docker containers. So, you can just run this container on Linux.)

Result

About

using facenet algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.3%
  • Dockerfile 1.7%