Welcome to the Hailo Raspberry Pi 5 Examples repository. This project showcases various examples demonstrating the capabilities of the Hailo AI processor on a Raspberry Pi 5. These examples will help you get started with AI on embedded devices. The examples in this repository are designed to work with the Raspberry Pi AI Kit and AI HAT, supporting both the Hailo8 (26 TOPS) and Hailo8L (13 TOPS) AI processors. The examples can also be run on an x86_64 Ubuntu machine with the Hailo8/8L AI processor. Visit the Hailo Official Website and Hailo Community Forum for more information.
For instructions on how to set up Hailo's hardware and software on the Raspberry Pi 5, see the Hailo Raspberry Pi 5 installation guide.
The basic pipelines examples demonstrate object detection, human pose estimation, and instance segmentation, providing a solid foundation for your own projects. This repo is using our new Hailo Apps Infra repo as a dependency. See our Developement Guide for more information on how to use the pipelines to create your own custom pipelines.
git clone https://github.com/hailo-ai/hailo-rpi5-examples.git
Navigate to the repository directory:
cd hailo-rpi5-examples
Run the following script to automate the installation process:
./install.sh
For additional information and documentation on how to use the pipelines to create your own custom pipelines, see the Basic Pipelines Documentation.
When opening a new terminal session, ensure you have sourced the environment setup script:
source setup_env.sh
For more information see Detection Example Documentation.
python basic_pipelines/detection.py
To close the application, press Ctrl+C
.
python basic_pipelines/detection.py --input rpi
Detect the available camera using this script:
get-usb-camera
Run example using USB camera input - Use the device found by the previous script:
python basic_pipelines/detection.py --input /dev/video<X>
For additional options, execute:
python basic_pipelines/detection.py --help
This application includes support for using retrained detection models. For more information, see Using Retrained Models.
For more information see Pose Estimation Example Documentation.
python basic_pipelines/pose_estimation.py
To close the application, press Ctrl+C
.
See Detection Example above for additional input options examples.
For more information see Instance Segmentation Example Documentation.
python basic_pipelines/instance_segmentation.py
To close the application, press Ctrl+C
.
See Detection Example above for additional input options examples.
Get involved and make your mark! Explore our Community Projects and start contributing today, because together, we build better things! 🚀 Check out our Community Projects for more information.
Hailo RPi5 Examples are using the Hailo Apps Infra Repository as a dependency. The Hailo Apps Infra repository contains the infrastructure of Hailo applications and pipelines. It is aimed for to provide tools for developers who want to create their own custom pipelines and applications. It features a simple and easy-to-use API for creating custom pipelines and applications. It it installed as a pip package and can be used as a dependency in your own projects. See more information in its documentation and Development Guide.
CLIP (Contrastive Language-Image Pre-training) predicts the most relevant text prompt on real-time video frames using Hailo8/8l AI processor. See the hailo-CLIP Repository for more information. Click the image below to watch the demo on YouTube.
Frigate is an open-source video surveillance software that runs on a Raspberry Pi. This integration will allow you to use the Hailo-8L AI processor for object detection in real-time video streams.
Raspberry Pi rpicam-apps Hailo post-processing examples. This is Raspberry Pi's official example for AI post-processing using the Hailo AI processor integrated into their CPP camera framework. The documentation on how to use rpicam-apps can be found here.
Raspberry Pi picamera2 is the libcamera-based replacement for Picamera, which was a Python interface to the Raspberry Pi's legacy camera stack. Picamera2 also presents an easy-to-use Python API.
The Hailo Python API is now available on the Raspberry Pi 5. This API allows you to run inference on the Hailo-8L AI processor using Python. For examples, see our Python code examples. Additional examples can be found in RPi picamera2 code. Visit our HailoRT Python API documentation for more information.
The Hailo Dataflow Compiler (DFC) is a software tool that enables developers to compile their neural networks to run on the Hailo-8/8L AI processors. The DFC is available for download from the Hailo Developer Zone (Registration required). For examples, tutorials, and retrain instructions, see the Hailo Model Zoo Repo. Additional documentation and tutorials can be found in the Hailo Developer Zone Documentation. For a full end-to-end training and deployment example, see the Retraining Example. The detection basic pipeline example includes support for retrained models. For more information, see Using Retrained Models.
We welcome contributions from the community. You can contribute by:
- Contribute to our Community Projects.
- Reporting issues and bugs.
- Suggesting new features or improvements.
- Joining the discussion on the Hailo Community Forum.
This project is licensed under the MIT License. See the LICENSE file for details.
This code example is provided by Hailo solely on an “AS IS” basis and “with all faults.” No responsibility or liability is accepted or shall be imposed upon Hailo regarding the accuracy, merchantability, completeness, or suitability of the code example. Hailo shall not have any liability or responsibility for errors or omissions in, or any business decisions made by you in reliance on this code example or any part of it. If an error occurs when running this example, please open a ticket in the "Issues" tab.