From f2975c962c7d3fd1c7d2d0200150e13639f7ed99 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 19 Mar 2025 20:27:08 -0600 Subject: [PATCH] Fix per camera config --- frigate/config/config.py | 2 ++ frigate/data_processing/common/license_plate/mixin.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frigate/config/config.py b/frigate/config/config.py index f77a83f28..c27cd365d 100644 --- a/frigate/config/config.py +++ b/frigate/config/config.py @@ -437,6 +437,8 @@ class FrigateConfig(FrigateBaseModel): include={ "audio": ..., "birdseye": ..., + "face_recognition": ..., + "lpr": ..., "record": ..., "snapshots": ..., "live": ..., diff --git a/frigate/data_processing/common/license_plate/mixin.py b/frigate/data_processing/common/license_plate/mixin.py index c07163819..52f59e71a 100644 --- a/frigate/data_processing/common/license_plate/mixin.py +++ b/frigate/data_processing/common/license_plate/mixin.py @@ -844,6 +844,8 @@ class LicensePlateProcessingMixin: def lpr_process(self, obj_data: dict[str, any], frame: np.ndarray): """Look for license plates in image.""" + if not self.config.cameras[obj_data["camera"]].lpr.enabled: + return id = obj_data["id"] @@ -910,7 +912,10 @@ class LicensePlateProcessingMixin: # check that license plate is valid # double the value because we've doubled the size of the car - if license_plate_area < self.lpr_config.min_area * 2: + if ( + license_plate_area + < self.config.cameras[obj_data["camera"]].lpr.min_area * 2 + ): logger.debug("License plate is less than min_area") return @@ -942,7 +947,8 @@ class LicensePlateProcessingMixin: # check that license plate is valid if ( not license_plate_box - or area(license_plate_box) < self.lpr_config.min_area + or area(license_plate_box) + < self.config.cameras[obj_data["camera"]].lpr.min_area ): logger.debug(f"Invalid license plate box {license_plate}") return