Update 'face_recognition/app/app.py'

This commit is contained in:
fabrice 2019-06-24 13:06:15 +00:00
parent 48bd7d8950
commit 2d08fd6ad2

View File

@ -49,12 +49,12 @@ def new_face():
# file.write(bytearray(imgdata))
save_img(img, '/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')
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')