AI & Computer VisionEngineer

Real-Time Object Detection with the Raspberry Pi AI HAT+

Detect people, cars, pets and dozens of objects at high frame rates with a Hailo accelerator.

LevelEngineer
Time1 h
Est. cost~$212
Steps5

The AI HAT+ adds a dedicated neural-network processor to the Pi 5. The camera software includes ready-made YOLO detection pipelines, so you see bounding boxes in minutes.

Video tutorial

▶ Caroline DunnWatch on YouTube ↗

Video by Caroline Dunn, embedded from YouTube. The written steps below are our own and match the parts list.

Mission steps

  1. Install the HAT

    Power off, fit the HAT on the GPIO header and PCIe ribbon, then mount the camera.

  2. Update and install the AI stack

    Update the system and install the hailo-all package, then reboot.

  3. Run the demo

    Start the YOLO detection pipeline with rpicam-hello and the Hailo post-processing file.

  4. Use it in Python

    Explore Raspberry Pi's Hailo examples on GitHub to read detections in your own code.

  5. Build something

    Count cars on your street, open a pet door only for your cat, or give a robot real eyes.

Code

sudo apt update && sudo apt full-upgrade -y
sudo apt install -y hailo-all
sudo reboot

# after reboot: live detection preview
rpicam-hello -t 0 --post-process-file /usr/share/rpi-camera-assets/hailo_yolov8_inference.json

Tip: test every script on the bench before installing it in a moving machine.

Questions

Do I need the AI HAT?

No — a Pi 5 can run small models on the CPU at a few frames per second. The HAT gives 10–30× more speed for real-time work.