From cb03489a97a77c6f27f256a06931593c985a47c6 Mon Sep 17 00:00:00 2001 From: baudneo <86508179+baudneo@users.noreply.github.com> Date: Thu, 31 Jul 2025 22:29:37 -0600 Subject: [PATCH] Add 'device' key to semantic search and face recognition. Modify LPR device key. --- frigate/config/classification.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/frigate/config/classification.py b/frigate/config/classification.py index 234113dd2..113eb2df7 100644 --- a/frigate/config/classification.py +++ b/frigate/config/classification.py @@ -130,6 +130,11 @@ class SemanticSearchConfig(FrigateBaseModel): model_size: str = Field( default="small", title="The size of the embeddings model used." ) + device: str = Field( + default="CPU", + title="The device to use for license plate recognition.", + description="Use 'cpu' or 'gpu', to target a specific gpu use: '0', '1', etc.", + ) class TriggerConfig(FrigateBaseModel): @@ -196,6 +201,11 @@ class FaceRecognitionConfig(FrigateBaseModel): blur_confidence_filter: bool = Field( default=True, title="Apply blur quality filter to face confidence." ) + device: str = Field( + default="CPU", + title="The device to use for license plate recognition.", + description="Use 'cpu' or 'gpu', to target a specific gpu use: '0', '1', etc.", + ) class CameraFaceRecognitionConfig(FrigateBaseModel): @@ -209,10 +219,6 @@ class CameraFaceRecognitionConfig(FrigateBaseModel): class LicensePlateRecognitionConfig(FrigateBaseModel): enabled: bool = Field(default=False, title="Enable license plate recognition.") - device: Optional[EnrichmentsDeviceEnum] = Field( - default=EnrichmentsDeviceEnum.CPU, - title="The device used for license plate recognition.", - ) model_size: str = Field( default="small", title="The size of the embeddings model used." ) @@ -258,6 +264,11 @@ class LicensePlateRecognitionConfig(FrigateBaseModel): default=False, title="Save plates captured for LPR for debugging purposes.", ) + device: str = Field( + default="CPU", + title="The device to use for license plate recognition.", + description="Use 'cpu' or 'gpu', to target a specific gpu use: '0', '1', etc.", + ) class CameraLicensePlateRecognitionConfig(FrigateBaseModel): @@ -278,4 +289,4 @@ class CameraLicensePlateRecognitionConfig(FrigateBaseModel): le=10, ) - model_config = ConfigDict(extra="forbid", protected_namespaces=()) + model_config = ConfigDict(extra="forbid", protected_namespaces=()) \ No newline at end of file