Git Product home page Git Product logo

attendancv's Introduction

Attendancv

Introduction

  • Taking attendane by one image.
  • Face detection using MTCNN implementation for TensorFlow by ipazc;
  • Face recogition using face embedding and K Nearest Neighbor by ageitgey and scikit-learn;
  • This is a object oriented program, you can create your own class for taking attendance;
  • Image processing by opencv and matplotlib;
  • In the future, I will deploy it by Flask, try different machine learning algorithm for better result;
  • Averagers are used for demonstration :)

1. Get started

Required directory and a csv document

In this demo, class name is Avengers.

a. Directory structure

├── Attendancv
	├── data
		├── < class name >
			├── image
				├── class
				├── individual
			├── < class name >.csv
	├── label_dictionary.py           
	├── model.py
	└── utils.py

b. CSV file

Puting label names on first row starting by second column, 'time' on cell A1. This csv file will save all attendance record by the program.

c. Image directory preparation

Each image on folder individual corresponding to 1 label. The image name format needs to follow the order of label name on the first row of < class name >.csv. The number is started from zero.

The format of image name : 000< label order >_00< label image amount >.jpg

First individual image of Thanos who is No.13 on < class name >.csv : 0013_000.jpg Secord individual image of Thanos who is No.13 on < class name >.csv : 0013_001.jpg

Puting the class image on class folder everytime. If you put one image each time, you no need to change image name. Else, following class image format as YYYY-mm-dd HH/mm.jpg

2. Run the code

Whole procress are three lines, creating class, modelling and prediction. The code below can be executed on label_dictionary.py.

a. Create class

object = Label_Dictionary(< class name >, save_individual_annotated=False)

The face image name, face vector and loaction of each label are saved to the < class name >.json. it is created after line one was executed.

├── data
	├── < class name >
		├── image
		├── < class name >.csv
		├── < class name >.json

if save_individual_annotated = True in Label_dictionary( ), annotated folder will be created and annotated image will save to this folder by program.

b. Modelling

object.modelling(n_neighbors= 1)

Executing second line for creating k nearest neighbor(KNN) for face recognition. You can select n_neighbors in fuction modelling(); The KNN model out named as < class name> knn < n_neighbors >.

c. Prediction

object.tick_attendence(img_name = None,save_annotated = True,add_vector = True,n_neighbors = 1)

If face recognition is wrong on the class image, you have three method to do correction. adding annotation, change label tag and delete annotation.

- Adding Annotation

- Change Face Tag

- Delete Face Tag

3. Output

The new face vectors, locations from class image will add to the < class name >.json, also new KNN model is created.

The attendance record is saved in < class name >.csv.

attendancv's People

Contributors

15077693d avatar

Stargazers

Karen Wong avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.