2024-10-26 19:07:45 +02:00
|
|
|
from typing import Dict, List, Optional
|
2024-09-28 21:21:42 +02:00
|
|
|
|
|
|
|
from pydantic import Field
|
|
|
|
|
|
|
|
from .base import FrigateBaseModel
|
|
|
|
|
2024-10-26 19:07:45 +02:00
|
|
|
__all__ = [
|
|
|
|
"FaceRecognitionConfig",
|
|
|
|
"SemanticSearchConfig",
|
|
|
|
"LicensePlateRecognitionConfig",
|
|
|
|
]
|
2024-10-23 00:05:48 +02:00
|
|
|
|
|
|
|
|
2024-09-28 21:21:42 +02:00
|
|
|
class SemanticSearchConfig(FrigateBaseModel):
|
|
|
|
enabled: bool = Field(default=False, title="Enable semantic search.")
|
|
|
|
reindex: Optional[bool] = Field(
|
|
|
|
default=False, title="Reindex all detections on startup."
|
|
|
|
)
|
2024-10-11 00:46:21 +02:00
|
|
|
model_size: str = Field(
|
|
|
|
default="small", title="The size of the embeddings model used."
|
|
|
|
)
|
2024-10-23 17:03:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
class FaceRecognitionConfig(FrigateBaseModel):
|
|
|
|
enabled: bool = Field(default=False, title="Enable face recognition.")
|
|
|
|
threshold: float = Field(
|
2024-11-21 20:59:43 +01:00
|
|
|
default=170, title="minimum face distance score required to be considered a match."
|
2024-10-23 17:03:18 +02:00
|
|
|
)
|
|
|
|
min_area: int = Field(
|
|
|
|
default=500, title="Min area of face box to consider running face recognition."
|
|
|
|
)
|
2024-10-26 19:07:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
class LicensePlateRecognitionConfig(FrigateBaseModel):
|
|
|
|
enabled: bool = Field(default=False, title="Enable license plate recognition.")
|
|
|
|
threshold: float = Field(
|
|
|
|
default=0.9,
|
|
|
|
title="License plate confidence score required to be added to the object as a sub label.",
|
|
|
|
)
|
|
|
|
min_area: int = Field(
|
|
|
|
default=500,
|
|
|
|
title="Min area of license plate to consider running license plate recognition.",
|
|
|
|
)
|
|
|
|
known_plates: Optional[Dict[str, List[str]]] = Field(
|
|
|
|
default={}, title="Known plates to track."
|
|
|
|
)
|