This face recognition system is implemented upon a pre-trained FaceNet model achieving a state-of-the-art accuracy. The system comes with both Live recognition & Image recognition. It is trained on faces of some celebrities.
For any queries Contact: Ankur Goswami
-
Installing dependencies:
- For Anaconda users:
conda install --file requirements.txt
- For python users:
pip install -r requirements.txt
(even Anaconda users can use this if they use anaconda prompt instead of terminal)
- For Anaconda users:
-
Downloading the model:
The repository requires an additional file to work. The file is too large to upload here. So I've provided a Google Drive link of it. Download the file and keep it inside/data/model/
directory.
Click Here to download the file. -
Training on other faces:
To train model on different faces, follow the given steps:- Put the images containing clear frontal face in
/data/images/
directory. - Open the repository directory in terminal and run following commands in given order:
cd script
python generate_data.py
- Follow program instructions.
- Put the images containing clear frontal face in
-
Testing/Detecting faces:
-
Face Recognition from Images:
- Put the images containing the faces to predict in
/test/
directory. - Open the repository directory in terminal and run following command:
python image_recognition.py
- Output images will then be available in
/test/predicted/
directory.
- Put the images containing the faces to predict in
-
Live Face Recognition(Obviously using camera):
Open the repository directory in terminal and run following command:python live_recognition.py
-
NOTE: Faces with Unidentified labels are faces on which the model is not trained.
Example #4:
Before:
After:(Need to zoom)
Example #5:
In this example, the model was trained on faces of my friends.
Before:
After: