Commit 6c9d08c2 authored by Yomal-Dulanjana's avatar Yomal-Dulanjana

app.py File create and DB connection setup

parent cc2d77fd
from inference import *
from flask_cors import CORS
from flask import Flask, Response, request
from pymongo import MongoClient
import threading
import requests
import schedule
import time
import random
from datetime import datetime
app = Flask(__name__)
CORS(app)
def risk():
risk_level, HeartRateArr, BloodOxygenLevelArr, BodyTemperatureArr = risk_level_prediction()
print(risk_level)
def update_risk_level():
while True:
risk()
time.sleep(120)
thread1 = threading.Thread(target=update_risk_level)
thread1.start()
print("test")
if __name__ == "__main__":
app.run(
debug=True,
host='0.0.0.0',
port=5000,
threaded=False,
use_reloader=True
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment