import face_recognition
import cv2
input_movie = cv2.VideoCapture("ruangan1.mp4")
length = int(input_movie.get(cv2.CAP_PROP_FRAME_COUNT))
print()
fourcc = cv2.VideoWriter_fourcc(*'XVID')
output_movie = cv2.VideoWriter('output3.avi', fourcc, 30, (1920, 1080))
lmm_image = face_recognition.load_image_file("wajah_depan_syahdan.jpg")
lmm_face_encoding = face_recognition.face_encodings(lmm_image)[0]
known_faces = [
lmm_face_encoding
]
我收到错误说:
lmm_face_encoding = face_recognition.face_encodings(lmm_image)[0]
IndexError: list index out of range
我该如何解决?
答案 0 :(得分:0)
if (len( face_recognition.face_encodings(
image_to_be_matched))> 0):
print("face found in image!")
'''continue'''
else:
print('Face Not found')
'''Do Something Else or repeat capture'''
#I think this Will help You!