mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-07 03:11:15 +03:00
Misc fixes (#19089)
* Correctly handle min_faces * Change to use recognized faces
This commit is contained in:
@@ -84,7 +84,7 @@ class FaceRecognitionConfig(FrigateBaseModel):
|
||||
default=1,
|
||||
gt=0,
|
||||
le=6,
|
||||
title="Min face attempts for the sub label to be applied to the person object.",
|
||||
title="Min face recognitions 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."
|
||||
|
||||
@@ -303,9 +303,6 @@ 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(
|
||||
@@ -489,6 +486,10 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
||||
|
||||
best_name = max(weighted_scores, key=weighted_scores.get)
|
||||
|
||||
# If the number of faces for this person < min_faces, we are not confident it is a correct result
|
||||
if counts[best_name] < self.face_config.min_faces:
|
||||
return None, 0.0
|
||||
|
||||
# If the best name has the same number of results as another name, we are not confident it is a correct result
|
||||
for name, count in counts.items():
|
||||
if name != best_name and counts[best_name] == count:
|
||||
|
||||
Reference in New Issue
Block a user