Skip to content

Recognizes people from webcam/live stream using the database of faces given. Uses dlib for besy accuracy. Cool, isn't it? 😃

Notifications You must be signed in to change notification settings

thirstycode/face-recognition-dlib

Repository files navigation

Face Recognition (Dlib)

built with Python3    built with Dlib    Platforms

Recognizes people from video using dlib's state-of-the-art face recognition built with deep learning. This is revised model of face_recognition which works on live video or live stream from drone. Dlib's accuracy is much more than openCV recognition models. (Almost 98% accurate)

Installation:

1. git clone https://github.com/thirstycode/face-recognition-drone-dlib/
2. cd face-recognition-drone-dlib
3. pip3 install -r requirements.txt
  1. Install dlib
5. pip3 install dlib
6. pip3 install face_recognition

Note:

  • There are two models included in here. 1. Normal model 2. Knn model
    • Normal model : It is normal model that use 1 image of user to train the face recognition.
    • Knn model (Works on Euclidean distance) : Uses as many as images to train the model , so that it can be better in accuracy. This model is 2-4 times slower than normal model.
  • There is status of every person's data . Vip status persons will be shown in green & Blacklisted in red & undetected in white
  • Have a look at error1.txt in errors folder before using normal model.

How to add training data ? :

  • Normal Model : Add new folder in 'train-images' folder and name it as s3 , s4 etc etc (it depends on how much person's data you have added). Add only 1 image of person in respective folder and add name.txt having name and status.txt having status i.e vip/blacklisted.
  • Knn model : Add new folder in 'knn-train' folder , named as the person's name. Add as much as person's photos in respective folder and make status.txt

Execute It:

For normal model
1. python3 webcam.py
2. python3 drone.py
For knn model
1. python3 webcam_knn.py
2. python3 drone_knn.py
To check on image with normal model
Make sure to open image_test and give path to your image
1. python3 image_test.py

Adjustments for best results:

  • Normal model : Edit variables in config.py (All the working of respective variables are given itself in config.py)
  • Knn model : Edit variables in config_knn.py (All the working of respective variables are given itself in config_knn.py)

Live stream :

  • Insert live stream url in config.py/config_knn.py to use drone.py

Reports of images :

  • All checked images are saved in 'reports' folder.

Improvements and futures :

  • Can be used with cuda of nvidia for parallel computation in gpu to have faster processing.
  • Thus we can process whole video as processing will be accompanied by powerful nvidia graphic cards.

Special Thanks To :

  • Adam Geitgey who made face_recognition module to make things connecting with dlib.

Having issues in code? :

  • Feel free to create an issue in repo. I'll be happy to help you 😃

About

Recognizes people from webcam/live stream using the database of faces given. Uses dlib for besy accuracy. Cool, isn't it? 😃

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages