mirror of
https://github.com/alexhopeoconnor/frigate.git
synced 2026-10-04 03:18:11 +10:00
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:
@@ -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));
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user