Detection with tracker example not working with hailo-8l and raspberry pi 5

Hello,

I would like to run the detection with tracker example using the Python API (Hailo-Application-Code-Examples/runtime/python/detection_with_tracker at main · hailo-ai/Hailo-Application-Code-Examples · GitHub).

After modifying the download_resources.sh to download the correct HEF file, I am still getting error about input size buffer.

./detection_with_tracker.py -i input_video.mp4 -o output_video.mp4 -l coco.txt -s 0.5
0%| | 0/349 [00:00<?, ?it/s][HailoRT] [error] CHECK failed - Input buffer size 0 is different than expected 1228800 for input ‘yolov5m_wo_spp_60p/input_layer1’
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INVALID_OPERATION(6)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INVALID_OPERATION(6)
Exception in thread Thread-1 (run):
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/hailo_platform/pyhailort/pyhailort.py”, line 3282, in run_async
cpp_job = self._configured_infer_model.run_async(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hailo_platform.pyhailort._pyhailort.HailoRTStatusException: 6

I have found similar posts about this error message ([HailoRT] [error] CHECK failed - Input buffer size 0 is different than expected 602112 for input 'yolov8m/input_layer1'), but nothing has worked.

Considering this example has been taken directly from the repo without any modifications, I expect it to just work. Does anyone have any suggestions here?

Hey @James

The example you’re trying to run was originally designed for x86 systems with Hailo8. We’re working on an RPI-compatible update that will be released by the end of this week.

Temporary Fix

1. Update Requirements File

Replace your current requirements.txt content with:

cython
supervision==0.19.0
loguru
tqdm
requests
opencv-python

2. Install Dependencies

Run this command to install the required packages:

sudo pip install -r requirements --break-system-packages

Important Notes

  • No Python virtual environment is needed when working with Raspberry Pi
  • After completing these steps, you can run the example directly

Please try these steps and let me know if you need any clarification or run into issues.

Thanks! That worked perfectly. I am able to run the example with that change.

As for the RPI-compatible update, has that been released? Where can I find it?

Cheers,
James

1 Like

This helped, Thanks a lot
Had some basic problems with supervision if there was not detection in the video the code failed so had to add

if detections["xyxy"].size ==0:
       sv_detections=sv.Detections.empty()
       sv_detections = tracker.update_with_detections(sv_detections)

    # Update detections with tracking information
    elif detections["xyxy"].size > 0:

in def postprocess_detections funciton
also with custom model the detections list was throwing some error
to had to modify it

def extract_detections(
    hailo_output: List[np.ndarray], h: int, w: int, threshold: float = 0.5
) -> Dict[str, np.ndarray]:
    """Extract detections from the HailoRT-postprocess output."""
    xyxy: List[np.ndarray] = []
    confidence: List[float] = []
    class_id: List[int] = []
    num_detections: int = 0
    
    for i, detections in enumerate(hailo_output):
      if i == 0:# for person class only
        #print("length:",detections)
        if len(detections) == 0:
            continue
        detections=[detections] # do this only if model is custom or else plz comment
type or paste code here

Hope this helps

Subject: ImportError: libhailort.so.4.18.0 Missing in Hailo Detection Example

Description:
I am encountering an issue while running the detection_with_tracker.py script from the Hailo Application Code Examples. The script fails to start due to a missing shared library (libhailort.so.4.18.0). Below are the details:

Traceback (most recent call last):
  File "/home/uwais/Hailo-Application-Code-Examples/runtime/python/detection_with_tracker/detection_with_tracker.py", line 16, in <module>
    from utils import HailoAsyncInference
  File "/home/uwais/Hailo-Application-Code-Examples/runtime/python/utils.py", line 8, in <module>
    from hailo_platform import (HEF, VDevice,
  File "/home/uwais/Hailo-Application-Code-Examples/runtime/python/detection_with_tracker/myenv/lib/python3

see what prints in the terminal when you enter this
hailortcli fw-control identify

I hope you have followed omria comments . Try running it without the python v-environment. Will check with my setup and see if there is any difference .My current hardware was 8l not 8 . Will update you in case i find anything different

Executing on device: 0000:01:00.0
Identifying board
Control Protocol Version: 2
Firmware Version: 4.19.0 (release,app,extended context switch buffer)
Logger Version: 0
Board Name: Hailo-8
Device Architecture: HAILO8L
Serial Number: HLDDLBB241900233
Part Number: HM21LB1C2LAE
Product Name: HAILO-8L AI ACC M.2 B+M KEY MODULE EXT TMP

This is what i get .Can you try installing and running the code without any python environment

Also for the error that you are getting
try to check if you have 4.18 /4.19 is installed
sudo find /usr/ | grep libhailort

refer this link HAILO_CONTROL_OPCODE_POWER_MEASUEMENT is not supported on the current board. [HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_UNSUPPORTED_OPCODE(48) Failed to get power measurement results, status - #4 by prasaanthg