diff --git a/frigate/config/classification.py b/frigate/config/classification.py index 06e69a774..96b09d2b7 100644 --- a/frigate/config/classification.py +++ b/frigate/config/classification.py @@ -19,11 +19,6 @@ class SemanticSearchModelEnum(str, Enum): jinav2 = "jinav2" -class LPRDeviceEnum(str, Enum): - GPU = "GPU" - CPU = "CPU" - - class BirdClassificationConfig(FrigateBaseModel): enabled: bool = Field(default=False, title="Enable bird classification.") threshold: float = Field( @@ -52,6 +47,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 FaceRecognitionConfig(FrigateBaseModel): @@ -92,6 +92,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): @@ -105,10 +110,6 @@ class CameraFaceRecognitionConfig(FrigateBaseModel): class LicensePlateRecognitionConfig(FrigateBaseModel): enabled: bool = Field(default=False, title="Enable license plate recognition.") - device: Optional[LPRDeviceEnum] = Field( - default=LPRDeviceEnum.CPU, - title="The device used for license plate recognition.", - ) model_size: str = Field( default="small", title="The size of the embeddings model used." ) @@ -154,6 +155,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): @@ -174,4 +180,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