Ensure your system is up-to-date. If you are installing Raspberry Pi OS for the first time, make sure you allow for the software to update during the initial wizard. If you have already installed Raspberry Pi OS, open a command prompt window and run the following commands to fully update your system.
sudo apt update
sudo apt full-upgrade
Install the required Hailo package.
sudo apt install hailo-all
Reboot your Raspberry Pi.
sudo reboot
Verify the Hailo device is correctly identified.
hailortcli fw-control identify
Clone the Hailo example repository.
git clone https://github.com/hailo-ai/hailo-rpi5-examples.git
cd hailo-rpi5-examples
Source the environment setup script.
source setup_env.sh
Install the necessary Python dependencies.
pip install -r requirements.txt
Download the required resources for the demo.
./download_resources.sh
Run the detection demo with a sample video file.
python basic_pipelines/detection.py --input resources/detection0.mp4
To run the detection demo with a connected camera, use the following command replacing video0
with the correct number for your camera device:
python basic_pipelines/detection.py --input /dev/video0
Tip: You can use the following command to get a list of devices to identify the correct number. Note this will show both detected supported USB cameras as well as official Raspberry Pi Cameras.
v4l2-ctl --list-devices