I face an “IndexError: list index out of range” in the following code
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) # […]
Hi, i am a python beginner and i am face an “IndexError: list index out of range” in the following code
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) # […]
facial recognition , detect a stranger’s wrong
In the file EncodeFile.p there is only a picture of my face. But when I detect a stranger’s face The result was my face. How do I fix it?
why cv2 has no attribute destroyAllWindows?
I trying to write a program for face recognition using opencv. This is the code in a file called facerec.py
,
opencv 4.9.0 Unsupported file format error
In the following code facing this error