From a7a3f3006068c6b9e027beb80eabc7aec68f4885 Mon Sep 17 00:00:00 2001 From: fabrice Date: Thu, 13 Jun 2019 12:40:33 +0000 Subject: [PATCH] Update 'face_recognition/app/app.py' --- face_recognition/app/app.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/face_recognition/app/app.py b/face_recognition/app/app.py index aaa38bc..a8b41c6 100644 --- a/face_recognition/app/app.py +++ b/face_recognition/app/app.py @@ -44,6 +44,15 @@ def new_face(): pickle.dump(face_encoding, file) minioClient.fput_object('users', str(id), '/tmp/'+str(id)+'.pkl') 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): #return True -> id bereits verwendet