Add ability to configure when custom classification models run (#18380)

* Add config to control when classification models are run

* Cleanup
This commit is contained in:
Nicolas Mowen
2025-08-16 10:20:33 -05:00
committed by Blake Blackshear
parent 53ff33135b
commit 723553edb7
3 changed files with 65 additions and 10 deletions
+12
View File
@@ -38,12 +38,24 @@ class CustomClassificationStateCameraConfig(FrigateBaseModel):
crop: list[int, int, int, int] = Field(
title="Crop of image frame on this camera to run classification on."
)
threshold: float = Field(
default=0.8, title="Classification score threshold to change the state."
)
class CustomClassificationStateConfig(FrigateBaseModel):
cameras: Dict[str, CustomClassificationStateCameraConfig] = Field(
title="Cameras to run classification on."
)
motion: bool = Field(
default=False,
title="If classification should be run when motion is detected in the crop.",
)
interval: int | None = Field(
default=None,
title="Interval to run classification on in seconds.",
gt=0,
)
class CustomClassificationObjectConfig(FrigateBaseModel):