mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-31 13:48:19 +02:00
0.17 tweaks (#18892)
* Set version * Cleanup more logs * Don't log matplotlib
This commit is contained in:
parent
d414452333
commit
4080220aa6
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
|||||||
default_target: local
|
default_target: local
|
||||||
|
|
||||||
COMMIT_HASH := $(shell git log -1 --pretty=format:"%h"|tail -1)
|
COMMIT_HASH := $(shell git log -1 --pretty=format:"%h"|tail -1)
|
||||||
VERSION = 0.16.1
|
VERSION = 0.17.0
|
||||||
IMAGE_REPO ?= ghcr.io/blakeblackshear/frigate
|
IMAGE_REPO ?= ghcr.io/blakeblackshear/frigate
|
||||||
GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
|
GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
BOARDS= #Initialized empty
|
BOARDS= #Initialized empty
|
||||||
|
@ -13,6 +13,7 @@ from frigate.comms.event_metadata_updater import (
|
|||||||
)
|
)
|
||||||
from frigate.config import FrigateConfig
|
from frigate.config import FrigateConfig
|
||||||
from frigate.const import MODEL_CACHE_DIR
|
from frigate.const import MODEL_CACHE_DIR
|
||||||
|
from frigate.log import redirect_output_to_logger
|
||||||
from frigate.util.object import calculate_region
|
from frigate.util.object import calculate_region
|
||||||
|
|
||||||
from ..types import DataProcessorMetrics
|
from ..types import DataProcessorMetrics
|
||||||
@ -76,6 +77,7 @@ class BirdRealTimeProcessor(RealTimeProcessorApi):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Failed to download {path}: {e}")
|
logger.error(f"Failed to download {path}: {e}")
|
||||||
|
|
||||||
|
@redirect_output_to_logger(logger, logging.DEBUG)
|
||||||
def __build_detector(self) -> None:
|
def __build_detector(self) -> None:
|
||||||
self.interpreter = Interpreter(
|
self.interpreter = Interpreter(
|
||||||
model_path=os.path.join(MODEL_CACHE_DIR, "bird/bird.tflite"),
|
model_path=os.path.join(MODEL_CACHE_DIR, "bird/bird.tflite"),
|
||||||
|
@ -80,6 +80,7 @@ def apply_log_levels(default: str, log_levels: dict[str, LogLevel]) -> None:
|
|||||||
log_levels = {
|
log_levels = {
|
||||||
"absl": LogLevel.error,
|
"absl": LogLevel.error,
|
||||||
"httpx": LogLevel.error,
|
"httpx": LogLevel.error,
|
||||||
|
"matplotlib": LogLevel.error,
|
||||||
"tensorflow": LogLevel.error,
|
"tensorflow": LogLevel.error,
|
||||||
"werkzeug": LogLevel.error,
|
"werkzeug": LogLevel.error,
|
||||||
"ws4py": LogLevel.error,
|
"ws4py": LogLevel.error,
|
||||||
@ -193,7 +194,7 @@ class LogRedirect(io.StringIO):
|
|||||||
|
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def redirect_fd_to_queue(queue: Queue[str]) -> Generator[None, None, None]:
|
def __redirect_fd_to_queue(queue: Queue[str]) -> Generator[None, None, None]:
|
||||||
"""Redirect file descriptor 1 (stdout) to a pipe and capture output in a queue."""
|
"""Redirect file descriptor 1 (stdout) to a pipe and capture output in a queue."""
|
||||||
stdout_fd = os.dup(1)
|
stdout_fd = os.dup(1)
|
||||||
read_fd, write_fd = os.pipe()
|
read_fd, write_fd = os.pipe()
|
||||||
@ -249,7 +250,7 @@ def redirect_output_to_logger(logger: logging.Logger, level: int) -> Any:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Redirect C-level stdout
|
# Redirect C-level stdout
|
||||||
with redirect_fd_to_queue(queue):
|
with __redirect_fd_to_queue(queue):
|
||||||
result = func(*args, **kwargs)
|
result = func(*args, **kwargs)
|
||||||
finally:
|
finally:
|
||||||
# Restore Python stdout/stderr
|
# Restore Python stdout/stderr
|
||||||
|
Loading…
Reference in New Issue
Block a user