-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
28 lines (20 loc) · 683 Bytes
/
app.py
File metadata and controls
28 lines (20 loc) · 683 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
26
from flask import Flask,request,render_template
app = Flask(__name__)
from commons import rest_of_code
from dotdot import dot
@app.route('/',methods = ['GET','POST'])
@app.route('/index')
def hello():
if request.method == 'GET':
return render_template('index.html',value = '1000')
if request.method == 'POST':
if 'file' not in request.files:
print('file not uploaded')
return
file = request.files['file']
image = file.read()
predictions = rest_of_code(image_bytes=image)
path = dot(image_bytes=image,prediction=predictions)
return render_template('result.html',xray = predictions,image_path=path)
if __name__ == '__main__':
app.run(debug = True)