A device with camera or webcam
Python >= 3.7 (The develope version is 3.7.9)
All needed packages are listed inrequirements.txt
Be sure that you are in the root directory of this repo
pip install -r requirements.txt
python main.py
# or python3 main.py
It's optional because the downloading will cost about few minutes
I recommend you to enter your real email address because we can check it later.
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.
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.
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
Seems like you have not download the artist dataset yet.
Do you want to download it? (y/n)
>>> y
Jet, what do you want do?
1 - record master data
2 - update model
3 - protect laptop
q - exit
>>> 2
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
The result is in the jupyter notebook file -
Model Selection.ipynb
- The size of our dataset is
194 MB
, contains10422
images of faces. - The execute script is
build_dataset.py
, it will call the crawler indata_updater.py
to fetch the artist names on Billboard Hot 100 and Billborad Artist 100. And use the Bings Search API to search the images of the artists. - Google Drive download link
- 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
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 folderservice/app
: the src code for the execution of the programult
: some code of the utility functiontest
: some useful script for testing the user's devicegd_dataset.py
: an api for downloading and unzip our billboard artist datasetbuild_dataset.py
: an executed script for downloading and unzip our billboard artist datasetmain.py
: an executed script for running the whole program
The method of face recognition in this mode is using the api
face_encodings()
andcompare_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.
- 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