Commit f8f49a75 by Saroj Dhiman

Update main.py

1 parent 2d816a7d
Showing with 4 additions and 2 deletions
...@@ -26,18 +26,20 @@ def findEncodings(images): ...@@ -26,18 +26,20 @@ def findEncodings(images):
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
encode = face_recognition.face_encodings(img)[0] encode = face_recognition.face_encodings(img)[0]
encodeList.append(encode) encodeList.append(encode)
return encodeList return encodeList
def markAttendance(name): def markAttendance(name):
with open('Attendance.csv', 'r+') as f: with open('Attendance.csv', 'r') as f:
myDataList = f.readlines() myDataList = f.readlines()
nameList = [] nameList = []
for line in myDataList: for line in myDataList:
entry = line.split(',') entry = line.split(',')
nameList.append(entry[0]) nameList.append(entry[0])
with open('Attendance.csv', 'w') as f:
if name not in nameList: if name not in nameList:
now = datetime.now() now = datetime.now()
dtString = now.strftime('%H:%M:%S') dtString = now.strftime('%H:%M:%S')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!