0%

Raspberry Pi 5 + [Hailo] AI - (2)

Hailo Technologies Ltd. is indeed a semiconductor high-tech company based in Tel Aviv, Israel. Although this blog focuses on the Israeli product Hailo-8L Entry-Level AI Accelerator, I would like to take this opportunity to celebrate the successful holding of 2025 China Victory Day Parade.

In my first blog post about Hailo last year, not using a Docker container to create a Python 3.10 environment caused me significant troubles, and I actually failed to complete the demonstration. Today, we are going to walk through the entire Hailo process again.

1. Raspberry Pi 5 Enviroment

1.1 neofetch

Raspberry Pi 5 Environment

1.2 Package Installation

Please visit Hailo Software Downloads to download and install the following three MUST software packages:

  • HailoRT – Ubuntu package (deb) for arm64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
➜  dpkg -L hailort            
/.
/etc
/etc/default
/etc/default/hailort_service
/lib
/lib/systemd
/lib/systemd/system
/lib/systemd/system/hailort.service
/usr
/usr/bin
/usr/bin/hailortcli
/usr/include
/usr/include/gstreamer-1.0
/usr/include/gstreamer-1.0/gst
/usr/include/gstreamer-1.0/gst/hailo
/usr/include/gstreamer-1.0/gst/hailo/include
/usr/include/gstreamer-1.0/gst/hailo/include/hailo_gst.h
/usr/include/gstreamer-1.0/gst/hailo/tensor_meta.hpp
/usr/include/hailo
/usr/include/hailo/buffer.hpp
/usr/include/hailo/device.hpp
/usr/include/hailo/dma_mapped_buffer.hpp
/usr/include/hailo/event.hpp
/usr/include/hailo/expected.hpp
/usr/include/hailo/genai
/usr/include/hailo/genai/common.hpp
/usr/include/hailo/genai/llm
/usr/include/hailo/genai/llm/llm.hpp
/usr/include/hailo/genai/text2image
/usr/include/hailo/genai/text2image/text2image.hpp
/usr/include/hailo/genai/vdevice_genai.hpp
/usr/include/hailo/hailo_gst_tensor_metadata.hpp
/usr/include/hailo/hailo_session.hpp
/usr/include/hailo/hailort.h
/usr/include/hailo/hailort.hpp
/usr/include/hailo/hailort_common.hpp
/usr/include/hailo/hailort_defaults.hpp
/usr/include/hailo/hailort_dma-heap.h
/usr/include/hailo/hef.hpp
/usr/include/hailo/infer_model.hpp
/usr/include/hailo/inference_pipeline.hpp
/usr/include/hailo/network_group.hpp
/usr/include/hailo/network_rate_calculator.hpp
/usr/include/hailo/platform.h
/usr/include/hailo/quantization.hpp
/usr/include/hailo/runtime_statistics.hpp
/usr/include/hailo/stream.hpp
/usr/include/hailo/transform.hpp
/usr/include/hailo/vdevice.hpp
/usr/include/hailo/vstream.hpp
/usr/lib
/usr/lib/aarch64-linux-gnu
/usr/lib/aarch64-linux-gnu/gstreamer-1.0
/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgsthailo.so
/usr/lib/cmake
/usr/lib/cmake/HailoRT
/usr/lib/cmake/HailoRT/HailoRTConfig.cmake
/usr/lib/cmake/HailoRT/HailoRTConfigVersion.cmake
/usr/lib/cmake/HailoRT/HailoRTTargets-release.cmake
/usr/lib/cmake/HailoRT/HailoRTTargets.cmake
/usr/lib/libhailort.so.4.22.0
/usr/local
/usr/local/bin
/usr/local/bin/hailort_service
/usr/share
/usr/share/doc
/usr/share/doc/hailort
/usr/share/doc/hailort/copyright

  • HailoRT – PCIe driver Ubuntu package (deb)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
