a b/deviceCode/Inference/initiation.py
1
import os
2
import inference
3
from flask import Flask, render_template
4
5
app = Flask(__name__)
6
7
@app.route('/')
8
def index():
9
  return render_template('index.html')
10
11
@app.route('/my-link/')
12
def my_link():
13
  # start the inference phase
14
  result = inference.initiate()
15
  if(result):
16
      data = [{'result': result}]
17
      #return result containing the detected emotion
18
      return render_template('result.html', data=data)
19
20
if __name__ == '__main__':
21
  app.run(host=os.getenv('IP', '0.0.0.0'),
22
            port=int(os.getenv('PORT', 4444)),debug=True)