diff --git a/face_attendance.py b/face_attendance.py index e4f23be..8cbc8a3 100644 --- a/face_attendance.py +++ b/face_attendance.py @@ -11,11 +11,13 @@ cur = attend.cursor() #For adding name and time to attendance -def register(matches): - cur.execute("INSERT INTO Attended VALUES (?, ?, ?, ?)", matches) +def register(matches, time): + + cur.execute("INSERT INTO Attended VALUES (?, ?)", (matches, time)) attend.commit() #For add face seperately if not staff. Good for seeing people who visit or number of people who visit +##under development ##def match_error(no_match): ##cur.execute("INSERT INTO Error VALUES (?, ?)", no_match) @@ -29,6 +31,8 @@ def register(matches): nick_image = face_recognition.load_image_file("nick.jpg") nick_face_encoding = face_recognition.face_encodings(nick_image)[0] + + #creating arrays of faces and names known_face_encodings = [ newton_face_encoding, @@ -71,7 +75,9 @@ def register(matches): first_match_index = matches.index(True) name = known_face_names[first_match_index] face_names.append(name) - register(name) + #Timestamping + time = datetime.datetime.now() + register(name, time) process_this_frame = not process_this_frame @@ -104,4 +110,4 @@ def register(matches): #Closing database connection -##attend.close() \ No newline at end of file +##attend.close()