➜  ~ dpkg -L hailort-pcie-driver
/.
/lib
/lib/firmware
/lib/firmware/hailo
/lib/firmware/hailo/hailo8_fw.4.22.0.bin
/lib/udev
/lib/udev/rules.d
/lib/udev/rules.d/51-hailo-udev.rules
/share
/share/opt
/share/opt/hailo
/share/opt/hailo/common
/share/opt/hailo/common/fw_operation.c
/share/opt/hailo/common/fw_operation.h
/share/opt/hailo/common/fw_validation.c
/share/opt/hailo/common/fw_validation.h
/share/opt/hailo/common/hailo_ioctl_common.h
/share/opt/hailo/common/hailo_resource.c
/share/opt/hailo/common/hailo_resource.h
/share/opt/hailo/common/pcie_common.c
/share/opt/hailo/common/pcie_common.h
/share/opt/hailo/common/soc_structs.h
/share/opt/hailo/common/utils.h
/share/opt/hailo/common/vdma_common.c
/share/opt/hailo/common/vdma_common.h
/share/opt/hailo/linux
/share/opt/hailo/linux/pcie
/share/opt/hailo/linux/pcie/51-hailo-udev.rules
/share/opt/hailo/linux/pcie/Kbuild
/share/opt/hailo/linux/pcie/Makefile
/share/opt/hailo/linux/pcie/Readme.md
/share/opt/hailo/linux/pcie/dkms.conf.in
/share/opt/hailo/linux/pcie/dkms_uninstall.sh
/share/opt/hailo/linux/pcie/hailo_pci.conf
/share/opt/hailo/linux/pcie/src
/share/opt/hailo/linux/pcie/src/fops.c
/share/opt/hailo/linux/pcie/src/fops.h
/share/opt/hailo/linux/pcie/src/nnc.c
/share/opt/hailo/linux/pcie/src/nnc.h
/share/opt/hailo/linux/pcie/src/pcie.c
/share/opt/hailo/linux/pcie/src/pcie.h
/share/opt/hailo/linux/pcie/src/soc.c
/share/opt/hailo/linux/pcie/src/soc.h
/share/opt/hailo/linux/pcie/src/sysfs.c
/share/opt/hailo/linux/pcie/src/sysfs.h
/share/opt/hailo/linux/pcie/tools
/share/opt/hailo/linux/pcie/tools/hailo_load.sh
/share/opt/hailo/linux/pcie/tools/hailo_pci_driver_dkms_remove.sh
/share/opt/hailo/linux/pcie/tools/hailo_unload.sh
/share/opt/hailo/linux/utils
/share/opt/hailo/linux/utils/compact.h
/share/opt/hailo/linux/utils/fw_common.h
/share/opt/hailo/linux/utils/integrated_nnc_utils.c
/share/opt/hailo/linux/utils/integrated_nnc_utils.h
/share/opt/hailo/linux/utils/logs.c
/share/opt/hailo/linux/utils/logs.h
/share/opt/hailo/linux/vdma
/share/opt/hailo/linux/vdma/ioctl.c
/share/opt/hailo/linux/vdma/ioctl.h
/share/opt/hailo/linux/vdma/memory.c
/share/opt/hailo/linux/vdma/memory.h
/share/opt/hailo/linux/vdma/vdma.c
/share/opt/hailo/linux/vdma/vdma.h
/usr
/usr/share
/usr/share/doc
/usr/share/doc/hailort
/usr/share/doc/hailort/hailo_firmware_eula
➜ ~
  • HailoRT – Python package (whl) for Python 3.11, aarch64

  • TAPPAS Python Binding (Optional)

1
2
3
4
➜  ~ pip list | grep hailo
hailo-tappas-core-python-binding 5.0.0
hailort 4.22.0
➜ ~

Note: Since my Raspberry Pi 5 comes with Python 3.11 pre-installed, I have selected the Python 3.11 version. You should choose the appropriate version that matches your Python environment for installation.

Please also guarantee the software you installed are compatible with each other. As shown in the following, I’m using the newest compatible versions.

Release versions compatibility

Finally, let’s test if Hailo is correctly configured on our Raspberry Pi 5.

Hailo Configuration

1.3 Preparation

Please strictly follow the How to Set Up Raspberry Pi 5 and Hailo guide to fix any bugs that have already appeared or to prevent potential ones.

1.4 Identify Device Architecture

