INNER CODE UNIT · Python
start_process
yihong1120/Construction-Hazard-Detection · main.py:446
def start_process(self, cfg: StreamConfig) -> Process:
"""Launch a new child process to handle stream detection.
Args:
cfg (StreamConfig): Configuration for the stream.
Returns:
Process: The new multiprocessing.Process object.
"""
if not self.yolo_worker_processes:
self._ensure_yolo_worker([cfg])
yolo_request_queue, yolo_result_queue = self._yolo_worker_slot(cfg)
p = Process(
target=process_single_stream,
args=(cfg, yolo_request_queue, yolo_result_queue),
)
p.start()
return p