I recently purchased an RPi5 AI Kit from Sparkfun. They had been out of stock for a while but are currently available at multiple distributors. The kit bundles the M.2 HAT+ with a Hailo-8L AI acceleration module. The kit comes pre-assembled with the module mounted with a thermal interface on the M.2 HAT+. It comes with the required standoffs to mount it on an RPi5 with an active cooler.
I've previously used the Intel Neural Stick 2 and Google Coral USB accelerators with RPi4s. Those units claim to operate at 4 TOPS and the Hailo-8L is listed at 13 TOPS. I am currently using the Coral setup to run Frigate on Home Assistant OS.
The AI Kit shown mounted on an RPi5.
Here is my assembly with an 8GB RPi5 and RPi Camera Module 3.
A side view shows the clearance between the top of the active cooler heatsink and the bottom of the HAT+. I had to buy a slightly taller case to fit the assembly.
Mario Bergeron wrote a blog earlier Accelerating the MediaPipe models on Raspberry Pi 5 AI Kit demonstrating hand landmark detection using the AI Kit with a webcam using MediaPipe models. He has benchmarking data included.
I tried out his example but initially could only achieve a 15 fps inferencing rate. I was using an older Logitech C525 720p webcam and when I switched to a newer eMeet C980 1080p webcam I was able to achieve the same 30 fps rate in his example.
Next, I wanted to try out the AI Kit with the RPi Camera Module 3. I've been impressed by the quantity and quality of the documentation and software examples that are already available for the AI Kit.
Hailo's github repo
https://github.com/hailo-ai/hailo-rpi5-examples.
This repository contains examples of basic pipelines for Hailo's RPi5 platform. The Python examples demonstrate object detection, human pose estimation, and instance segmentation. The examples can be run using a USB camera by default (/dev/video0). You can change the input source using the --input flag. To run with a Raspberry Pi camera, use --input rpi. To run with a video file, use --input (e.g.) resources/detection0.mp4.
The object detection example uses the yolov6n model as default. It supports also yolov8s and yolox_s_leaky models.
python3 basic_pipelines/detection.py --input rpi -f
The human pose estimation example uses the yolov8s_pose model.
python3 basic_pipelines/pose_estimation.py --input rpi -f
The instance segmentation example uses the yolov5n_seg model.
python3 basic_pipelines/instance_segmentation.py --input rpi -f
Raspberry Pi Official Examples
rpicam-apps
https://github.com/raspberrypi/rpicam-apps
The latest rpicam-apps include hailo post-processing JSON examples in the assets folder of the rpicam-apps repository.
The following examples are included:
hailo_classifier.json
hailo_yolov5_personface.json
hailo_yolov5_segmentation.json
hailo_yolov6_inference.json
hailo_yolov8_inference.json
hailo_yolov8_pose.json
hailo_yolox_inference.json
The following examples are inferencing at 640x640 resolution but streaming at higher resolution.
hailo_yolo6_inference
rpicam-hello -t 0 --post-process-file ~/rpicam-apps/assets/hailo_yolov6_inference.json --lores-width 640 --lores-height 640
hailo_yolov5_personface
rpicam-hello -t 0 --post-process-file ~/rpicam-apps/assets/hailo_yolov5_personface.json --lores-width 640 --lores-height 640
hailo_yolov8_pose
rpicam-hello -t 0 --post-process-file ~/rpicam-apps/assets/hailo_yolov8_pose.json --lores-width 640 --lores-height 640
picamera2
The picamera2 python library has also been updated to include hailo.
Running the detect and pose examples from the ~/picamera2/examples/hailo/ directory:
python3 detect.py
python3 pose.py
Summary
The existing Hailo and RPi official examples were straightforward to set up and ran without issues. The installation and use documentation is very good.
I currently use a Coral accelerator with an RPi4 to run object detection on real-time ip camera video streams using Frigate. Hailo indicates that Frigate integration is coming soon and I'm really looking forward to trying that out.
In the meantime, I'm going to look through their tutorials and try retraining and developing my own models and also take a better look at the work Mario has done. And maybe try some benchmarking.
I noticed that the Hailo 8 which runs at 26 TOPS is available at somewhat over $200. If that doesn't get scarce maybe I'll get one of those to try.