Skip to content

Seeed-Projects/hailo_toolbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Hailo Toolbox

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.

πŸ“¦ Installation

Hardware Prepare

reComputer AI R2140 reComputer AI Industrial R2145
Raspberry Pi AI Kit reComputer R1100
Purchase Now Purchase Now

Requirements

  • Python 3.8 ≀ version < 3.12
  • Linux (recommended Ubuntu 18.04+), Windows 10+, macOS 10.15+

Hailo Dataflow Compiler

Note: You only need to install Hailo DFC on your own machine if you need to convert your own model

HailoRT

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

Install from Source

# Get project code
git clone https://github.com/Seeed-Projects/hailo_toolbox.git
cd hailo_toolbox
# Install hailo-toolbox
pip install -e .

Install from Virtual Environment (Recommended)

# 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 .

Verify Installation

hailo-toolbox --version
hailo-toolbox --help

πŸš€ Quick Start

Model Conversion

# 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

Model Inference

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")

πŸ“– Complete Examples

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.

Custom Callback Registration

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

πŸ“š Documentation

πŸš€ Getting Started

πŸ“– User Guides

πŸ”§ Developer Documentation

πŸš€ Quick Examples

# 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.

🀝 Contributing

We welcome community contributions! Please see our contributing guidelines:

  1. Report Issues: Submit bug reports or feature requests
  2. Code Contributions: Fork the project and submit pull requests
  3. Documentation: Improve documentation and examples
  4. Testing: Add test cases and performance benchmarks

πŸ”— Links

πŸ“ž Support

  • 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!

πŸ“„ License

This project is licensed under the MIT License. See LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages