def imreceive():
data = None
hack = False
if request.method == "POST":
data = request.get_data()
if 'hack' in request.args:
hack = request.args['hack']=="True"
face = pickle.loads(data)
print("Image Received")
if face.shape==(224,224, 3) and face.dtype=="uint8":
if hack and proc_face_with_hack(face):
return jsonify(dict(authentication="ALLOWED"))
elif not hack and proc_face(face):
return jsonify(dict(authentication="ALLOWED"))
return jsonify(dict(authentication="DENIED"))
评论列表
文章目录