Classification config changes (#17892)

* Only auto-populate some config fields down to the camera level

- Don't populate LPR and face global-only settings down to the camera level
- Ensure LPR mixin uses camera level min_area
- Explicitly forbid extra config values for LPR and face

* lpr docs tweak

* remove extra text already in i18n key

* consistency
This commit is contained in:
Josh Hawkins
2025-04-24 08:30:10 -05:00
committed by GitHub
parent eb4433162c
commit 2610cfcfde
5 changed files with 25 additions and 13 deletions

View File

@@ -1221,7 +1221,7 @@ class LicensePlateProcessingMixin:
license_plate_area = (license_plate[2] - license_plate[0]) * (
license_plate[3] - license_plate[1]
)
if license_plate_area < self.lpr_config.min_area:
if license_plate_area < self.config.cameras[camera].lpr.min_area:
logger.debug(f"{camera}: License plate area below minimum threshold.")
return
@@ -1315,10 +1315,7 @@ 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.config.cameras[obj_data["camera"]].lpr.min_area * 2
):
if license_plate_area < self.config.cameras[camera].lpr.min_area * 2:
logger.debug(f"{camera}: License plate is less than min_area")
return
@@ -1362,10 +1359,10 @@ class LicensePlateProcessingMixin:
if (
not license_plate_box
or area(license_plate_box)
< self.config.cameras[obj_data["camera"]].lpr.min_area
< self.config.cameras[camera].lpr.min_area
):
logger.debug(
f"{camera}: Area for license plate box {area(license_plate_box)} is less than min_area {self.config.cameras[obj_data['camera']].lpr.min_area}"
f"{camera}: Area for license plate box {area(license_plate_box)} is less than min_area {self.config.cameras[camera].lpr.min_area}"
)
return