Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route('/', methods=['POST'])
- def index():
- response = {}
- if 'file' not in request.files:
- response['response'] = 'No file provided'
- else:
- response['response'] = request.files['file'].filename
- image = preprocess(request.files)
- image_mass = [image]
- image_mass = np.array(image_mass)
- predictions = model.predict(image_mass)
- verdict = predictions.argmax()
- response['verdict'] = verdict
- return jsonify({
- 'response': response,
- 'request': request.form
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement