Add more vehicle types to default attribute map (#24097)

* run lpr on more vehicle types by default

before, a config change to attribute_map was required

* logging tweaks

* remove arg

* use attributes for frontend check

* docs

* only check thumbnail attributes the object can have
This commit is contained in:
Josh Hawkins
2026-08-26 08:23:15 -06:00
committed by GitHub
parent 18c77faea5
commit 5197881ef7
9 changed files with 47 additions and 46 deletions
+1 -1
View File
@@ -1948,7 +1948,7 @@
},
"lpr": {
"globalDisabled": "The license plate recognition enrichment must be enabled for LPR features to function on this camera.",
"vehicleNotTracked": "License plate recognition requires 'car' or 'motorcycle' to be tracked. Enable 'car' or 'motorcycle' in Objects for this camera.",
"vehicleNotTracked": "License plate recognition requires a vehicle to be tracked. Enable 'car' or another vehicle type in Objects for this camera.",
"modelSizeLarge": "The 'large' model is optimized for multi-line license plates. The 'small' model provides better performance over 'large' and should be used unless your region uses multi-line plate formats."
},
"record": {
@@ -21,7 +21,12 @@ const lpr: SectionConfigOverrides = {
if (ctx.level !== "camera" || !ctx.fullCameraConfig) return false;
if (ctx.fullCameraConfig.type === "lpr") return false;
const tracked = ctx.fullCameraConfig.objects?.track ?? [];
return !tracked.some((o) => ["car", "motorcycle"].includes(o));
const vehicles = Object.entries(
ctx.fullConfig.model?.attributes_map ?? {},
)
.filter(([, attributes]) => attributes.includes("license_plate"))
.map(([label]) => label);
return !tracked.some((o) => vehicles.includes(o));
},
},
],