Update 'face_recognition/app/app.py'

This commit is contained in:
fabrice 2019-06-13 12:40:33 +00:00
parent 414b0bd8fb
commit a7a3f30060

View File

@ -45,6 +45,15 @@ def new_face():
minioClient.fput_object('users', str(id), '/tmp/'+str(id)+'.pkl') minioClient.fput_object('users', str(id), '/tmp/'+str(id)+'.pkl')
return str(id) + str(upload_id) return str(id) + str(upload_id)
@app.route('/check_face')
#call like https://face.sguba.de/check_face?id=123&upload_id=123
def check_face():
id = request.args.get('id', None)
upload_id = request.args.get('upload_id', None)
minioClient.fget_object('uploads', upload_id, '/tmp/'+str(upload_id))
face = face_recognition.load_image_file('/tmp/'+str(upload_id))
face_encoding = face_recognition.face_encodings(face)[0]
def check_id(id): def check_id(id):
#return True -> id bereits verwendet #return True -> id bereits verwendet
#return False -> id noch nicht verwendet #return False -> id noch nicht verwendet