From 838f246b0623b93717057a4f57ea9e8697262fdd Mon Sep 17 00:00:00 2001 From: Sergey Krashevich Date: Thu, 15 Jun 2023 04:08:16 +0300 Subject: [PATCH] Revert "Set default detect dimensions to 1280x720 and update DetectConfig to use the defaults" This reverts commit a1aed0414d75a6db0a826c08359740764c4861e5. --- frigate/config.py | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/frigate/config.py b/frigate/config.py index af6f01466..48e785c53 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -44,7 +44,6 @@ FRIGATE_ENV_VARS = {k: v for k, v in os.environ.items() if k.startswith("FRIGATE DEFAULT_TRACKED_OBJECTS = ["person"] DEFAULT_DETECTORS = {"cpu": {"type": "cpu"}} -DEFAULT_DETECT_DIMENSIONS = {"width": 1280, "height": 720} class FrigateBaseModel(BaseModel): @@ -269,14 +268,8 @@ class StationaryConfig(FrigateBaseModel): class DetectConfig(FrigateBaseModel): autoconf: bool = Field(default=True, title="Auto detect height, width and fps.") - height: int = Field( - default=DEFAULT_DETECT_DIMENSIONS["height"], - title="Height of the stream for the detect role.", - ) - width: int = Field( - default=DEFAULT_DETECT_DIMENSIONS["width"], - title="Width of the stream for the detect role.", - ) + height: int = Field(default=720, title="Height of the stream for the detect role.") + width: int = Field(default=1280, title="Width of the stream for the detect role.") fps: int = Field( default=5, title="Number of frames per second to process through detection." ) @@ -679,20 +672,8 @@ class CameraConfig(FrigateBaseModel): config["ffmpeg"]["inputs"][0]["roles"].append("rtmp") for input in config["ffmpeg"]["inputs"]: - if ( - "detect" in config - and config["detect"].get("autoconf") - and ("detect" in input.get("roles", [])) - and ( - config["detect"].get("height") is None - or config["detect"].get("width") is None - or ( - config["detect"].get("height") - == DEFAULT_DETECT_DIMENSIONS["height"] - and config["detect"].get("width") - == DEFAULT_DETECT_DIMENSIONS["width"] - ) - ) + if config["detect"].get("autoconf") and ( + "detect" in input.get("roles", []) ): try: streamInfo = get_video_properties(input.get("path"))