Exemplo n.º 1
0
    def __init__(self):
        self.__itsDB = LocalDB()
        self.__isOnlineDB = False
        self.__itsKeyMap = dict()
        self.__isFilterChanged = False
        self.__itsFilteredHeader = []
        self.__itsFilteredData = []
        self.__itsSCFLength = 15

        pass
Exemplo n.º 2
0
 def changeLocalDB(self):
     if self.__isOnlineDB:
         self.__itsDB = LocalDB()
         self.__isFilterChanged = False
         self.__isOnlineDB = False
     pass
Exemplo n.º 3
0
import detect
from PIL import Image
import tflite_runtime.interpreter as tflite
import platform

from alert_encoder import create_alert
from db import LocalDB, persist_alert

ON_DEVICE: bool = True  # Whether we're on the development machine (ON_DEVICE=False), or on the Pi (ON_DEVICE=True)
SLEEP_TIME: int = 1  # second

camera = PiCamera()
camera.rotation = 180  # in degrees, adjust based on your setup

db = LocalDB()

EDGETPU_SHARED_LIB = {
    "Linux": "libedgetpu.so.1",
    "Darwin": "libedgetpu.1.dylib",
    "Windows": "edgetpu.dll",
}[platform.system()]

cur_dir: str = sys.path[0]
CONFIG_PATH: str = os.path.join(cur_dir, "config.yaml")
with open(CONFIG_PATH, "r") as f:
    operational_config = yaml.safe_load(f)
if "device" not in operational_config:
    raise Exception("Failed to load configuration")

DATE_FORMAT: str = "%Y-%m-%d %H:%M:%S.%f"