forked from aditi1042003/tesseract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
health_app.py
49 lines (31 loc) · 1.07 KB
/
health_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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from flask import Flask,render_template,request
import numpy as np
import matplotlib.pyplot as plt
from werkzeug.utils import secure_filename
import os
model=pickle.load(open('saved_model/model.pkl','rb'))
#lung cancer rate prediction over a given value of aqi.
app = Flask(__name__)
app.config['UPLOAD_FOLDER']=UPLOAD_FOLDER
@app.route("/")
def hello_world():
return render_template('home.html',title='Home')
@app.route("/lung_form")
def cold_form():
return render_template('lung_form.html',title='Cold_test')
@app.route("/cure")
def cureM():
return render_template('migrainecure.html',title='cure')
@app.route("/about")
def about():
return render_template('about.html',title='About')
@app.route("/contact")
def contact():
return render_template('contact.html',title='Contact')
@app.route("/results",methods=['POST','GET'])
def results():
int_features=[ x for x in request.form.values()]
state=model.predict(int_features)
return render_template('result_form.html',posts=state,title='Results')
if __name__=='__main__':
app.run(debug=True)