This is a MUST step to do.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
➜  ~ hailortcli fw-control identify

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

➜ ~

Mine is a HAILO8L.

2 Models

2.1 Download .hefs

For simplicity, I directly downloaded some .hef files from HAILO8L Models

2.2 hailortcli run .hefs

hailortcli run Tests

The .hef (Hailo Executable File) format is platform-independent: a single .hef file can be executed on both x86_64 hosts and aarch64 (ARM64) hosts, as long as the system has the appropriate Hailo runtime (HailoRT) and driver installed.

This is possible because the .hef file does not contain host-specific binaries or compiled CPU code. Instead, it encapsulates the compiled Hailo neural network graph targeted for the Hailo hardware accelerator itself. The host platform - whether x86_64 or aarch64 - acts mainly as a controller that loads the .hef into the Hailo device, configures it, and orchestrates inference.

In other words, the .hef file is tied to the Hailo hardware (e.g., Hailo-8, Hailo-8L, Hailo-10) but is independent of the host CPU architecture. This allows the same .hef model file to be deployed seamlessly across development environments (for example, a workstation with an x86_64 CPU and PCIe card) and edge devices (for example, a Raspberry Pi 5 or Jetson board with an ARM64 CPU and M.2 card).

3. Demonstration

3.1 Single Image - Object Detection and Image Segmentation

In this demonstration, 2 famous images from Ultralytics are respectively adopted for object detection and image segmentation:

Hailo Object Detection using yolov11s.hef Hailo Image Segmentation using yolov8s_seg.hef
Hailo Object Detection using yolov11s.hef Hailo Image Segmentation using yolov8s_seg.hef

3.2 Video - Detection and Tracking

3.3 Detection and Tracking - Live Camera RTSP

3.3.1 On Server Raspberry Pi 5

1
2
3
4
5
6
7
8
9
10
11
✗ python3 camera_ai_rtsp.py

[1:50:26.068253200] [7893] INFO Camera camera_manager.cpp:326 libcamera v0.5.1+100-e53bdf1f
[1:50:26.075415015] [7907] INFO RPI pisp.cpp:720 libpisp version v1.2.1 981977ff21f3 29-04-2025 (14:13:50)
[1:50:26.076215774] [7907] WARN CameraSensorProperties camera_sensor_properties.cpp:473 No static properties available for 'imx708_noir'
[1:50:26.076235959] [7907] WARN CameraSensorProperties camera_sensor_properties.cpp:475 Please consider updating the camera sensor properties database
[1:50:26.085411941] [7907] WARN CameraSensor camera_sensor_legacy.cpp:501 'imx708_noir': No sensor delays found in static properties. Assuming unverified defaults.
[1:50:26.085847404] [7907] INFO RPI pisp.cpp:1179 Registered camera /base/axi/pcie@1000120000/rp1/i2c@88000/imx708@1a to CFE device /dev/media0 and ISP device /dev/media2 using PiSP variant BCM2712_C0
[1:50:26.088843719] [7893] INFO Camera camera.cpp:1205 configuring streams: (0) 1280x720-RGB888/Rec709/Rec709/None/Full (1) 1536x864-BGGR_PISP_COMP1/RAW
[1:50:26.088947294] [7907] INFO RPI pisp.cpp:1483 Sensor: /base/axi/pcie@1000120000/rp1/i2c@88000/imx708@1a - Selected sensor format: 1536x864-SBGGR10_1X10 - Selected CFE format: 1536x864-PC1B
✅ RTSP server running at rtsp://<RPi5-IP>:8554/ai

3.3.2 On Any Client

1
ffplay -rtsp_transport tcp rtsp://192.168.1.90:8554/ai
Live Stream RTSP Broadcasted After Processed by Hailo on Raspberry Pi 5 ffplay the Processed Live Stream on Server
Hailo Object Detection using yolov11s.hef Hailo Image Segmentation using yolov8s_seg.hef

4. Compilation

Like other dedicated AI hardware platforms, Hailo‘s software stack involves compiling a trained model, converting it from the standard ONNX format into its proprietary HEF (Hailo Executable Format) file optimized for its own architecture.