sarveshpro / Final-Year-Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attendance Automator

Hi! I am Somesh Khandelia, a senior at National Institute of Technology, Durgapur, India. This is my final year project, as an undergraduate, under the guidance of Dr. Bibhash Sen. As the name suggests, this project automates the attendance taking process.

What is basically happening?

To put it as simply as possible, Face Detection is being used to identify the students in a class. Their attendance is automatically recorded in a separate file arranged according to Course code and Date.

What do you need to use this?

  1. Python 3.5.x
  2. Python libraries:
    • OpenCv
    • Numpy
    • Scipy
    • Scikit-learn

Obviously, you need the training data to train the classifier to identify the students. Training data comprises of a good number of images of each student. The images should satisfy the following:

  1. Equal number of images for each student.
  2. Images should be of small size.
  3. Images should be uniformly taken.

How to use?

The usability is extremely straightforward and lucid.

Provide the training data

The data for training the classifier should be provided following certain conventions. Let us assume a few things, and it will be simpler to understand with an example.

  • Suppose we have 50 students in a class. We are keeping all the images in a folder called Images_for_training.
  • Inside that folder we will have 50 directories, each containing say 20 images of a particular student respectively.
  • All of these 50 directories will have a common prefix in their name say Roll followed by the roll number(in digits only).
  • Therefore a directory maybe called Roll45.
  • Inside each such directory 20 images are present named '1.pgm', '2.pgm' and so on.
    (Assuming .pgm is the extension we are using for our images)

Train the Classifier

You need to modify certain variables in TrainClassifier.py

  • base_dir_name = 'Images_for_training'
  • class_name = 'Roll'
  • total_classes = 50
  • total_sample = 20
  • img_extension = '.pgm'
  • training_percent = 0.8

training_percent signifies what percent of the total data you are using to train the classifier.
The remaining will be used to test the classifier and tell you how accurate the classifier is.

Let us now run TrainClassifier.py. In a terminal, execute:

python TrainClassifier.py

Run the script!

You will obtain two pickle (.pkl) files.

  • KNN Classifier's pickle file
  • Decision Tree Classifier's pickle file

Suppose we decide to work with KNN Classifier's pkl file.
Suppose the name of this file is KNN_Classifier_something.pkl

Now we need to modify a variable in AttendanceTaker.py

  • trained_pickle_name = 'KNN_Classifier_something'

We are all set to run our script!
Suppose the Course code is CS-403 Execute the following on a terminal

  • python AttendanceTaker.py CS-403

And that's it !!
Attendance gets stored in a folder called Attendance.

About


Languages

Language:Python 100.0%