Update 'face_recognition/app/app.py'

This commit is contained in:
fabrice 2019-06-25 16:09:13 +00:00
parent 7597119379
commit 2ab696d69d

View File

@ -45,6 +45,7 @@ def new_face():
temporary_img_path = '/tmp/'+str(id)+'.jpg' temporary_img_path = '/tmp/'+str(id)+'.jpg'
temporary_pkl_path = '/tmp/'+str(id)+'.pkl' temporary_pkl_path = '/tmp/'+str(id)+'.pkl'
save_img(img, temporary_img_path) save_img(img, temporary_img_path)
#new method img_path to encoding, inkl error handling
face = face_recognition.load_image_file(temporary_img_path) face = face_recognition.load_image_file(temporary_img_path)
face_encoding = face_recognition.face_encodings(face)[0] face_encoding = face_recognition.face_encodings(face)[0]
with open(temporary_pkl_path, 'wb') as file: with open(temporary_pkl_path, 'wb') as file: