From 575494a091b7fcfe14a18113db60690d0324c747 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 10 Jul 2024 07:23:09 -0600 Subject: [PATCH] Fix case where thumbnail is saved without frame --- frigate/object_processing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frigate/object_processing.py b/frigate/object_processing.py index 55a4d08f8..3616d6b50 100644 --- a/frigate/object_processing.py +++ b/frigate/object_processing.py @@ -147,7 +147,7 @@ class TrackedObject: """get median of scores for object.""" return median(self.score_history) - def update(self, current_frame_time, obj_data): + def update(self, current_frame_time: float, obj_data, has_valid_frame: bool): thumb_update = False significant_change = False autotracker_update = False @@ -168,7 +168,7 @@ class TrackedObject: self.false_positive = self._is_false_positive() self.active = self.is_active() - if not self.false_positive: + if not self.false_positive and has_valid_frame: # determine if this frame is a better thumbnail if self.thumbnail_data is None or is_better_thumbnail( self.obj_data["label"], @@ -699,7 +699,7 @@ class CameraState: for id in updated_ids: updated_obj = tracked_objects[id] thumb_update, significant_update, autotracker_update = updated_obj.update( - frame_time, current_detections[id] + frame_time, current_detections[id], current_frame is not None ) if autotracker_update or significant_update: