Raspberry Pi 5 AI HAT

Hailo HEF Workflow

The maintained ONNX to HEF path for running our custom detector models on the Raspberry Pi 5 AI HAT.

Before you start

Read these first:

Current state

Tooling

Current presets

The YOLO11s preset pulls from:

The NanoDet preset pulls from:

Refresh the compile bundle

From software/client:

uv run python scripts/prepare_hailo_compile_bundle.py build \
  --preset classification_chamber_yolo11s \
  --archive

Or:

uv run python scripts/prepare_hailo_compile_bundle.py build \
  --preset classification_chamber_nanodet \
  --archive

This creates the matching bundle directory plus archive, for example:

Packaging a manual Vast.ai session

If the Hailo downloads sit in ~/Downloads:

uv run python scripts/vastai_hailo_session.py package-workspace \
  --bundle-dir blob/hailo_compile_bundles/classification_chamber_yolo11s \
  --output blob/hailo_compile_bundles/classification_chamber_yolo11s_vastai_session.tar.gz

Or point to a custom download directory:

uv run python scripts/vastai_hailo_session.py package-workspace \
  --bundle-dir blob/hailo_compile_bundles/classification_chamber_yolo11s \
  --vendor-downloads-dir /path/to/hailo-downloads \
  --output blob/hailo_compile_bundles/classification_chamber_yolo11s_vastai_session.tar.gz

Compile host profile

The expected host is:

Inside the session:

  1. Extract the session archive under /workspace.
  2. Install the matching Hailo SDK payloads.
  3. Activate the Hailo environment.
  4. Run ./compile_commands.sh inside the bundle.

Working Hailo-8 toolchain line

The successful Hailo-8 compile path used:

The newer 5.x toolchain line is for newer Hailo hardware and is not valid for our Pi AI HAT target.

Current canonical outputs

YOLO11s:

NanoDet:

These results/ directories are the canonical Hailo deliverables we keep locally.

Known gotchas

Validation after compilation

Once the HEF is ready:

  1. Copy it to the Raspberry Pi 5.
  2. Run inference on the same verification subset.
  3. Compare the detections against the matching local reference JSON.

The target is not merely “it runs”, but “it mirrors the local detections as closely as possible”.