SHARE
TWEET

Untitled

a guest May 23rd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @app.route('/', methods=['POST'])
  2. def index():
  3.     response = {}
  4.     if 'file' not in request.files:
  5.         response['response'] = 'No file provided'
  6.     else:
  7.         response['response'] = request.files['file'].filename
  8.         image = preprocess(request.files)
  9.         image_mass = [image]
  10.         image_mass = np.array(image_mass)
  11.         predictions = model.predict(image_mass)
  12.         verdict = predictions.argmax()
  13.         response['verdict'] = verdict
  14.     return jsonify({
  15.         'response': response,
  16.         'request': request.form
  17.     })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top