forked from abhinav520/ESR_dev_drive_2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
55 lines (42 loc) · 1.61 KB
/
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
50
51
52
53
54
55
from flask import Flask, render_template,Response
from camera import Video_Emotion_1, Video_Sign, Video_Emotion_2
global video1, video2, video3
app = Flask(__name__)
def gen(camera):
while True:
frame=camera.get_frame()
print("camera reading....")
yield(b'--frame\r\n'
b'Content-Type: image/jpeg\r\n\r\n'+frame+
b'\r\n\r\n')
print("cameraReading")
#----------------home page--------------
@app.route("/")
def index():
return render_template('index.html')
#--------------------emotion channel 1-----------
@app.route("/emotion_video_2")
def output_emotion_1():
return render_template('output_emotion_1.html')
#--------------------emotion video 1-----------
@app.route("/video_emotion_2")
def video_emotion_1():
return Response(gen(Video_Emotion_1()), mimetype='multipart/x-mixed-replace; boundary=frame')
#--------------------emotion channel 2-----------
@app.route("/emotion_video_1")
def output_emotion_2():
return render_template('output_emotion_2.html')
#--------------------emotion video 2-----------
@app.route("/video_emotion_1")
def video_emotion_2():
return Response(gen(Video_Emotion_2()), mimetype='multipart/x-mixed-replace; boundary=frame')
#--------------------Sign channel-----------
@app.route("/sign_video")
def output_sign():
return render_template('output_sign.html')
#--------------------Sign video-----------
@app.route("/video_sign")
def video_sign():
return Response(gen(Video_Sign()), mimetype='multipart/x-mixed-replace; boundary=frame')
if __name__=="__main__":
app.run(debug=True)