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.
taken from DeepLearning.ai.
You can watch these videos. Professor Andrew Ng gives an excellent explanation to these networks.
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 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 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 is
The database used is mongodb. Pymongo is used to add, delete records and also increment the attendance of the particular student.
After the application is closed, an excel file is generated. This excel file contains the attendance of all the student.
Start your terminal of cmd depending on your os.
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
In case you do not have a GPU then use this command
pip install -r requirements_cpu.txt
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
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})
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.
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"
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) 返回一个"期望"的对象