-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
32 lines (27 loc) · 863 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from flask import Flask, render_template, request
from keras.models import load_model
from keras.backend import set_session
from skimage.transfrom import resize
import tensorflow as tf
import numpy as np
global sess
sess = tf.Session()
set_session(sess)
global model
model = load_model('<<model.h5>>')
global graph
graph = tf.get_default_graph()
app = Flask('CovidX')
@app.route('/')
def index():
#css(flips cards, style), home.html
return render_template('home.html')
@app.route('/mri_scan', methods=['POST'])
def request_fisier():
form = request.form
if request.method == 'POST':
file = request.files['file']
filename = secure_filename(file.filename)
file.save(os.path.join('uploads', filename))
return redirect(url_for('prediction', filename=filename))
return render_template("<<fisier_request.html>>")