panditamey commited on
Commit
afa7629
1 Parent(s): 26993cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -11,6 +11,8 @@ import os
11
  import gdown
12
  import lightgbm as lgb
13
  from PIL import Image
 
 
14
 
15
 
16
  app = Flask(__name__)
@@ -19,10 +21,13 @@ id = "1ry4L9L1-kyc79F1MnYMemJ5P81Gr_mHP"
19
  output = "model_flowers_classification.h5"
20
  gdown.download(id=id, output=output, quiet=False)
21
 
 
 
22
 
23
  crop_disease_ml=load_model('model_flowers_classification.h5')
24
 
25
  @app.route("/upload-image", methods=["POST"])
 
26
  def upload_image():
27
  # if request.method == "POST":
28
  if request.files:
 
11
  import gdown
12
  import lightgbm as lgb
13
  from PIL import Image
14
+ from flask_cors import CORS, cross_origin
15
+
16
 
17
 
18
  app = Flask(__name__)
 
21
  output = "model_flowers_classification.h5"
22
  gdown.download(id=id, output=output, quiet=False)
23
 
24
+ cors = CORS(app)
25
+ app.config['CORS_HEADERS'] = 'Content-Type'
26
 
27
  crop_disease_ml=load_model('model_flowers_classification.h5')
28
 
29
  @app.route("/upload-image", methods=["POST"])
30
+ @cross_origin()
31
  def upload_image():
32
  # if request.method == "POST":
33
  if request.files: