mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-07 03:11:15 +03:00
Min face configuration option (#18284)
* Add option to specify minimum face attempts for an object * Set upper bound
This commit is contained in:
@@ -80,6 +80,12 @@ class FaceRecognitionConfig(FrigateBaseModel):
|
||||
min_area: int = Field(
|
||||
default=750, title="Min area of face box to consider running face recognition."
|
||||
)
|
||||
min_faces: int = Field(
|
||||
default=1,
|
||||
gt=0,
|
||||
le=6,
|
||||
title="Min face attempts for the sub label to be applied to the person object.",
|
||||
)
|
||||
save_attempts: int = Field(
|
||||
default=100, ge=0, title="Number of face attempts to save in the train tab."
|
||||
)
|
||||
|
||||
@@ -302,6 +302,9 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
||||
self.person_face_history[id]
|
||||
)
|
||||
|
||||
if len(self.person_face_history[id]) < self.face_config.min_faces:
|
||||
weighted_sub_label = "unknown"
|
||||
|
||||
self.requestor.send_data(
|
||||
"tracked_object_update",
|
||||
json.dumps(
|
||||
|
||||
Reference in New Issue
Block a user