Language: πΊπΈ English | π¨π³ δΈζ
A comprehensive deep learning model conversion and inference toolkit designed specifically for Hailo AI processors. This project aims to simplify the AI application development workflow based on Hailo devices, providing developers with a one-stop solution from model conversion to deployment inference.
reComputer AI R2140 | reComputer AI Industrial R2145 |
---|---|
Purchase Now | Purchase Now |
- Python 3.8 β€ version < 3.12
- Linux (recommended Ubuntu 18.04+), Windows 10+, macOS 10.15+
Note: You only need to install Hailo DFC on your own machine if you need to convert your own model
- Hailo Dataflow Compiler (for model conversion) Installation Tutorial
Note: You can use command like below if you use reComputer
sudo apt update && sudo apt full-upgrade -y
sudo apt install hailo-all -y
Note: Other hardwares please follow tutorial below
- HailoRT (for inference) Installation Tutorial
# Get project code
git clone https://github.com/Seeed-Projects/hailo_toolbox.git
cd hailo_toolbox
# Install hailo-toolbox
pip install -e .
# Create virtual environment
python -m venv hailo_env
# Activate virtual environment
source hailo_env/bin/activate
# Get project code
git clone https://github.com/Seeed-Projects/hailo_toolbox.git
cd hailo_toolbox
# Install hailo-toolbox
pip install -e .
hailo-toolbox --version
hailo-toolbox --help
# Convert ONNX model to HEF format
hailo-toolbox convert model.onnx --hw-arch hailo8 --calib-set-path ./calibration_data
# Quick conversion with random calibration
hailo-toolbox convert model.onnx --use-random-calib-set
from hailo_toolbox import create_source
from hailo_toolbox.models import ModelsZoo
# Create input source
source = create_source("video.mp4") # or camera: 0, or image: "image.jpg"
# Load model from ModelsZoo
inference = ModelsZoo.detection.yolov8s()
# Process frames
for img in source:
results = inference.predict(img)
for result in results:
boxes = result.get_boxes()
scores = result.get_scores()
class_ids = result.get_class_ids()
print(f"Detected {len(result)} objects")
Detailed usage examples for each supported task:
# Browse all available examples
ls examples/Hailo_*.py
# Object detection with visualization
python examples/Hailo_Object_Detection.py
# Human pose estimation
python examples/Hailo_Pose_Estimation.py
# Face detection and landmarks
python examples/Hailo_Face_Detection.py
π Learn More: See
examples/README.md
for detailed documentation of all supported tasks and models.
from hailo_toolbox.inference.core import CALLBACK_REGISTRY
@CALLBACK_REGISTRY.registryPostProcessor("custom_model")
class CustomPostProcessor:
def __init__(self, config):
self.config = config
def __call__(self, results, original_shape=None):
# Custom post-processing logic
return processed_results
- Examples Directory - Complete working examples for all supported tasks
- Examples README - Detailed guide to all available examples
- Quick Start Guide / δΈζ - Installation and basic usage
- Model Conversion Guide / δΈζ - How to convert models to HEF format
- Model Inference Guide / δΈζ - How to run inference with converted models
- Input Sources Guide / δΈζ - Supported input sources and configuration
- Developer Guide / δΈζ - How to implement custom models and callbacks
- Project Introduction / δΈζ - Detailed project overview and architecture
# Run object detection example
python examples/Hailo_Object_Detection.py
# Run pose estimation example
python examples/Hailo_Pose_Estimation.py
# Run face detection example
python examples/Hailo_Face_Detection.py
# View all examples
ls examples/Hailo_*.py
π‘ Tip: Check the
examples/
directory for complete working examples of each task type. Each example includes model loading, inference, and result processing.
We welcome community contributions! Please see our contributing guidelines:
- Report Issues: Submit bug reports or feature requests
- Code Contributions: Fork the project and submit pull requests
- Documentation: Improve documentation and examples
- Testing: Add test cases and performance benchmarks
- GitHub Repository: https://github.com/Seeed-Projects/hailo_toolbox
- Issues: https://github.com/Seeed-Projects/hailo_toolbox/issues
- Hailo AI: https://hailo.ai
- GitHub Issues: For bug reports and feature requests
- Documentation: Comprehensive guides and API reference
- Community: Join our developer community discussions
Making AI inference simpler and more efficient with Hailo Toolbox!
This project is licensed under the MIT License. See LICENSE for details.