Update process_frames function to handle full queue by dropping frames and logging the details of the queue size and data size

This commit is contained in:
Sergey Krashevich 2023-07-08 08:53:50 +03:00
parent 1e766749e4
commit 6ede4c0a59
No known key found for this signature in database
GPG Key ID: 625171324E7D3856
4 changed files with 4 additions and 4 deletions

View File

@ -209,7 +209,7 @@ class RemoteObjectDetector:
# copy input to shared memory
self.np_shm[:] = tensor_input[:]
self.event.clear()
self.detection_queue.put(self.name)
self.detection_queue.put_nowait(self.name)
result = self.event.wait(timeout=5.0)
# if it timed out

View File

@ -1070,7 +1070,7 @@ class TrackedObjectProcessor(threading.Thread):
o.to_dict() for o in camera_state.tracked_objects.values()
]
self.video_output_queue.put(
self.video_output_queue.put_nowait(
(
camera,
frame_time,

View File

@ -1040,7 +1040,7 @@ def process_frames(
else:
fps_tracker.update()
fps.value = fps_tracker.eps()
detected_objects_queue.put(
detected_objects_queue.put_nowait(
(
camera_name,
frame_time,

View File

@ -152,7 +152,7 @@ class ProcessClip:
current_tracked_objects,
motion_boxes,
regions,
) = self.detected_objects_queue.get()
) = self.detected_objects_queue.get_nowait()
if debug_path:
self.save_debug_frame(