[HOWTO] Converting, inferencing and checking YOLO model on Raspberry Pi with HAILO AI HAT

Hello community,

I’d like to share my experience building a minimal working example for owners of the Raspberry Pi 5 + HAILO AI HAT. This HOWTO covers the following:

  • How to convert a YOLOv8n model into the .HEF format
  • How to run a simple inference on a test image, displaying the results both visually and in the console
  • How to perform a basic comparison of the outputs from both the original and the compiled model

Background

My non-commercial project is focused on object detection and involves guiding a homemade laser to a detected target using real-time camera input. Since this system relies on Raspberry Pi (actually two of them), detection performance has a direct impact on the overall response time.

In an effort to boost FPS, I added the HAILO-8 based AI HAT.
The first logical step was:

  • Run inference with my custom-trained YOLOv8n model using the HAILO chip
  • Compare the detection outputs (bounding boxes, class IDs, confidence scores) against the original model
  • Overlay the results for visual inspection

The Problem

As a result of my own impatience, the lack of structured documentation, and the fatigue that comes from infos being outdated or not matching reality, what seemed like a simple validation task quickly turned into a frustrating experience.

I found myself asking:

  • Which parts of the HAILO software stack are actually required, do I need them at all?
  • Where can I get them, how do I install them, and where exactly should they go?
  • How do I properly convert my YOLOv8n model to .HEF, and what should I do when it throws conversion errors?
  • Is there a simple inference script to compare outputs from the original and compiled models?

Sure, maybe I wasn’t looking in the right places. But between outdated blog posts, contradictory forum advice, and a repo jungle, I ended up installing a pile of useless packages, chasing error messages across modules, and reinventing workarounds that probably already exist.

Eventually, I managed to build a minimal working example — and this post is for anyone who’s trying to do the same, without spending days navigating the same rabbit holes.

If you’re reading this and thinking, “It’s all documented!” — then congrats, you found the right docs. I didn’t.