-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
36 lines (28 loc) · 919 Bytes
/
main.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
# Goal: detect drowsiness in students during online learning. can be extrapolated to detecting drowsiness in real time.
import os
from video import VideoRecorder
from flask import Flask, render_template, request
import time
global recording
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html')
@app.route('/video_start')
def video_start():
recording = VideoRecorder()
recording.video_processing()
print(recording.get_totals())
return render_template('results.html', totals = recording.get_totals())
""" @app.route('/video_stop')
def video_stop():
# load buffer
time.sleep(0.5)
totals = {}
totals = recording.get_totals()
del recording
return render_template('results.html', totals = totals) """
if __name__ == "__main__":
port = int(os.environ.get("PORT", 5000))
app.run(host='localhost', port=port)