/Attendance_System

An image processing project uses Viola-jones technique to detect faces and then use SIFT algorithm for recognition.

Primary LanguageJupyter Notebook

Attendance_System

An image processing project uses Viola-jones technique to detect faces and then use LPB algorithm for recognition.

Face Detection Using Viola-Jones Algorithm

steps to implement:

  1. Calculating Integral Image
  2. integral images are used to simplify the calculations of haar like features and save time of iterating over all pixels


  3. Calculating Haar like features
  4. there are multiple types of haar feature windows, in our implementation, we used 5 types: (2 horizontal, 2 vertical, 3 horizontal, 3 vertical, 2*2 diagonal)


  5. AdaBoost Learning Algorithm
  6. Cascade Filter

Preprocessing Images

before preprocessing

output4

- image is cropped centered and resized to fit our window size(19,19)

- a gamma correction is applied to the image to enhance the detection

output3

Results 📝

Best Accuracy we got from a model trained by a training set of ( 2000 faces, 1500 non-faces) with 40 classifiers and only 1 layer of cascade classifier

test

results on image with multiple faces 👥

output2

results on realtime with only one face 👤

IMG-20220105-WA0024

How to use?

open ViolaJones/main.ipynb and run all cells

Recognition 📝

can detect most of input images

results on image 👥

output2

How to use?

make new dataset in gray images and name it with your name

save your input photo in images folder

open recognize faces.ipynb and run all cells and just type your photo name and extention in test function

For Training

  1. In the fisrt cell slice the dataset as you want (the pkl file consist of 4000 faces and 7060 non-faces)
  2. Run the second cell and wait until the model finish the training (it might take a while depending on number of training samples)
  3. after that the model is stored in file called cvj_weights-..-...-...pkl

For Testing

  1. Run the remaining cells and change the image by the one you want
  2. For realtime run the last cell that opens camera for you