From 169603d3ff7a656cea22c650b3b5e7d15ee92737 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Thu, 16 Jan 2020 17:32:01 -0600 Subject: [PATCH] attempt to fix regions in process key error --- frigate/objects.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/frigate/objects.py b/frigate/objects.py index eb3816801..b4e7969ef 100644 --- a/frigate/objects.py +++ b/frigate/objects.py @@ -93,12 +93,15 @@ class DetectedObjectsProcessor(threading.Thread): self.camera.detected_objects[frame['frame_time']].append(obj) with self.camera.regions_in_process_lock: - self.camera.regions_in_process[frame['frame_time']] -= 1 + if frame['frame_time'] in self.camera.regions_in_process: + self.camera.regions_in_process[frame['frame_time']] -= 1 # print(f"{frame['frame_time']} remaining regions {self.camera.regions_in_process[frame['frame_time']]}") - if self.camera.regions_in_process[frame['frame_time']] == 0: - del self.camera.regions_in_process[frame['frame_time']] - # print(f"{frame['frame_time']} no remaining regions") + if self.camera.regions_in_process[frame['frame_time']] == 0: + del self.camera.regions_in_process[frame['frame_time']] + # print(f"{frame['frame_time']} no remaining regions") + self.camera.finished_frame_queue.put(frame['frame_time']) + else: self.camera.finished_frame_queue.put(frame['frame_time']) # Thread that checks finished frames for clipped objects and sends back