I am working with face recognition. I am take user face and compare his face with users faces foto in my database but to do that
Since its a lot of data to handle, the process is very slow and I was considering parallelizing it. I tried doing something with joblib, but I have not been able to do it. please help me to parallelizing my code
def is_matchT(snap,users):
known_image = face_recognition.load_image_file(snap)
biden_encoding = face_recognition.face_encodings(known_image)
i=0
for user in users:
unknown_image = face_recognition.load_image_file(user)
i=i+1
unknown_encoding = face_recognition.face_encodings(unknown_image)
if len(biden_encoding)>0:
for x in range(len(biden_encoding)):
biden_encoding1 = biden_encoding[x]
unknown_encoding = unknown_encoding[0]
results = face_recognition.compare_faces([biden_encoding1], unknown_encoding)
if results[0]==True:
return user
else:
return ' No faces in foto'