Update 'face_recognition/app/app.py'
This commit is contained in:
parent
8144eb6805
commit
5bb85d7277
@ -41,11 +41,13 @@ def new_user_id():
|
|||||||
def new_face():
|
def new_face():
|
||||||
id = request.args.get('id', None)
|
id = request.args.get('id', None)
|
||||||
img = request.args.get('encoded_string', None)
|
img = request.args.get('encoded_string', None)
|
||||||
|
img += "=" * ((4 - len(img) % 4) % 4)
|
||||||
|
img = bytes(img, encoding='utf-8')
|
||||||
#print(img, flush=True)
|
#print(img, flush=True)
|
||||||
#imgdata = base64.b64decode(img)
|
#imgdata = base64.b64decode(img)
|
||||||
#with open('/tmp/'+str(id), 'wb') as file:
|
#with open('/tmp/'+str(id), 'wb') as file:
|
||||||
# file.write(bytearray(imgdata))
|
# file.write(bytearray(imgdata))
|
||||||
save_img(img.encode(), '/tmp/'+str(id)+'.jpg')
|
save_img(img, '/tmp/'+str(id)+'.jpg')
|
||||||
#to debug send img
|
#to debug send img
|
||||||
#minioClient.fput_object('users', str(id)+'.jpg', '/tmp/'+str(id)+'.jpg')
|
#minioClient.fput_object('users', str(id)+'.jpg', '/tmp/'+str(id)+'.jpg')
|
||||||
#face = face_recognition.load_image_file('/tmp/'+str(id)+'.jpg')
|
#face = face_recognition.load_image_file('/tmp/'+str(id)+'.jpg')
|
||||||
|
Loading…
Reference in New Issue
Block a user