mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-16 16:15:22 +03:00
Add min area config
This commit is contained in:
parent
cb72992e74
commit
0c5d4c7319
@ -12,6 +12,9 @@ class FaceRecognitionConfig(FrigateBaseModel):
|
|||||||
threshold: float = Field(
|
threshold: float = Field(
|
||||||
default=0.8, title="Face similarity score required to be considered a match."
|
default=0.8, title="Face similarity score required to be considered a match."
|
||||||
)
|
)
|
||||||
|
min_area: int = Field(
|
||||||
|
default=1000, title="Min area of face box to consider running face recognition."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class SemanticSearchConfig(FrigateBaseModel):
|
class SemanticSearchConfig(FrigateBaseModel):
|
||||||
|
|||||||
@ -26,7 +26,7 @@ from frigate.events.types import EventTypeEnum
|
|||||||
from frigate.genai import get_genai_client
|
from frigate.genai import get_genai_client
|
||||||
from frigate.models import Event
|
from frigate.models import Event
|
||||||
from frigate.util.builtin import serialize
|
from frigate.util.builtin import serialize
|
||||||
from frigate.util.image import SharedMemoryFrameManager, calculate_region
|
from frigate.util.image import SharedMemoryFrameManager, calculate_region, area
|
||||||
|
|
||||||
from .embeddings import Embeddings
|
from .embeddings import Embeddings
|
||||||
|
|
||||||
@ -317,7 +317,8 @@ class EmbeddingMaintainer(threading.Thread):
|
|||||||
|
|
||||||
face_box = face.get("box")
|
face_box = face.get("box")
|
||||||
|
|
||||||
if not face_box:
|
# check that face is valid
|
||||||
|
if not face_box or area(face_box) < self.config.semantic_search.face_recognition.min_area:
|
||||||
return
|
return
|
||||||
|
|
||||||
face_frame = cv2.cvtColor(frame, cv2.COLOR_YUV2BGR_I420)
|
face_frame = cv2.cvtColor(frame, cv2.COLOR_YUV2BGR_I420)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user