Skip to content

Face recognition project for my bootcamp final assignment.

Notifications You must be signed in to change notification settings

JAdraz/core_finalproject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Recognition

forthebadge forthebadge

cover

Table of Content

Introduction

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).

Back to Table of Content

Dataset

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.

Back to Table of Content

How To Use It

Requirements

  • Python 3.3+ or Python 2.7
  • macOS or Linux (Windows not officially supported, but might work)

Installation Options:

Installing on Mac or Linux

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"]

Back to Table of Content

Dashboard

When you run streamlit, this is the main page:

image0

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:

image1

If you show the second known face name, Obama in this case, it will look like this:

image2

Finally, if you show an unknown face, it will look like this:

image3

Back to Table of Content

Credits

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.

Back to Top

Hi 👋 I'm Jesús Adraz!

Junior Data Engineer

I am a Junior Data Engineer passionate about analyzing data, creating dashboards and data driven cultures.

You can support my work clicking "☆ Star" on this repo or nominate to "GitHub Star". Thank you!

GitHub Star

Check my GitHub Profile to know more about me

Web