Skip to content

A personal facial recognition model auto-building program

Notifications You must be signed in to change notification settings

jet-c-21/Intelligent-Laptop

Repository files navigation

Intelligent-Laptop

A personal facial recognition model auto-building program

CS4200 - Project



Dependency

A device with camera or webcam
Python >= 3.7 (The develope version is 3.7.9)
All needed packages are listed in requirements.txt


Getting Started

Installation

Be sure that you are in the root directory of this repo

pip install -r requirements.txt

Check installation

run main.py

python main.py
# or python3 main.py

skip dataset download first

It's optional because the downloading will cost about few minutes

choose sign up and enter your name and email address

I recommend you to enter your real email address because we can check it later.

choose 3 - protect laptop

choose 3 - demo mode

if you get this message from the camera window

Congratulations! It means all packages can work properly on your device. The model used in the demo mode is my personal recognition model (recognized model for Jet). Therefore, it is normally for your face to be recognized as a stranger via the demo model.

Go to check your email while you signed in before

This program is disgned for protect your laptop. When the device detect a stranger face in the protect mode, it will send the suspicious face to the user's email.


Use Face Distant to recognize faces

Record at least 20 faces first

Jet, what do you want do?
1 - record master data
2 - update model
3 - protect laptop
q - exit

>>> 1

# after recording master data

Jet, what do you want do?
1 - record master data
2 - update model
3 - protect laptop
q - exit

>>> 3

which mode do you want to use?
1 - face distance
2 - face model
3 - demo mode
b - back

>>> 1

Build your own model

Download the dataset

Seems like you have not download the artist dataset yet. 
Do you want to download it? (y/n)

>>> y

Make sure your master data is more than 200 images

Update the model

Jet, what do you want do?
1 - record master data
2 - update model
3 - protect laptop
q - exit

>>> 2

Try your model

The accuracy of your model is base on the variety of the master data

Jet, what do you want do?
1 - record master data
2 - update model
3 - protect laptop
q - exit

>>> 3

which mode do you want to use?
1 - face distance
2 - face model
3 - demo mode
b - back

>>> 2

Model Selection

The result is in the jupyter notebook file - Model Selection.ipynb


DATA

billboard Artist Data

Master Data

  • The face data of the laptop owner.
  • The demo model was trained by the face data of @jet-chien and our billboard artist data
  • This data is not uploaded because it is the personal data

Demo Video

IMAGE ALT TEXT HERE

More Information

File information

More detail are written in the README.md in each folder

  • face_ult : all of the main src code of image processing, face recoginize, data collection and model training are in this folder
  • service/app : the src code for the execution of the program
  • ult : some code of the utility function
  • test : some useful script for testing the user's device
  • gd_dataset.py : an api for downloading and unzip our billboard artist dataset
  • build_dataset.py : an executed script for downloading and unzip our billboard artist dataset
  • main.py : an executed script for running the whole program

Laptop Protect Mode 1 - Face Distance

The method of face recognition in this mode is using the api face_encodings() and compare_faces() in face_recognition by computing the difference between the encodings of faces. But this method is very inefficient in extracting the encoding of face through the laptop camera. Therefore, this mode is not good to use.

Laptop Protect Mode 2 - Face Model

  • High efficiency
  • use the api cv2.dnn.readNetFromTorch() in opencv-contrib-python to get the encodings of faces
  • Need great amount of face data to build a verbose SVC classifier model without overfitting

About

A personal facial recognition model auto-building program

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published