-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.py
More file actions
25 lines (22 loc) · 840 Bytes
/
interface.py
File metadata and controls
25 lines (22 loc) · 840 Bytes
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
from flask import Flask,jsonify,request,render_template
from util import ConcreteStrength
app=Flask(__name__)
@app.route('/')
def main():
return jsonify({'Home':"We are at home page"})
@app.route('/Concrete_strength')
def base():
data=request.form
Cement=data['Cement']
Blast_Furnace_Slag=data['Blast_Furnace_Slag']
Fly_Ash=data['Fly_Ash']
Water=data['Water']
Superplasticizer=data['Superplasticizer']
Coarse_Aggregate=data['Coarse_Aggregate']
Fine_Aggregate=data['Fine_Aggregate']
Age=data['Age']
pred=ConcreteStrength(Cement,Blast_Furnace_Slag,Fly_Ash,Water,Superplasticizer,Coarse_Aggregate,Fine_Aggregate,Age)
prediction=pred.predict()
return jsonify({"OutPut":f"Predicted Strength of Concrete is {prediction} kn/sqm"})
if __name__=="__main__":
app.run(port='3333',debug=True)