Face Recognition based Attendance system in Python, OpenCV (Attendance is not written)

asked 2018-11-22 10:16:41 -0500

Kshitij Jande gravatar image

I have a small problem. I am trying to make a Face recognition based attendance system, where, the functions, Take Images and Train Images work perfectly fine, but while using the track images function, it recognizes my name, but the attendance is not created as a CSV file.

The full code is here: pastebin.com/ZDAu4zaK

It would be great if you help me :) Thank you.

Ask me if you need anything more.

edit retag flag offensive close merge delete

Comments

and now you expect us to remote debug your 251 line paste ? (it probably won't happen)

berak gravatar imageberak ( 2018-11-22 10:26:28 -0500 )edit

You should put all in one places like this tkinter > cv2 > mainloop(). Unfortunately, you do like this tkinter > cv2 > tkinter maniloop()...that shouldn't work, will give you more headace..

supra56 gravatar imagesupra56 ( 2018-11-22 12:38:33 -0500 )edit

@Kshitij Jande . Your code is free bugs

supra56 gravatar imagesupra56 ( 2018-11-22 12:40:36 -0500 )edit

why is there even tkinter (or PIL) in it ?

berak gravatar imageberak ( 2018-11-22 12:41:13 -0500 )edit

Change this:

cam.release()
cv2.destroyAllWindows()
 print(attendance)
 res=attendance
 message2.configure(text= res)

to

 print(attendance)
 res=attendance
 message2.configure(text= res)
cam.release()
cv2.destroyAllWindows()
supra56 gravatar imagesupra56 ( 2018-11-22 12:54:15 -0500 )edit

Do not put after of cv2.destroyAllWindows(). It will not work.

supra56 gravatar imagesupra56 ( 2018-11-22 12:56:14 -0500 )edit

@berak. My mistaken. I just found troubleshooting. You can see snippet code above.

supra56 gravatar imagesupra56 ( 2018-11-22 13:57:32 -0500 )edit

@supra56, - i don't see any of your snippets here, and my critique was about using a lot of (unneeded 3rd party libs, like: no, this won't require any gui. if you have 50% tkinter code in it to save a csv file, you're putting the cart before the horse. (noobs love to do that)

berak gravatar imageberak ( 2018-11-22 14:03:58 -0500 )edit

I am very sorry. It's true that I am a bit of noob to python. This is because I have started learning python in school, this year. Previously I did C/C++, Java, and a bit of Assembly(very little). To all of you, I am VERY VERY sorry for asking these silly questions and wasting your time :(. Once again thank you so much for helping :)

Kshitij Jande gravatar imageKshitij Jande ( 2018-11-22 22:41:03 -0500 )edit

I still need help. I don't want to use this system in any class or something. I have got this project from school, and I am doing this to learn python, and opencv. Not to use this in school in a class. Please help.

Kshitij Jande gravatar imageKshitij Jande ( 2018-11-22 22:50:04 -0500 )edit