From 918112a7930b6026b34f8cb877c0c7fb36ec0209 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Fri, 10 Apr 2020 07:05:07 -0400 Subject: [PATCH] ensure the previous frame is deleted when the new one is stored --- frigate/object_processing.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frigate/object_processing.py b/frigate/object_processing.py index 80bcbfd46..63297b6f1 100644 --- a/frigate/object_processing.py +++ b/frigate/object_processing.py @@ -83,14 +83,13 @@ class TrackedObjectProcessor(threading.Thread): cv2.putText(current_frame, time_to_show, (10, 30), cv2.FONT_HERSHEY_SIMPLEX, fontScale=.8, color=(255, 255, 255), thickness=2) ### - # Set the current frame as ready + # Set the current frame ### self.camera_data[camera]['current_frame'] = current_frame - # store the object id, so you can delete it at the next loop - previous_object_id = f"{camera}{frame_time}" - if not previous_object_id is None: - self.plasma_client.delete(f"{camera}{frame_time}") + # delete the previous frame from the plasma store and update the object id + if not self.camera_data[camera]['object_id'] is None: + self.plasma_client.delete(self.camera_data[camera]['object_id']) self.camera_data[camera]['object_id'] = f"{camera}{frame_time}" ###