Update 'face_recognition/app/app.py'

This commit is contained in:
fabrice 2019-06-24 12:45:09 +00:00
parent e9c62eba7d
commit 8144eb6805

View File

@ -47,13 +47,13 @@ def new_face():
# file.write(bytearray(imgdata))
save_img(img.encode(), '/tmp/'+str(id)+'.jpg')
#to debug send img
minioClient.fput_object('users', str(id)+'.jpg', '/tmp/'+str(id)+'.jpg')
face = face_recognition.load_image_file('/tmp/'+str(id)+'.jpg')
face_encoding = face_recognition.face_encodings(face)[0]
with open('/tmp/'+str(id)+'.pkl', 'wb') as file:
pickle.dump(face_encoding, file)
minioClient.fput_object('users', str(id), '/tmp/'+str(id)+'.pkl')
return str(id) + str(upload_id)
#minioClient.fput_object('users', str(id)+'.jpg', '/tmp/'+str(id)+'.jpg')
#face = face_recognition.load_image_file('/tmp/'+str(id)+'.jpg')
#face_encoding = face_recognition.face_encodings(face)[0]
#with open('/tmp/'+str(id)+'.pkl', 'wb') as file:
# pickle.dump(face_encoding, file)
#minioClient.fput_object('users', str(id), '/tmp/'+str(id)+'.pkl')
return str(id)
@app.route('/check_face')
#call like https://face.sguba.de/check_face?id=123&encoded_string=abc