I’m currently working with a Raspberry Pi 5 combined with a Hailo-8 AI HAT+, and I need to run two cameras simultaneously, each using a different AI model (e.g., YOLOv6n + YOLOv8s). My goal:
Camera 1 runs model A
Camera 2 runs model B
Both run in real-time, in parallel, using the Hailo NPU for inference
I’ve found relevant code in the hailo-rpi5-examples repository (e.g., detection.py, multi_detection), and I’m able to detect both cameras. However, I’m not sure how to configure two parallel pipelines, each with a different model. Should I launch them in separate processes, or is there a recommended way to manage both in a single application?
My current setup:
2 USB camera
Hailo SDK on Raspberry Pi 5
GStreamer pipelines using hailonet, hailofilter, hailooverlay, etc.
Models: YOLOv6n, YOLOv8s (.hef format)
Has anyone successfully run a similar multi-camera, multi-model pipeline using the Hailo SDK on RPi5? Any documentation, code samples, or tips would be greatly appreciated!
Hi @shashi
Thank you for your response and guidance. I followed your instructions with the code below; however, when I run it, two windows appear showing the two camera USB streams, but they immediately freeze and no frames are captured. The process stops right away, and CPU usage spikes to over 200%. I’m not sure where the issue lies. I’m using a Raspberry Pi 5 with 8GB RAM and a Hailo-8 (26 TOPS). I would greatly appreciate your feedback so that I can continue my research and further development. Here is my code:
import degirum as dg
import degirum_tools.streams as dgstreams
inference_host_address = “@local”
zoo_url = “degirum/models_hailort”
token = ‘’
configurations = [
{
“model_name”: “yolov8n_relu6_coco–640x640_quant_hailort_hailo8_1”,
“source”: 2,
“display_name”: “USB cam 1”,
},
{
“model_name”: “yolov8n_relu6_face–640x640_quant_hailort_hailo8_1”,
“source”: 0,
“display_name”: “USB cam 2”,
},
]
models = [
dg.load_model(cfg[“model_name”], inference_host_address, zoo_url, token)
for cfg in configurations
]
sources = [dgstreams.VideoSourceGizmo(cfg[“source”]) for cfg in configurations]
detectors = [dgstreams.AiSimpleGizmo(model) for model in models]
display = dgstreams.VideoDisplayGizmo(
[cfg[“display_name”] for cfg in configurations], show_ai_overlay=True, show_fps=True
)
pipeline = (
(source >> detector for source, detector in zip(sources, detectors)),
(detector >> display[di] for di, detector in enumerate(detectors)),
)
dgstreams.Composition(*pipeline).start()
Hi @omria,
Sorry for the late reply. I’m currently experimenting with using 5 USB cameras with 5 different models on a Raspberry Pi 5 with AI HAT+ for my project. For now, I’m starting with 2 cameras and 2 models to observe performance. I’m not sure if the 26 TOPS from the AI HAT+ and the 8GB RAM of the Pi 5 will be enough to handle it. Thank you for your attention. If you have any information related to running multiple cameras and models simultaneously, please share it with me. Thank you!
Hi @shashi
This is a great solution—thank you very much for your enthusiastic support. The code works as intended, but after running for a while, it stops and throws the error: “[HailoRT] [critical] Executing pipeline terminate failed with status HAILO_RPC_FAILED(77)”.
I’m not sure how to resolve this issue on the Pi 5 with 8GB RAM and AI HAT+ (26 TOPS). I would really appreciate your feedback. Thank you!
Hi @The_Nguyen
Glad to hear it is working for you. Regarding crashing after a while: can you let us know the kernel version? In the past few weeks, we saw users complaining that kernel 6.25 is causing stability issues.
Hi @shashi
Thanks you for your response. The kernel version is 6.12.25. if you have any suggestions for a more stable version, I will consider switching to ensure system stability. I look forward to your recommendation. Thanks you so much!
Hi @The_Nguyen
Glad to hear. You can adapt the code to your 5 camera, 5 model use case you mentioned as well. Let us know if you encounter any issues. Please note that there will be performance degradation due to switching the models. You may also run into weak host problem as RPi5 is not a very powerful host.
Hi @shashi,
Sorry to bother you, but I would like to deploy 5 cameras along with 5 different models running on ROS 2 Humble. I have completely built ROS 2 Humble from source. However, I haven’t been able to find any documentation or resources about deploying Hailo-8 with ROS 2. Could you please provide me with some information or guidance on this? Thank you very much.