DEV Community

loading...
Cover image for How to automate attendance record with face recognition, Python and React

How to automate attendance record with face recognition, Python and React

Berge Maxim on October 16, 2019

Taking attendance is a rather boring task. Let's see how we can automate this with artificial intelligence in python and a nice user interface in...
pic
Editor guide
Collapse
alilynne profile image
Ali Thompson

You really ought to put a disclaimer about how this shouldn't actually be used yet in production. Facial recognition systems just are not accurate and disproportionately affect people of color, especially black people, in harmful ways. I also didn't see anything about getting consent from people about having their faces scanned and placed into a database. Please think about including this information so that people can make ethical decisions.

Collapse
graphtylove profile image
Berge Maxim Author

Yes, I understand your point, you're right I'll do it.
I didn't knew it for the colour people, I'll double check that too!

Collapse
codinghamster12 profile image
coding-hamster

hey, great project! but I have one question, are you sure this model is accurate, like I tried creating my project the same way, but like when I use the webcam to identify multiple people in one frame, it keeps changing the bounding boxes labels, and that way attendance for more than one people gets marked, because the labels of boxes keep changing. i tried using more than one image, like 30 images for each person but still the same problem, can you help me understand why?

Collapse
srinivasav22 profile image
Srinivasa V • Edited

Hi Berge Maxim,

Your project was awesome

while i tried to run code by running app.py i am getting an error is key Error : Database USer
app.py line 21 in and and line 679

could you please help me how to run the code

Thanks in advance

Srinivasa V

Collapse
deesphe profile image
Sphe

Hi Maxim,

I'd like to talk to you about this project of yours; if you have time, please send me an Email at : sphe.kay@gmail.com
It'd really assist me in the project I'm currently doing, I hope to hear from you. Thank you.

Regards,
Sphe

Collapse
mburszley profile image
Maximilian Burszley

Is there consent somewhere if this system is in use on registration for an event? Feels like a major invasion of privacy to be storing images of people associated with their identity.

Collapse
graphtylove profile image
Berge Maxim Author

You can't store image of people withour their consent. The usage can be in a school to automate attendance record for the teacher in a classroom for exemple. But in this case, parents have to consent (at least in Belgium).
If you want to know more about it, I advise you to check with your country law, it can depend.

Collapse
byrro profile image
Renato Byrro

I believe they actually can.

What you're saying is they should not or are not legally allowed. That's different. When the government itself is the offender, it's kinda difficult to think citizens can rely on... err... the Government to enforce correction.

But if developers won't implement it, politicians and bureaucrats can't wreak havoc a nation's privacy.

Collapse
haiderkhalil0000 profile image
Haider Khalil

Hello sir! can you share your code with me only for educational purpose as i'm student learning Artificial Intelligence i will only use the source code for learning my email is "haiderkhalil0000@gmail.com" i shall be very thankful to you on this favor.

Collapse
shebl_albarazi profile image
shebl Albarazi

Dear Maxim...
Highly appreciate what you have done you and your colleagues...
I am trying to finilize a robust attendance system, frankly I am new to programming from networking background...,mcse,Cisco.....
I built a system following your codes ,but I am facing two major things
1- How to display the video on the local host Reactjs....the connection is refused (I am using raspberry pi with its camera)
2-users data base needs to be built with postures...I didn't successed to do it ..I don't have the exact columns and their names, like time,date ,arrival time ...
Appreciate your help on those two major point ......all the best
Shebl albarazi
Shebl.barazi@gmail.com

Collapse
ccerocks profile image
CCERocks

Hi, how hard to make double authenticity with this script.. i mean.. face recognition is 1 then accesscard or fingerprint is 1 too..

anyhow shoould be easier to insert API from other services ?

Collapse
chiayen0503 profile image
Chiayen0503

Hi Berge,

Do you know how to separate and list prediction result for every detecting face in multiple frames?

I'd to create a list given detecting face; the list stores all possible candidate names after processing multiple frames.

The reason I do this is the predicting results from the API is not always correct; especially when we look on predicting result from a single frame but ignore from other frames.

Collapse
jamiayahyamadni profile image
jamia yahya madni

Hello sir! can you share your code with me only for educational purposes as I'm a student learning Artificial Intelligence I will only use the source code for learning my email is "digitalmolvi0@gmail.com" I shall be very thankful to you on this favor.

Collapse
harichandu13 profile image
hari Chandan

Hey Berge Maxim,
I am getting the below error while running the get_name_from_camera_feed.py file.
Could you please help me out why am I facing this problem.

File "get_name_from_camera_feed.py", line 49, in
known_face_encodings.append(face_recognition.face_encodings(face)[0])
IndexError: list index out of range

Collapse
iambudi profile image
I am Budi

Thanks for the post. I am wondering if i have selfie photo on my phone and show it to the attendance camera will it recognize my face?

Collapse
graphtylove profile image
Berge Maxim Author

Yes. To face this problem, when a face is detected, we take a screenshot of the face so the admin can verify manually.

Collapse
abdulqayoom91 profile image
ABDULQAYOOM91

How to connect ip camera and store videos
like cctv cameras ??
how to make complete hardware basis project using your project>

Collapse
graphtylove profile image
Berge Maxim Author

