← How-Tos
raspberry-pi Aug 3, 2026 ◑ 4 views ◯ 5 min read

Raspberry Pi 5 with the Hailo AI Kit: Real-Time Object Detection Setup

raspberry pi 5hailoai kitobject detectionm.2neural acceleratorfrigaterpicammachine vision

This site already covers OpenCV machine vision and Frigate NVR object detection on a bare Raspberry Pi, both of which lean on the Pi's general-purpose CPU (or a USB Coral accelerator in Frigate's case) to run inference. The official Raspberry Pi AI Kit takes a different path: it pairs a Hailo-8L neural network accelerator with the Pi 5's M.2 HAT+ over a PCIe link, delivering up to roughly 13 TOPS of dedicated inference throughput without touching the CPU at all. For anything running continuous object detection — a security camera, a wildlife cam, a shop-floor safety monitor — that's the difference between single-digit frames per second and real-time detection with CPU headroom left over for everything else the Pi is doing.

What's in the Kit and Why It Needs the Pi 5 Specifically

The AI Kit bundles a Hailo-8L M.2 module, the official M.2 HAT+, and the standoffs/cabling to mount it directly under the Pi 5's board using the PCIe FFC connector the Pi 5 exposes (a connector the Pi 4 doesn't have). This is a hard requirement — unlike a USB accelerator, the Hailo module talks to the Pi over native PCIe, which means it's Pi 5 only. There's also a lower-power AI HAT+ variant with a Hailo-8 (26 TOPS) option, using the same mounting approach; either works with the setup below, differing mainly in inference throughput headroom for running multiple models or higher-resolution streams simultaneously.

Physical Installation

  1. Power off the Pi completely and disconnect all cables before opening the case.
  2. Remove the Pi 5's PCIe FFC cable cover and connect the ribbon cable from the M.2 HAT+ to the Pi's PCIe connector, matching the blue-tab orientation shown in the official instructions — this connector is easy to seat at a slight angle, which causes a board that won't enumerate the device at all.
  3. Mount the M.2 HAT+ to the Pi using the provided standoffs, seating it below the Pi board in the standard case-compatible orientation.
  4. Install the Hailo-8L module into the M.2 slot on the HAT at a slight angle, then press down and secure it with the retention screw.
  5. Reassemble into a case with adequate clearance for the extra board stack height — most standard Pi 5 cases do not accommodate the HAT without an actively-cooled or AI-kit-specific case.

Software Setup

Start from a fresh Raspberry Pi OS Bookworm (64-bit) install and make sure firmware and OS packages are current before enabling PCIe:

sudo apt update && sudo apt full-upgrade -y sudo rpi-eeprom-update -a sudo reboot

PCIe Gen 3 speeds aren't enabled by default on the Pi 5 for signal integrity reasons with some cables; the Hailo kit generally runs fine at Gen 2 speeds, but if you want the extra headroom, add dtparam=pciex1_gen=3 to /boot/firmware/config.txt after confirming your specific FFC cable is rated for it. Then install the Hailo software stack, which Raspberry Pi packages directly for Bookworm:

sudo apt install hailo-all sudo reboot

This pulls in the Hailo runtime, the HailoRT driver, and the pre-built pose estimation, object detection, and segmentation pipelines that integrate with rpicam-apps. After reboot, verify the accelerator is detected:

hailortcli fw-control identify

A successful response reports the device architecture (Hailo-8L or Hailo-8) and firmware version. If this comes back empty, the most common causes are an unseated FFC cable or a case obstructing the M.2 HAT's standoffs from making full contact — reseat both before troubleshooting software.

Running Object Detection

The bundled examples give you a working detection pipeline immediately, useful for confirming the whole stack end-to-end before wiring it into your own project:

rpicam-hello -t 0 --post-process-file /usr/share/rpi-camera-assets/hailo_yolov6_inference.json

This runs a YOLOv6 model live against the camera feed with bounding boxes drawn in the preview window, entirely on the Hailo accelerator. For headless use, swap the preview for an output file or a network stream, and for custom applications, the Hailo TAPPAS and HailoRT Python bindings expose the same inference pipeline for use in your own OpenCV or GStreamer-based scripts.

Integrating with Frigate NVR

Frigate added native Hailo detector support, which is the natural pairing with this site's existing Frigate guide — instead of relying on a USB Coral or CPU-only detection (both covered in that guide), point Frigate's detector config at the Hailo device:

detectors: hailo8l: type: hailo8l device: PCIe

With this in place, Frigate offloads all detection inference to the accelerator, freeing the Pi's CPU almost entirely for stream decoding, recording, and the web UI — a meaningfully different experience than CPU-only detection, which tends to fall behind on more than one or two camera streams at typical resolutions.

Performance Expectations

SetupTypical YOLOv8n throughputCPU load during inference Pi 5 CPU only~1-3 FPSVery high, contends with everything else Pi 5 + USB Coral~15-25 FPSLow, but USB bandwidth-limited on multiple streams Pi 5 + Hailo-8L (AI Kit)~25-35 FPSMinimal, PCIe link avoids USB bottleneck Pi 5 + Hailo-8 (AI HAT+)~50+ FPSMinimal, headroom for multiple concurrent models

Numbers vary by model complexity and resolution, but the pattern holds: dedicated silicon over PCIe consistently beats both CPU inference and USB-attached accelerators, both in raw throughput and in leaving the Pi's CPU free for the rest of the pipeline.

Combined with the Frigate NVR guide already on this site, the AI Kit turns a Pi 5 security camera setup from "detects motion" into genuinely reliable "detects and classifies a person, vehicle, or package" at a frame rate that keeps up with real-world camera feeds, without needing a GPU-equipped server anywhere on the network.