How to use two cameras with Yolo modules for RPI5 with HAT+ Hailo?

I checked the support you give to other users in the following thread (User Guide 3: Simplifying Object Detection on a Hailo Device Using DeGirum PySDK - #48 by Loi_Tran). I’ve made some updates to my documents. I now have the following patch /home/rasp5/DeGirum_hailo_examples/models/yolov11m. Inside it, I have:

  • labels_coco.json (i changed the name, but is the same label as ’ labels_yolov8n_relu6_coco.json ')

  • yolov11m.hef

  • yolov11m.json :

{
    "ConfigVersion": 10,
    "Checksum": "69420",
    "DEVICE": [
        {
            "DeviceType": "HAILO8",
            "RuntimeAgent": "HAILORT",
            "SupportedDeviceTypes": "HAILORT/HAILO8L"
        }
    ],
    "PRE_PROCESS": [
        {
            "InputN": 1,
            "InputH": 640,
            "InputW": 640,
            "InputC": 3,
            "InputQuantEn": true
            "InputPadMethod": "letterbox",
            "InputResizeMethod": "bilinear",                
            "InputQuantEn": true
        }
    ],
    "MODEL_PARAMETERS": [
        {
            "ModelPath": "yolov11m.hef"
        }
    ],
    "POST_PROCESS": [
        {
            "OutputPostprocessType": "Detection",
            "PythonFile": "run3.py",
            "OutputNumClasses": 80,
            "LabelsPath": "labels_coco.json",
            "OutputConfThreshold": 0.3  
        }
    ]
}
  • run3.py :
import cv2
import degirum as dg
import degirum_tools


model = dg.load_model(
    model_name="yolov11m",  
    inference_host_address="@local",  
    zoo_url="/home/rasp5/DeGirum_hailo_examples/models",  
    token='',
    device_type=["HAILORT/HAILO8"] #only HAILO8?
)

cap = cv2.VideoCapture(0)

if not cap.isOpened():
    print("Error to open USB CAM.")
    exit()

print("Starting YOLOv11m + Hailo (local). Press 'q' toe xit.")

while True:
    ret, frame = cap.read()
    if not ret:
        print(" Frame not found.")
        break


    result = model(frame)

    cv2.imshow("YOLOv11m Hailo", result.image_overlay)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()