🛠 Accélérer l'inférence IA avec un HAT NPU (Hailo)

Raspberry Pi 5 (model-5) · avance · Schéma : IMG-model-5-avance-2-model5-a2-npu-ia-hat.svg — Raspberry Pi 5 surmonté d'un AI HAT+ (puce NPU Hailo) exécutant une détection d'objets sur flux caméra, jauge de TOPS à l'écran

Objectives

Port a neural network inference to an NPU accelerator connected to the Raspberry Pi 5. Note: the BCM2712 SoC does not contain an embedded NPU; hardware acceleration is provided by an AI HAT+ (Hailo-8L 13 TOPS or Hailo-8 26 TOPS) or an AI HAT+ 2 (Hailo-10H, 40 TOPS + 8 GB dedicated RAM), connected via PCIe through the FPC/HAT+ connector.

Hardware

Complete code

# 1) Installer la pile Hailo (dépôt officiel Raspberry Pi)
sudo apt update && sudo apt install -y hailo-all
sudo hailoall status          # vérifie driver + firmware
ls /dev/hailo0                # présent => NPU visible

# 2) Détecteur YOLO prêt à l'emploi fourni avec la pile
hailo_detection_yolov8.py --input camera --show-fps

# 3) Suivi thermique pendant la charge (bridage à 80-85 °C)
watch -n1 vcgencmd measure_temp
#!/usr/bin/env python3
# infer_hailo.py — inférence minimale via HailoRT (API Python)
import hailort

# Charger un réseau compilé .hef (obtenu avec TAPPAs/compile_hailo)
dev = hailort.Device.create_hailo
dev.load_hef("yolov8s.hef")
print("NPU détecté, réseau chargé :", dev.get_arch)
# ... puis création d'inférence, envoi des trames et lecture des sorties

Expected verification

hailoall status returns driver and firmware OK, and /dev/hailo0 exists. The detection script displays bounding boxes on the camera stream with a FPS rate significantly higher than CPU inference. Temperature remains below 80 °C thanks to cooling.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials