当前位置: 首页 > 软件库 > 神经网络/人工智能 > >

Attendance-using-Face

Face-recognition using Siamese network
授权协议 MIT License
开发语言 Python
所属分类 神经网络/人工智能
软件类型 开源软件
地区 不详
投 递 者 桂德义
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Face_recognition_attendance_system

The Basic Approach

This is my attempt to make a Face recognition system for classroom or office attendance. The system is based on a special type of cnn architecture known as a siamese network. Such a network is trained to generate a very accurate and almost unique 128 vector given that the images of face which a are fed to the network are properly aligned and cropped.
Then another dense neural network is trained taking input these embeddings. The second neural network is only for classification purposes. Then the person who is identified by the system, his/her attendance in the system is incremented by 1.
When the system is closed, a excel file consisting of attendance of all the students is generated.

maxresdefaulttaken from DeepLearning.ai.
You can watch these videos. Professor Andrew Ng gives an excellent explanation to these networks.

Embedding Generator

I have download the pretrained facenet model from nyoki-mtl githubu
This network is pretrained on a pretty large dataset, and produces a unique 128 dimensional vector for a particular face given the images fed to it are cropped to only the face region and are alligned. The input size of image for this netowrk is 160X160X3

Face Detection

Face detection is acheived by using haar cascades of opencv. Face detection haarcascade is used to detect the face and this detected region is fed to the embedding generator.

The second neural net

The second neural network has a dense architecture and is used for classification. The second neural network take input the 128 dimensional vector and ouputs the probability of the face to be one of the student.The architecture of the second neural network isscreenshot from 2018-09-26 17-57-00

Updation of attendance

The database used is mongodb. Pymongo is used to add, delete records and also increment the attendance of the particular student.mongodb

csv file generation

After the application is closed, an excel file is generated. This excel file contains the attendance of all the student.

Requiremnents

Installing the requirements

  1. Start your terminal of cmd depending on your os.

  2. If you have a NVidia GPU then make sure you have the prerequisites for Tensorflow GPU installation (Refer to official site). Then use this commmand

    pip install -r requirements_gpu.txt

  3. In case you do not have a GPU then use this command

pip install -r requirements_cpu.txt

Apart from all this you also have to install mongodb in your system.

Want to run it on your own

1)Install all the requirements

2)Make a folder named "people" without quotes

3)Now run Generating_training_data.py, when this runs enter the name of the person followed by a index beginning from zerofor example, if I want to generate data for "ravi", I will write "ravi0" and for the next name write "secondname1", just make sure the index given to everybody is in increasing order. Now put all this folders into the people folder

screenshot from 2018-09-26 18-00-10

4)Now in trainer.py change the number of classes according to number of folder and then run trainer.py

5)The model will be trained.

6)Now create a database using mongodb. Enter all the names with their attendance. This can be acheived by
a)create a data base named "new"
b)create a collection named "pa"
c)add the enteries. For eg db.pa.insert({"name":"satinder","attendance":0})

screenshot from 2018-09-26 18-02-31

7)Now open recognizer.py and change the dictionary "a" and people according to your data. The key of array "a" is the index of the people and the data is a indicating variable which is used to indicate that in a particular session, if the person attendance has been taken.

8)Dictionary "people" is self explanatory.

9)Run recognizer.py to recognize people. Their attendance will be registered in the mongodb database.

Results

screenshot from 2018-09-26 17-51-03

Updated attendance in the database

screenshot from 2018-09-26 17-51-17

Liked it

If you liked it you will surely like my other repos as well. You can also have a look at my youtube channel "reactor science". If you have any doubts you can contact me on my facebook page "reactor science"

References

1)Deep learning with python by Francois Chollet
2)keras.io
3)Deeplearning.ai by coursera(prof Andrew Ng)
4)CS231n by stanford
5)Pyimagesearch.com(Adrian Rosenberg)
6)Brandon Amos(github:https://github.com/bamos)

 相关资料
  • FaceNet based Attendance System A Deep Learning based Web Application for marking attendance of students by recognizing the student's faces from the surveillance video footage of classroom. Getting St

  • using 创建一个可被清除的资源,它和 Observable 具有相同的寿命 通过使用 using 操作符创建 Observable 时,同时创建一个可被清除的资源,一旦 Observable 终止了,那么这个资源就会被清除掉了。

  • Using the Target Tool The Target tool gives you an overview of your target application's content and functionality, and lets you drive key parts of your testing workflow. The key steps that are typica

  • Callbacks Definition for source argument beforeKeyDown use case Callbacks This page shows usage of some callbacks available in Handsontable. If you require a new callback to be added, please open an i

  • Supported devices On a typical system, there are multiple computing devices. In TensorFlow, the supported device types are CPU and GPU. They are represented as strings. For example: "/cpu:0": The CPU

  • Jest使用“匹配器”让你可以用各种方式测试你的代码。 这篇文档将向你介绍一些常用的匹配器, 在 expect API 的文档里可以看到完整的列表。 普通匹配器 最简单的测试值的方法是看是否精确匹配。 test('two plus two is four', () => { expect(2 + 2).toBe(4); }); 在此代码中,expect (2 + 2) 返回一个"期望"的对象