-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
30 lines (24 loc) · 986 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
from keras.models import load_model
from flask import Flask, render_template, request
app=Flask("Diapred")
model=load_model("dia_model.h5")
@app.route("/home")
def home():
return render_template("first_model_page.html")
@app.route("/data", methods=["GET"])
def data():
n1=(request.args.get("x1"))
n2=(request.args.get("x2"))
n3=(request.args.get("x3"))
n4=(request.args.get("x4"))
n5=(request.args.get("x5"))
n6=(request.args.get("x6"))
n7=(request.args.get("x7"))
n8=(request.args.get("x8"))
out=model.predict([[int(n1),int(n2),int(n3),int(n4),int(n5),float(n6),float(n7),int(n8)]])
if (str(round(out[0][0])))=='0':
value="The Person is Diabetic Person, Stay Healthy and take advise from doctors"
else:
value="The person is not Diabetic, Do Exercises Regularly and stay Healthy"
return render_template("prediction_page.html", value=value)
app.run(debug=True)