This repository provides a comprehensive guide on using DeGirum PySDK, DeGirum Tools, and DeGirum CLI with Hailo hardware for efficient AI inference. These tools simplify edge AI development by enabling seamless integration, testing, and deployment of AI models on multiple hardware platforms, including Hailo-8 and Hailo-8L.
- Introduction
- Prerequisites
- Setting Up the Environment
- Installing DeGirum CLI
- Verifying Installation
- Example Usage
- Additional Resources
DeGirum provides a powerful suite of tools to simplify the development and deployment of edge AI applications:
- DeGirum PySDK: The core library for integrating AI inference capabilities into applications.
- DeGirum Tools: Utilities for benchmarking, streaming, and interacting with DeGirum's model zoo.
- DeGirum CLI: A command-line interface for testing and managing AI models.
These tools are designed to be hardware-agnostic, enabling developers to build scalable, flexible solutions without being locked into a specific platform.
-
Hailo Tools Installed: Ensure that Hailo's tools and SDK are properly installed and configured. Refer to Hailo's documentation for detailed setup instructions. Also, enable the HailoRT Multi-Process service, as per HailoRT documentation:
sudo systemctl enable --now hailort.service # for Ubuntu
-
Python 3.9 or Later: Ensure Python is installed on your system. You can check your Python version using:
python3 --version
To keep your Python environment clean and avoid conflicts, it's recommended to use a virtual environment for installing the required packages.
- Navigate to the directory where you'd like to create the environment.
- Run the following commands:
python3 -m venv degirum_env source degirum_env/bin/activate
- Navigate to the directory where you'd like to create the environment.
- Run the following commands:
python3 -m venv degirum_env degirum_env\Scripts\activate
Ensure pip
is up-to-date within your virtual environment:
pip install --upgrade pip
Install the DeGirum CLI package from PyPI using pip
. This package includes degirum
, degirum_tools
, and degirum_cli
for easy testing and development:
pip install degirum_cli
This will automatically install:
degirum
: The core PySDK library for AI inference.degirum_tools
: Additional tools for streaming, benchmarking, and other utilities.degirum_cli
: A command-line interface for interacting with DeGirum PySDK.
To verify the installation, run the following commands:
degirum_cli --help
You should see a list of available commands and their usage.
Run the following command to verify that the Hailo hardware is recognized by the DeGirum package:
degirum sys-info
Look for hailort
in the output to ensure the Hailo hardware is properly integrated. Below is an example output when Hailo hardware is detected:
Devices:
HAILORT/HAILO8:
- '@Index': 0
Board Name: Hailo-8
Device Architecture: HAILO8
Firmware Version: 4.19.0
ID: '0000:02:00.0'
Part Number: HM218B1C2LA
Product Name: HAILO-8 AI ACCELERATOR M.2 B+M KEY MODULE
Serial Number: SomeSerialNumber
Note: DeGirum PySDK supports Hailo Runtime version 4.19.0. Ensure your Hailo environment is configured to use this version.
degirum_cli predict-image \
--inference-host-address @local \
--model-name yolov8n_relu6_coco--640x640_quant_hailort_hailo8_1 \
--model-zoo-url degirum/models_hailort
degirum_cli predict-image ^
--inference-host-address @local ^
--model-name yolov8n_relu6_coco--640x640_quant_hailort_hailo8_1 ^
--model-zoo-url degirum/models_hailort
degirum_cli predict-video \
--inference-host-address @local \
--model-name yolov8n_relu6_coco--640x640_quant_hailort_hailo8_1 \
--model-zoo-url degirum/models_hailort
degirum_cli predict-video ^
--inference-host-address @local ^
--model-name yolov8n_relu6_coco--640x640_quant_hailort_hailo8_1 ^
--model-zoo-url degirum/models_hailort
- Hailo Model Zoo: Explore the full list of models optimized for Hailo hardware.
- Hailo8 Tutorial Notebook: Jupyter notebook tutorial to get started with Hailo8.
- Hailo8L Tutorial Notebook: Jupyter notebook tutorial to get started with Hailo8L.
- DeGirum Documentation
- Hailo Documentation
Feel free to clone this repository and contribute by submitting pull requests or raising issues.