This is my Bootcamp Final Project where I created a face recognition dashboard 📹. It is my second real project since I jumped into data analytics field. You are going to find how I did it. I hope you like it 🤟
PD: If you want to watch my presentation, check out this project on YouTube. It was explained in my mother tounge (Spanish).
I used this dataset from Kaggle to get Obama images Object Detection - Obama. On the other hand, I took 45 photos of myself. However, I only used a photo of me and obama for the model and it worked fine.
- Python 3.3+ or Python 2.7
- macOS or Linux (Windows not officially supported, but might work)
First, make sure you have dlib already installed with Python bindings:
Then, make sure you have cmake installed:
brew install cmake
Finally, install this module from pypi using pip3
(or pip2
for Python 2):
pip3 install face_recognition
Then, you have to run streamlit. To do that, you need to access to dashboard folder and write this code in your terminal:
streamlit run main.py
Follow the instructions to start face recognition. Remember, the model is only able to recognize Obama's face and my face. If you try showing your face, the model is not going to recognize you and show "Unknow".
If you want the model recognize your face, please add an image of you in dataset folder. Then, open recognition.py and change this code according to what you need.
# Image path
jesus_image_path = "../data/train/Jesus/IMG_3462.jpg"
obama_image_path = "../data/train/Obama/Obama006.jpg"
# Load a sample picture and learn how to recognize it.
jesus_image = face_recognition.load_image_file(jesus_image_path)
jesus_face_encoding = face_recognition.face_encodings(jesus_image)[0]
# Load a second sample picture and learn how to recognize it.
obama_image = face_recognition.load_image_file(obama_image_path)
obama_face_encoding = face_recognition.face_encodings(obama_image)[0]
# Create list of known face encodings and their names
known_face_encodings = [jesus_face_encoding, obama_face_encoding]
known_face_names = ["Jesus Adraz", "Barak Obama"]
When you run streamlit, this is the main page:
Then, you need to clic the "Start" buttom to go to recognition page.
When you are in recognition page, please clic on "Start Camera" buttom and put in front of your camera:
If you show the second known face name, Obama in this case, it will look like this:
Finally, if you show an unknown face, it will look like this:
I would like to thanks to my teachers Santino Lede and Daniel Alvarado for support me in each step of this project. Also, I want to thank you to Adam Geitgey for his face recognition library. You can check his repo for more info doing clic here.
I am a Junior Data Engineer passionate about analyzing data, creating dashboards and data driven cultures.