Back to Ultralytics

Hailo Export for Ultralytics YOLO Models

docs/en/integrations/hailo.md

8.4.9820.7 KB
Original Source

Hailo Export for Ultralytics YOLO Models

Hailo AI accelerators run compiled Hailo Executable Format (HEF) models on edge devices such as the Raspberry Pi AI Kit and AI HAT+. Ultralytics exports YOLO detection models directly to HEF with the Hailo Dataflow Compiler (DFC).

Hailo deployment is designed for computer vision at the edge: cameras, robots, industrial systems, gateways, and other devices that need local object detection without sending every frame to the cloud. A compiled HEF contains the quantized network, hardware allocation, scheduling, and optional HailoRT post-processing needed by the selected accelerator.

!!! note "Compare newer edge accelerators"

For new hardware deployments, also evaluate [Axelera](axelera.md) and [DeepX](deepx.md), which target newer edge accelerator platforms and may offer higher performance. Hailo recommends at least 1,024 representative calibration images for best accuracy; the default COCO128 dataset is suitable only for quick testing.

Why Deploy Ultralytics YOLO on Hailo?

Combining Ultralytics YOLO with a Hailo neural processing unit (NPU) provides a practical path from model training to low-power edge AI inference. Common use cases include:

  • Smart cameras and video analytics: Run real-time object detection near the camera for security, retail, traffic, and occupancy applications.
  • Robotics and autonomous systems: Detect people, vehicles, packages, tools, or obstacles without relying on a continuous cloud connection.
  • Industrial computer vision: Deploy custom YOLO models for inspection, counting, safety monitoring, and quality control.
  • Raspberry Pi AI projects: Add accelerated vision inference to Raspberry Pi systems using the AI Kit or AI HAT+.
  • Edge gateways and AI PCs: Process multiple video or sensor streams locally while reducing bandwidth and cloud-compute requirements.

Local inference can improve privacy and response time because images remain on the deployment device. Actual throughput, latency, and power use depend on the YOLO model size, input resolution, Hailo architecture, host system, and application pipeline.

How Hailo Export Works

Ultralytics owns the complete export workflow behind format="hailo":

text
YOLO (.pt) -> ONNX -> Hailo parse -> INT8 optimization -> HEF compile

The exporter performs these stages automatically:

  1. Exports a static ONNX graph with compiler-compatible settings.
  2. Selects the detection-head outputs for the model architecture.
  3. Generates normalization, activation, and post-processing directives.
  4. Builds a representative calibration stream and quantizes the model to INT8.
  5. Compiles the optimized graph for the selected Hailo accelerator.
  6. Saves the HEF with Ultralytics metadata and removes the intermediate ONNX file.

YOLOv8 and YOLO11 use HailoRT YOLO NMS in the compiled pipeline. YOLO26 uses its NMS-free one-to-one detection outputs, so the exporter selects a different output and quantization path automatically. Users do not need to find ONNX end nodes, write a Hailo model script (.alls), or create an NMS JSON manually.

Installation

Install Ultralytics and download the DFC wheel for your target hardware from the Hailo Developer Zone (free registration required):

bash
pip install ultralytics
pip install /path/to/hailo_dataflow_compiler-*.whl

!!! note

Hailo compilation requires Linux x86_64. Compile the model on a supported workstation, then copy the output directory to the target device. The DFC is not required for inference.

Hailo-8 and Hailo-8L use DFC v3.x. Hailo-10 and Hailo-15 use DFC v5.x. Install the compiler generation that matches the target accelerator.

!!! tip "Export in Ultralytics Platform"