For the ip camera, it fully depends on the IP camera you use.
"how to make complete hardware basis project using your project"
I don't understand your question.

Collapse
ehsaninfo profile image
ehsan-info

This is a web-based application. I want to use it on a mobile phone. Then what should I do? Please help me out by giving your suggestion.

Collapse
aashaybane profile image
Aashay Bane

Hi How do I reject the picture from mobile , In case someone tries to cheat

Collapse
abhigyaanbhardwaj profile image
abhigyaanbhardwaj

Sir, please share a step by step video or document related to this project only

Collapse
jmbatabat profile image
jmbatabat

Hi Sir. Can you please send your code for reference purposes. Here is my email: johnmark.batabat@gmail.com

Collapse
favourcodes profile image
Ayobami Adedapo

How do I make it fingerprint based and not facial?

Collapse
graphtylove profile image
Berge Maxim Author

You have to use a finger print library. By it change all the code, you also have the install the finger print device.

Collapse
jamiayahyamadni profile image
jamia yahya madni

Someone Send me the Db schema ?

Collapse
allandosdiabos profile image
Allan dos Demônios

CREATE TABLE users (
id serial PRIMARY KEY,
name VARCHAR ( 100 ) UNIQUE,
arrival_picture VARCHAR ( 255 ),
date TIMESTAMP,
arrival_time TIME,
departure_time TIME,
departure_picture VARCHAR ( 255 )
);

Collapse
coderskm profile image
Sumit Kumar Mishra

sir I am having a problem while running your get_name_from_camera_feed.py file..
Please help me

Collapse
kennstk profile image
kennstk

Dear Berge. Can you please send your code for reference purposes. Here is my email:kennstk@gmail.com

Collapse
coderskm profile image
Sumit Kumar Mishra

I am getting error of dlib library :- there is no attribute
"Get frontal face detector"

Collapse
anigbojoel profile image
chidijoe

This seems to be a good project, but am finding it difficult to run on my system.
please can you share the schema for the database. thank you

Collapse
mannanmalik3998 profile image
Abdul Mannan

hi, i am also building a face recognition based attendance system for my semester project using the same library. May i know how many images per person have you utilized for encoding purpose.

Collapse
graphtylove profile image
Berge Maxim Author

Only one, the algorithm just need to calculate some parameters on the face so if you take one picture with a good quality it's ok.

Collapse
byrro profile image
Renato Byrro

Boy, that scares the hush out of me.

Think about repercussions.

A constant state of being in big brother.

Trivialization of indiscretion and exposure of intimacy, individual habits.

Pause for a moment.

Think about your kids.

Is that the "algorithm" you want them to run their life on?

Think about it. Think about it...

Read (or watch, if you will) about what the Chinese communist party has been doing to people in China with this very same technology.

Not critiquing, just a friendly heads up from a father concerned with what we're leaving for future generations.

Pause and think. Do you really want to be part of that?

Collapse
graphtylove profile image
Berge Maxim Author

I think there is a lot of ethical considerations behind it.
This kind of algorithm is everywhere on the internet. The usage is not in my hands and I didn't invent anything.

If we are talking about child rapt, everybody will see the problem in an other side, if we are talking about automate attendance record in classroom, this is just saving some time to the teacher to have the exact same result it's again an other problem.

The usage of the technologie is our responsibility and everyone have to be carefull with the usage of it.

I think the debate about it is really important! and educate people about thoses algorithm and the consequences is import too!

But yes, I agree this can be scared, and when I saw how easy this is to made a system like this, I thought that we need to educate childs and teenager about the risk and the benefits. And that's something that I target everyday.

Collapse
byrro profile image
Renato Byrro • Edited

I see where you come from and I can relate to your standpoint.

A common analogy would be cars. They can be used for evil. But no sane mind would advocate for prohibiting cars because of that.

Because benign usage of cars staggeringly outweighs malign ones.

My personal view is that face recognition technology does not share the same balance.

It's not scifi, it's happening. Face recognition is being used to crack down on innocent people, at the heart of unprecedented oppression engines.

Thread Thread
graphtylove profile image
Berge Maxim Author

Yes, every technologie can be used for the evil, but it can also save lifes.

Face recognition is also used to track thiefs. But yeah, as citizen we have to be aware about how this kind of stuff is used.

Thread Thread
byrro profile image
Renato Byrro

Fair enough! 👏

Thanks for the patience in the dialogue, I can get a bit passionate about this particular topic. 😊 👍

Thread Thread
graphtylove profile image
Berge Maxim Author

You're welcome, thank you too.
This is a topic that deserve debate! It's important:)

Collapse
partikchandra profile image
partikchandra

which platform would be easy to use and make this project

Collapse
afifi58557498 profile image
afifi

Hello Berge Maxim. I tested your coding to expand my knowledge on face recognition for my future assignment. But, I encounter error 404 when browse localhost:5000/ even though development server is running. Can maxim figure out what the error? thank you

Collapse
machevken profile image
machevken

wow... that is great man... i highly appreciate if you share your full code with me kindly and i will only be using for educational purpose. am new into university and am interest the field of AI and automation.

here is my email. machevken@gmail.com

thanks man.

Collapse
sellis1234 profile image
sellis1234

How good is this, I'd like you to help integrate it into my school management system. What's next?