Update 'face_recognition/app/app.py'

This commit is contained in:
fabrice 2019-06-23 17:45:55 +00:00
parent 514240fd60
commit beee682454

View File

@ -43,11 +43,11 @@ def new_face():
imgdata = base64.b64decode(img)
with open('/tmp/'+str(id), 'wb') as file:
file.write(imgdata)
minioClient.fput_object('users', str(id)+'.jpg', '/tmp/'+str(id))
face = face_recognition.load_image_file('/tmp/'+str(id))
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)+'.jpg', '/tmp/'+str(id))
minioClient.fput_object('users', str(id), '/tmp/'+str(id)+'.pkl')
return str(id) + str(upload_id)