-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
28 lines (22 loc) · 912 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
import utils
from connection import IdleReporter, ImageHTTPExtractor, ModelPredictionsReceiver
from confs import configs
from dotenv import load_dotenv
from IdleAlgorithm import IdleAlgorithm
import os
import numpy as np
password = os.environ.get("password")
if password is None:
load_dotenv("confs/settings.env")
password = os.environ.get("password")
username = os.environ.get("username")
server_url = os.environ.get("server_url")
camera_ip = os.environ.get("camera_url")
folder = os.environ.get("folder")
logger = utils.create_logger()
prev_preds = np.array([[]]).astype(np.float32)
reporter = IdleReporter(folder, server_url, configs["wait_time"], logger)
image_extractor = ImageHTTPExtractor(camera_ip, logger, username=username, password=password)
model_predictor = ModelPredictionsReceiver(server_url, logger)
algo = IdleAlgorithm(logger, image_extractor, model_predictor, reporter)
algo.start()