-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
36 lines (29 loc) · 879 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
from connection import ImageCapture
from min_max_utils.min_max_utils import create_logger
import warnings
import os
from dotenv import load_dotenv
from MinMaxAlgorithm import MinMaxAlgorithm
import json
warnings.filterwarnings("ignore")
if os.environ.get("extra") is None:
load_dotenv("confs/settings.env")
extra: str = os.environ.get("extra")
extra = json.loads(extra)[0]
areas = extra.get("areas")
zones = extra.get("zones")
username = os.environ.get("username")
password = os.environ.get("password")
server_url = os.environ.get("server_url")
camera_url = os.environ.get("camera_url")
folder = os.environ.get("folder")
logger = create_logger()
dataset = ImageCapture(
camera_url,
username=username,
password=password,
logger=logger,
server_url=server_url
)
algo = MinMaxAlgorithm(dataset, logger, areas, folder, server_url, zones)
algo.start()