Need Python code to read backbone vstream outputs on HailoRT 4.24.0 (ARM64)

Hi,

I’m deploying a custom YOLOv8 on Raspberry Pi with Hailo-8L.
I’ve compiled a backbone HEF (no detection head), which runs at 68 FPS.
I have installed hailo_platform via:
hailo-4.24.0-cp310-cp310-linux_aarch64.whl

The HEF has three output vstreams:
yolov8n_backbone/conv39 (80x80x64)
yolov8n_backbone/conv47 (40x40x64)
yolov8n_backbone/conv54 (20x20x64)

I need to read these three uint8 tensors from Python to do post-processing (decoder + NMS).
However, the Python API seems to have changed:

  • ConfiguredNetwork no longer has a ‘run()’ method.
  • I could not find how to create input/output vstreams and read data.

Could anyone provide a minimal working example of:

  1. Creating input/output vstreams from a ConfiguredNetwork.
  2. Writing a uint8 image to the input vstream.
  3. Reading the three output vstreams as numpy arrays.

My environment:

  • HailoRT version: 4.24.0
  • Python: 3.10 (conda)
  • OS: Raspberry Pi (aarch64)

Thank you very much!

Welcome to the Hailo Community!

I recommend starting with the application examples in the hailo-apps repository:

One thing to check: I would expect the YOLOv8n model to have six output streams.

Take a look at the YOLOv8n model in the Model Zoo. We typically add NMS to the HEF so that it is executed by HailoRT.

You can see the outputs by using the following command:

hailortcli parse-hef --parse-streams yolov8n.hef

You can download the HEF file from here:

Another option is to add NMS to the HEF using the nms_postprocess command in the model script (ALLS). This allows HailoRT to perform NMS automatically, so you don’t need to implement it in Python. You can refer to the YOLOv8n ALLS script in the Model Zoo for an example: