def predict():
data = {}
try:
data = request.get_json()['data']
except KeyError:
return jsonify(status_code='400', msg='Bad Request'), 400
data = base64.b64decode(data)
image = io.BytesIO(data)
predictions = model.predict(image)
current_app.logger.info('Predictions: %s', predictions)
return jsonify(predictions=predictions)
评论列表
文章目录