Преглед изворни кода

fix shared memory store usage for events

Blake Blackshear пре 4 година
родитељ
комит
7e92e8bfe8
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4 4
      detect_objects.py

+ 4 - 4
detect_objects.py

@@ -173,12 +173,12 @@ def main():
     event_queue = mp.Queue()
 
     # create the detection pipes
-    detection_pipes = {}
+    out_events = {}
     for name in CONFIG['cameras'].keys():
-        detection_pipes[name] = mp.Pipe(duplex=False)
+        out_events[name] = mp.Event()
     
     # Start the shared tflite process
-    tflite_process = EdgeTPUProcess(result_connections={ key:value[1] for (key,value) in detection_pipes.items() }, tf_device=TENSORFLOW_DEVICE)
+    tflite_process = EdgeTPUProcess(out_events=out_events, tf_device=TENSORFLOW_DEVICE)
 
     # create the camera processes
     camera_processes = {}
@@ -264,7 +264,7 @@ def main():
         }
 
         camera_process = mp.Process(target=track_camera, args=(name, config, frame_queue, frame_shape,
-            tflite_process.detection_queue, detection_pipes[name][0], tracked_objects_queue, camera_processes[name]['process_fps'], 
+            tflite_process.detection_queue, out_events[name], tracked_objects_queue, camera_processes[name]['process_fps'], 
             camera_processes[name]['detection_fps'], 
             camera_processes[name]['read_start'], camera_processes[name]['detection_frame'], stop_event))
         camera_process.daemon = True