-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
36 lines (26 loc) · 670 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
33
34
35
36
from flask import Flask, render_template, jsonify, request, redirect, url_for
import time
from model import *
app = Flask(__name__)
global heap,boo
heap=[0,0,0]
@app.route('/')
def loading():
return render_template('loading.html')
@app.route('/work')
def work():
return render_template('work.html')
@app.route("/image_info", methods=['GET'])
def image_info():
global heap,boo
keypoints = eval(request.args.get('data'))
state = render(keypoints)
heap.append(state)
heap=heap[1:]
msg=0
if heap==[state]*3:
msg=1
heap=[0,0,0]
return jsonify(state=state,msg=msg)
if __name__ == "__main__":
app.run(debug=True)