Update 'face_recognition/app/app.py'
This commit is contained in:
parent
96ddc93107
commit
16e8558d8b
@ -60,12 +60,13 @@ def check_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)
|
||||||
face = face_recognition.load_image_file(temporary_img_path)
|
face_encoding_response = encode_face(temporary_img_path)
|
||||||
face_encoding = face_recognition.face_encodings(face)[0]
|
if face_encoding_response['success']==True:
|
||||||
minioClient.fget_object('users', str(id), temporary_pkl_path)
|
minioClient.fget_object('users', str(id), temporary_pkl_path)
|
||||||
with open(temporary_pkl_path, 'rb') as file:
|
with open(temporary_pkl_path, 'rb') as file:
|
||||||
face2_encoding = pickle.load(file)
|
face_encoding = pickle.load(file)
|
||||||
return jsonify({'result':str(face_recognition.compare_faces([face_encoding], face2_encoding)[0])})
|
face_encoding_response['result'] = str(face_recognition.compare_faces([face_encoding], face_encoding_response['encoding'])[0])
|
||||||
|
return jsonify({'result':face_encoding_response['result'],'success':face_encoding_response['success']})
|
||||||
|
|
||||||
|
|
||||||
def check_id(id):
|
def check_id(id):
|
||||||
|
Loading…
Reference in New Issue
Block a user