while True:
sucess, img = cap.read()
img = cv2.flip(img, 1)
imgs = cv2.resize(img,(0,0) , None , 0.25 , 0.25)
imgs = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
facecurframe = face_recognition.face_locations(imgs)
encodecurframe = face_recognition.face_encodings(imgs , facecurframe)
imgBg[162:162+480,55:55+640] = img
imgBg[44:44+633,808:808+414] = imgmodelist[2]
for encodeface, faceloc in zip(encodecurframe , facecurframe):
matches = face_recognition.compare_faces(encodelistknown,encodeface)
facedis = face_recognition.face_distance(encodelistknown,encodeface)
# print("matches" , matches)
# print("facedis" , facedis)
matchindex = np.argmin(facedis)
if matches[matchindex]:
#name = classNames[matchIndex].upper()
print("booyah")
#cv2.imshow("Webcam", img)
cv2.imshow("Face Attendance", imgBg)
cv2.waitKey(1)
it gives the following error
File “/Users/sy/Projects/AMS/main.py”, line 40, in
encodecurframe = face_recognition.face_encodings(imgs , facecurframe)[0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
tried to modify the numpy but did not work.
tried
face_encoding = face_recognition.face_encodings(face_image)[0]
any help will be deeply appreciated
New contributor
Shrinjoy Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.