mirror of
https://github.com/kristoferssolo/Traffic-Light-Detector.git
synced 2026-03-22 00:36:22 +00:00
Moved paths.py
This commit is contained in:
@@ -3,21 +3,21 @@ from shutil import rmtree
|
|||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
|
BASE_PATH = Path(__file__).resolve().parent.parent.parent
|
||||||
BASE_PATH = Path(__file__).resolve().parent.parent
|
|
||||||
LOGS_PATH = BASE_PATH.joinpath(".logs")
|
LOGS_PATH = BASE_PATH.joinpath(".logs")
|
||||||
ASSETS_PATH = BASE_PATH.joinpath("assets")
|
ASSETS_PATH = BASE_PATH.joinpath("assets")
|
||||||
IMAGES_IN_PATH = ASSETS_PATH.joinpath("images_in")
|
IMAGES_IN_PATH = ASSETS_PATH.joinpath("images_in")
|
||||||
IMAGES_OUT_PATH = ASSETS_PATH.joinpath("images_out")
|
IMAGES_OUT_PATH = ASSETS_PATH.joinpath("images_out")
|
||||||
HAAR_PATH = ASSETS_PATH.joinpath("haar").joinpath("TrafficLights.xml")
|
HAAR_PATH = ASSETS_PATH.joinpath("haar").joinpath("TrafficLights.xml")
|
||||||
SOUND_PATH = ASSETS_PATH.joinpath("sound")
|
SOUND_PATH = ASSETS_PATH.joinpath("sound")
|
||||||
|
TESTS_PATH = BASE_PATH.joinpath("tests")
|
||||||
|
|
||||||
PATHS = (LOGS_PATH, IMAGES_IN_PATH, IMAGES_OUT_PATH, SOUND_PATH)
|
PATHS = (LOGS_PATH, IMAGES_IN_PATH, IMAGES_OUT_PATH, SOUND_PATH)
|
||||||
|
|
||||||
|
|
||||||
log_level = "DEBUG" if BASE_PATH.joinpath("debug").exists() else "INFO"
|
log_level = "DEBUG" if BASE_PATH.joinpath("debug").exists() else "INFO"
|
||||||
# Set up logging
|
# Set up logging
|
||||||
logger.add(LOGS_PATH.joinpath("detection.log"), format="{time} | {level} | {message}", level=log_level, rotation="10 MB", compression="zip")
|
logger.add(LOGS_PATH.joinpath("detection.log"), format="{time} | {level} | {message}", level=log_level, rotation="1 MB", compression="zip")
|
||||||
|
|
||||||
|
|
||||||
@logger.catch
|
@logger.catch
|
||||||
Reference in New Issue
Block a user