mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-26 13:48:59 +03:00
Fixes (#18139)
* Catch error and show toast when failing to delete review items * i18n keys * add link to speed estimation docs in zone edit pane * Implement reset of tracked object update for each camera * Cleanup * register mqtt callbacks for toggling alerts and detections * clarify snapshots docs * clarify semantic search reindexing * add ukrainian * adjust date granularity for last recording time The api endpoint only returns granularity down to the day * Add amd hardware * fix crash in face library on initial start after enabling * Fix recordings view for mobile landscape The events view incorrectly was displaying two columns on landscape view and it only took up 20% of the screen width. Additionally, in landscape view the timeline was too wide (especially on iPads of various screen sizes) and would overlap the main video * face rec overfitting instructions * Clarify * face docs * clarify * clarify --------- Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
This commit is contained in:
co-authored by
Nicolas Mowen
parent
8094dd4075
commit
f39ddbc00d
@@ -54,6 +54,7 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
||||
self.face_detector: cv2.FaceDetectorYN = None
|
||||
self.requires_face_detection = "face" not in self.config.objects.all_objects
|
||||
self.person_face_history: dict[str, list[tuple[str, float, int]]] = {}
|
||||
self.camera_current_people: dict[str, list[str]] = {}
|
||||
self.recognizer: FaceRecognizer | None = None
|
||||
self.faces_per_second = EventsPerSecond()
|
||||
self.inference_speed = InferenceSpeed(self.metrics.face_rec_speed)
|
||||
@@ -282,9 +283,13 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
||||
if id not in self.person_face_history:
|
||||
self.person_face_history[id] = []
|
||||
|
||||
if camera not in self.camera_current_people:
|
||||
self.camera_current_people[camera] = []
|
||||
|
||||
self.person_face_history[id].append(
|
||||
(sub_label, score, face_frame.shape[0] * face_frame.shape[1])
|
||||
)
|
||||
self.camera_current_people[camera].append(id)
|
||||
(weighted_sub_label, weighted_score) = self.weighted_average(
|
||||
self.person_face_history[id]
|
||||
)
|
||||
@@ -420,10 +425,25 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
||||
)
|
||||
shutil.move(current_file, new_file)
|
||||
|
||||
def expire_object(self, object_id: str):
|
||||
def expire_object(self, object_id: str, camera: str):
|
||||
if object_id in self.person_face_history:
|
||||
self.person_face_history.pop(object_id)
|
||||
|
||||
if object_id in self.camera_current_people.get(camera, []):
|
||||
self.camera_current_people[camera].remove(object_id)
|
||||
|
||||
if len(self.camera_current_people[camera]) == 0:
|
||||
self.requestor.send_data(
|
||||
"tracked_object_update",
|
||||
json.dumps(
|
||||
{
|
||||
"type": TrackedObjectUpdateTypesEnum.face,
|
||||
"name": None,
|
||||
"camera": camera,
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
def weighted_average(
|
||||
self, results_list: list[tuple[str, float, int]], max_weight: int = 4000
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user