[Ultralytics Platform](https://platform.ultralytics.com/) provides managed Hailo export, so no local Hailo account or DFC installation is required.

Export a Hailo HEF Model

Use format="hailo" and select the target accelerator with name:

python
from ultralytics import YOLO

model = YOLO("yolo11n.pt")
output = model.export(format="hailo", name="hailo8l")
print(output)  # yolo11n_hailo_model/

The equivalent CLI command is:

bash
yolo export model=yolo11n.pt format=hailo name=hailo8l

Hailo export is INT8-only. Ultralytics automatically downloads the default COCO128 calibration dataset when data is not provided. For custom models, use representative training or validation images:

!!! danger "Use at least 1,024 calibration images for best accuracy"

Ultralytics forces DFC optimization level 2 and configures fine-tuning to use the actual calibration dataset size. Hailo recommends at least 1,024 diverse images; the default COCO128 dataset compiles at level 2 but may produce box-regression accuracy loss. For production HEF exports, pass a representative dataset using `data="path/to/dataset.yaml"`.
python
model.export(format="hailo", name="hailo8l", data="path/to/dataset.yaml")

Compilation uses a fixed input shape. Set imgsz to the resolution used on the device:

python
model.export(format="hailo", name="hailo8l", imgsz=640)

Supported Models and Hardware

The Hailo ecosystem covers a broad range of computer vision workloads, but the Ultralytics format="hailo" exporter currently validates only standard YOLO object detection heads. The table below describes this direct integration, not every workload the Hailo ecosystem can run.

Ultralytics taskDirect Hailo exportSupported model familiesNotes
Object detectionYOLOv8, YOLO11, YOLO26Standard Ultralytics Detect heads, including custom models
Instance segmentationNot yet supported by the direct exporter
Image classificationNot yet supported by the direct exporter
Pose estimationNot yet supported by the direct exporter
Oriented object detectionOBB heads are not yet supported
Semantic segmentationNot yet supported by the direct exporter

Specialized detection families such as YOLOv10, YOLO-World, YOLOE, and RT-DETR are also ❌ unsupported. Ultralytics rejects these tasks and model families before compilation instead of producing an unvalidated HEF.

Model familyHailo-8 / Hailo-8LHailo-10 / Hailo-15Output
YOLOv8 / YOLO11HEF with HailoRT YOLO NMS
YOLO26NMS-free detection-head outputs for supported runtimes

Select one of these name values:

nameTarget accelerator
hailo8Hailo-8
hailo8lHailo-8L
hailo10hHailo-10H
hailo15hHailo-15H
hailo15lHailo-15L

hailo8l is the default. Install the DFC generation that matches the selected target.

Hailo Hardware and SDK Generations

Hailo accelerator families use different compiler generations. The generated HEF must match the target hardware, so choose name for the device that will run inference rather than the machine performing the export.

Hardware familyDFC generationTypical deployment examples
Hailo-8 / Hailo-8LDFC v3.xAccelerator modules, Raspberry Pi AI Kit/HAT+
Hailo-10HDFC v5.xNewer edge AI and Raspberry Pi deployments
Hailo-15H / Hailo-15LDFC v5.xSmart-camera and embedded vision applications

The compiler runs on Linux x86_64, while the resulting HEF runs on the Hailo device through HailoRT. This separation lets you compile on a workstation or in Ultralytics Platform and deploy the small runtime artifact to an ARM or x86 edge host.

Compatibility Notes

Hailo compilation is hardware-specific and uses a fixed input shape. Keep these constraints in mind:

  • The selected name must match the deployment accelerator.
  • Calibration images should represent the lighting, viewpoints, objects, and backgrounds expected in production.
  • A HEF compiled with one imgsz does not become dynamically resizable at runtime.
  • Custom class counts are supported because Ultralytics generates post-processing configuration from the model metadata.
  • Detection models with standard Ultralytics Detect heads are supported; segmentation, pose, oriented bounding box, classification, YOLO-World, YOLOE, YOLOv10, and RT-DETR exports are not currently supported.
  • Hailo-8/8L and Hailo-10/15 artifacts are compiled by different DFC generations and are not interchangeable.

Calibration and INT8 Quantization

Hailo HEF export uses INT8 quantization to map the YOLO network efficiently onto the accelerator. The calibration dataset estimates activation ranges; it does not retrain the model or require labels during compilation.

When data is omitted, Ultralytics uses COCO128 as a convenient lightweight calibration dataset. For a custom computer vision model, point data to its dataset YAML so the compiler observes representative images from the actual deployment domain:

python
model.export(format="hailo", name="hailo8l", data="my_dataset.yaml")

fraction selects the portion of the dataset used for calibration. More representative data can improve quantized accuracy but increases optimization time. If the INT8 HEF loses accuracy relative to the original PyTorch model, first improve the calibration data before changing model or runtime settings.

Exported Artifacts

Export creates a directory containing the deployable HEF and Ultralytics metadata:

text
yolo11n_hailo_model/
├── yolo11n.hef
├── metadata.yaml
└── nms_config.json
  • *.hef is the compiled model loaded by HailoRT.
  • metadata.yaml preserves model names, task, input size, stride, and Hailo target information.
  • nms_config.json records the generated HailoRT NMS configuration for YOLOv8 and YOLO11 detection models. YOLO26 does not use this file.

The intermediate ONNX graph is removed after compilation.

Run Inference on Hailo Hardware

Install HailoRT on the target device. Raspberry Pi AI Kit and AI HAT+ users can follow the Raspberry Pi AI software guide:

bash
sudo apt install hailo-all
hailortcli fw-control identify

Copy the complete export directory to the device so metadata.yaml remains next to the HEF. Load the *.hef with HailoRT, TAPPAS, or the Raspberry Pi picamera2.devices.Hailo helper.

YOLOv8 and YOLO11 exports include HailoRT NMS and return detections grouped by class. YOLO26 exports expose the six NMS-free detection-head tensors; use a runtime pipeline that supports YOLO26 post-processing.

For a GStreamer deployment, pass the HEF to hailonet:

bash
gst-launch-1.0 filesrc location=video.mp4 ! decodebin ! videoconvert ! \
  hailonet hef-path=yolo11n_hailo_model/yolo11n.hef ! \
  hailofilter function-name=yolov8 ! hailooverlay ! autovideosink

Hailo Deployment Options

The HEF is the same deployable model artifact across several Hailo runtime interfaces. Choose the interface that fits the application:

Runtime optionBest suited for
HailoRT Python or C/C++ APICustom applications and direct control of inference
Raspberry Pi picamera2.devices.HailoCamera Module projects on Raspberry Pi
GStreamer and Hailo applicationsReal-time video streams and multi-stage pipelines
hailortcliDevice checks, HEF inspection, and benchmarking

Keep metadata.yaml with the HEF when the application needs Ultralytics class names, input size, stride, or other model information. The HEF itself does not replace the application-level logic for camera capture, visualization, tracking, alerts, or storage.

Verify the Hailo Device and HEF

Before integrating a camera or video pipeline, verify the runtime and accelerator independently:

bash
hailortcli fw-control identify
hailortcli parse-hef yolo11n_hailo_model/yolo11n.hef

Device-only performance measurements isolate Hailo inference from video decoding, image resizing, drawing, and application I/O. Measure the complete application separately when estimating end-to-end latency or frames per second.

Hailo Compared with Other YOLO Export Formats

Choose an export format based on the hardware that will execute the model:

Deployment targetUltralytics export format
Hailo NPUHailo HEF (format="hailo")
NVIDIA GPUTensorRT
Intel CPU, GPU, or NPUOpenVINO
Apple hardwareCoreML
Qualcomm Snapdragon NPUQNN
Rockchip NPURKNN
Raspberry Pi AI CameraSony IMX500
Portable cross-runtime useONNX

HEF is the correct choice when the final device contains a Hailo accelerator. ONNX remains useful as a portable interchange format, but HailoRT executes the hardware-specific HEF produced by the DFC rather than the original ONNX model.

Optimize Hailo Computer Vision Performance

Model and pipeline choices often matter more than compiler flags:

  • Start with a small YOLO model and increase model size only when accuracy requires it.
  • Choose the lowest fixed imgsz that still preserves the objects important to the application.
  • Use calibration images from the real camera and environment when possible.
  • Keep the Hailo network active across frames instead of reopening the HEF for every inference.
  • Separate device inference time from preprocessing, video decoding, post-processing, visualization, and network I/O.
  • Use a streaming pipeline such as GStreamer for sustained video workloads.
  • Validate the exported HEF on the exact accelerator and HailoRT version used in production.

Export Arguments

ArgumentTypeDefaultDescription
namestrhailo8lTarget Hailo accelerator architecture
imgszint, list640Fixed model input size
datastrcoco128Calibration dataset YAML
fractionfloat1.0Fraction of calibration images to use
quantizeint8Hailo export uses INT8 quantization
opsetint11Fixed ONNX opset required by the Hailo translation
simplifyboolTrueSimplify the intermediate ONNX graph
conffloat0.25YOLOv8/YOLO11 HailoRT NMS confidence threshold
ioufloat0.7YOLOv8/YOLO11 HailoRT NMS IoU threshold

The exporter selects the correct output path from the model family: YOLOv8 and YOLO11 receive HailoRT NMS, while YOLO26 keeps its NMS-free one-to-one outputs. Do not pass end2end; explicit overrides are rejected. Dynamic shapes, batches larger than one, embedded Ultralytics NMS, FP16, and FP32 are also unsupported.

Troubleshooting Hailo Export

Hailo Dataflow Compiler Import Error

If export reports that hailo_sdk_client is missing, install the DFC wheel for the target hardware generation in the same Python environment as Ultralytics. Hailo-8/8L and Hailo-10/15 require different compiler generations.

Unsupported Operating System or Architecture

HEF compilation is supported on Linux x86_64. Export through Ultralytics Platform or use a compatible workstation if the local computer is macOS, Windows, Raspberry Pi, or another ARM system.

Export Takes a Long Time

DFC optimization is the most expensive stage. Compilation time increases with model size, input resolution, and calibration data. A supported GPU can accelerate optimization, while CPU-only compilation can be substantially slower.

Quantized Model Accuracy Drops

Use calibration images that resemble production inputs and include the important objects, scales, lighting conditions, and backgrounds. Compare the original PyTorch model and exported HEF on the same validation set before deployment.

HEF Does Not Load on the Device

Confirm that name matched the physical Hailo architecture and that the device driver, firmware, and HailoRT packages are mutually compatible. Inspect the artifact with hailortcli parse-hef and verify the accelerator with hailortcli fw-control identify.

Output Parsing Looks Incorrect

YOLOv8 and YOLO11 HEFs include HailoRT NMS and return detections grouped by class. YOLO26 exports raw one-to-one detection-head outputs for an NMS-free runtime path. Use post-processing that matches the exported model family.

FAQ

Can I compile a HEF on a Raspberry Pi?

No. Run the DFC on a supported Linux x86_64 system and deploy the resulting HEF to the Raspberry Pi.

Do I need an NVIDIA GPU?

A supported GPU greatly reduces DFC optimization time. CPU compilation is possible but can take substantially longer.

Which YOLO models support Hailo export?

Direct export supports object detection models with the standard YOLOv8, YOLO11, or YOLO26 detection head. This includes custom-trained models built from those standard detection architectures. Classification, segmentation, pose, OBB, YOLOv10, YOLO-World, YOLOE, and RT-DETR are rejected rather than producing an unvalidated HEF.

Can I export a custom-trained YOLO model?

Yes. Use the same format="hailo" command with the custom .pt weights and pass the training dataset YAML through data for representative INT8 calibration. Class names and class count are read from the model metadata.

Does Hailo export support dynamic image sizes?

No. The DFC compiles a fixed input shape into the HEF. Choose imgsz during export to match the resolution used by the deployment pipeline.

Why does YOLO26 produce different Hailo outputs?

YOLO26 uses an NMS-free one-to-one detection head. Ultralytics compiles those output tensors directly instead of attaching the HailoRT YOLOv8-style NMS used for YOLOv8 and YOLO11.

What is the difference between the DFC and HailoRT?

The Hailo Dataflow Compiler converts and quantizes the model into a hardware-specific HEF on a Linux x86_64 build machine. HailoRT loads and runs that HEF on the target device.

Should I deploy the ONNX or HEF file?

Deploy the compiled HEF to the Hailo runtime. ONNX is an intermediate representation used during export and is removed after successful compilation.

Where can I get the Hailo DFC?

Download the compiler wheel for your hardware generation from the Hailo Developer Zone. The compiler is required only to create the HEF; HailoRT runs it on the target accelerator.

Summary

Ultralytics Hailo export provides a direct path from a trained YOLO detection model to a deployable HEF:

  1. Load a YOLOv8, YOLO11, or YOLO26 detection model.
  2. Export with format="hailo" and select the target architecture.
  3. Calibrate and compile locally with the matching DFC, or use managed export in Ultralytics Platform.
  4. Copy the HEF and metadata.yaml to the Hailo-powered edge device.
  5. Run object detection with HailoRT, Raspberry Pi Picamera2, or a GStreamer video pipeline.

For other computer vision deployment targets, see Export mode, Benchmark mode, and the integrations guide. Related hardware guides include ONNX, OpenVINO, TensorRT, NCNN, RKNN, Sony IMX500, and Qualcomm QNN.