{"id":24165973,"url":"https://github.com/degirum/hailo_examples","last_synced_at":"2025-09-20T10:33:04.955Z","repository":{"id":270371151,"uuid":"909513825","full_name":"DeGirum/hailo_examples","owner":"DeGirum","description":"DeGirum PySDK with Hailo AI Accelerators","archived":false,"fork":false,"pushed_at":"2025-01-08T04:07:27.000Z","size":18396,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-08T04:19:32.269Z","etag":null,"topics":["computer-vision","hailo8","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeGirum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-28T23:39:27.000Z","updated_at":"2025-01-08T04:07:31.000Z","dependencies_parsed_at":"2024-12-31T15:46:08.157Z","dependency_job_id":null,"html_url":"https://github.com/DeGirum/hailo_examples","commit_stats":null,"previous_names":["degirum/hailo_examples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeGirum%2Fhailo_examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeGirum%2Fhailo_examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeGirum%2Fhailo_examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeGirum%2Fhailo_examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeGirum","download_url":"https://codeload.github.com/DeGirum/hailo_examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233655324,"owners_count":18709260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","hailo8","raspberry-pi"],"created_at":"2025-01-12T20:13:27.601Z","updated_at":"2025-09-20T10:33:04.922Z","avatar_url":"https://github.com/DeGirum.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# **Using DeGirum PySDK, DeGirum Tools, and Hailo Hardware**  \n\nThis repository provides a comprehensive guide on using **DeGirum PySDK**, **DeGirum Tools**, and **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**.  \n\n---\n\n## **Table of Contents**  \n\n1. [Introduction](#introduction)  \n2. [Prerequisites](#prerequisites)  \n3. [Installation](#installation)  \n4. [Running and Configuring Jupyter Notebooks](#running-and-configuring-jupyter-notebooks) \n5. [Additional Resources](#additional-resources) \n\n---\n\n## **Introduction**  \n\nDeGirum provides a powerful suite of tools to simplify the development and deployment of edge AI applications:  \n\n- [**DeGirum PySDK**](https://github.com/DeGirum/PySDKExamples): The core library for integrating AI inference capabilities into applications.  \n- [**DeGirum Tools**](https://github.com/DeGirum/degirum_tools): Utilities for benchmarking, streaming, and interacting with DeGirum's model zoo.  \n\nThese tools are designed to be hardware-agnostic, enabling developers to build scalable, flexible solutions without being locked into a specific platform.  \n\n---\n\n## **Prerequisites**  \n\n- **Hailo Tools Installed**: Ensure that Hailo's tools and SDK are properly installed and configured. Refer to [Hailo's documentation](https://hailo.ai/) for detailed setup instructions. Also, enable the HailoRT Multi-Process service as per HailoRT documentation:  \n\n  ```bash\n  sudo systemctl enable --now hailort.service  # for Ubuntu\n  ```  \n\n- **Hailo Runtime Compatibility**:  \n  DeGirum PySDK supports **Hailo Runtime versions 4.19.0, 4.20.0 and 4.21.0**. Ensure your Hailo environment is configured to use one of these versions.  \n\n- **Python 3.9 or Later**: Ensure Python is installed on your system. You can check your Python version using:  \n\n  ```bash\n  python3 --version\n  ```  \n\n---\n\n## **Installation**  \n\nThe best way to get started is to **clone this repository** and set up a virtual environment to keep dependencies organized. Follow these steps:  \n\n### **1. Clone the Repository**  \n```bash\ngit clone https://github.com/DeGirum/hailo_examples.git\ncd hailo_examples\n```  \n\n### **2. Create a Virtual Environment**  \nTo keep the Python environment isolated, create a virtual environment:  \n\n#### **Linux/macOS**  \n```bash\npython3 -m venv degirum_env\nsource degirum_env/bin/activate\n```  \n\n#### **Windows**  \n```bash\npython3 -m venv degirum_env\ndegirum_env\\Scripts\\activate\n```  \n\n### **3. Install Required Dependencies**  \nInstall all necessary packages from `requirements.txt`:  \n\n```bash\npip install -r requirements.txt\n```  \n\n---\n\n### **4. Add Virtual Environment to Jupyter**  \n\nIf you plan to use **Jupyter Notebooks**, ensure the virtual environment is available as a Jupyter kernel.  \n\n#### **Step 1: Activate the Virtual Environment (if not already active)**  \nIf you are not already inside the virtual environment, activate it:  \n\n**Linux/macOS:**  \n```bash\nsource degirum_env/bin/activate\n```  \n\n**Windows:**  \n```bash\ndegirum_env\\Scripts\\activate\n```  \n\n#### **Step 2: Ensure the Virtual Environment is Available in Jupyter**  \nSince `notebook` and `ipykernel` are already installed via `requirements.txt`, simply run:  \n\n```bash\npython -m ipykernel install --user --name=degirum_env --display-name \"Python (degirum_env)\"\n```  \n\nThis ensures that Jupyter recognizes the virtual environment as an available kernel.  \n\n---\n\n### **5. Verify Installation**  \n\nTo ensure that everything is set up correctly, run the provided test script:  \n\n```bash\npython test.py\n```  \n\nThis script will:  \n- Check system information.  \n- Verify that Hailo hardware is recognized.  \n- Load and run inference with a sample AI model.  \n\nIf the test runs successfully, your environment is properly configured.  \n\n\n## **Running and Configuring Jupyter Notebooks**  \n\nThis repository includes an `examples` folder containing multiple use case examples demonstrating how to run AI inference using DeGirum PySDK and Hailo hardware. You can find detailed descriptions and usage instructions for each example in the [**Examples README**](examples/README.md).  \n\n### **1. Start Jupyter Notebook**  \nNow that the Jupyter environment is set up, you can start Jupyter Notebook:  \n\n```bash\njupyter notebook\n```  \n\nThis will open Jupyter in your web browser, allowing you to navigate to the `examples` folder and run the available notebooks.  \n\n### **2. Ensure the Correct Kernel is Selected**  \nWhen opening a notebook:  \n- Go to **Kernel → Change Kernel**.  \n- Select **Python (degirum_env)** to ensure the notebook runs inside the correct virtual environment.  \n\n\n### **3. Default Notebook Settings and Customization**  \nEach Jupyter Notebook in this repository is pre-configured with default inference settings, including the inference environment, model zoo location, and target hardware. However, you can modify these values if your setup requires different configurations.\n\nBelow are the default settings you will find in the notebooks, which you can adjust as needed:\n\n#### **Select Inference Host Address**  \nThe `inference_host_address` determines where AI inference will be executed:  \n\n```python\n# Use local inference (e.g., when running on a device equipped with Hailo8/Hailo8L)\ninference_host_address = \"@local\"\n\n# Alternative: Specify a local server by IP or hostname\n# inference_host_address = \"localhost\"\n\n# Alternative: Use DeGirum AI Hub for cloud-based inference\n# inference_host_address = \"@cloud\"\n```  \n\n#### **Choose Model Zoo Location**  \nThe `zoo_url` specifies where AI models are stored:  \n\n```python\n# Use DeGirum’s cloud model zoo (recommended for Hailo models)\nzoo_url = \"degirum/hailo\"\n\n# Alternative: Use a local directory containing models\n# zoo_url = \"../models\"\n```  \n\n#### **Set Authentication Token**  \nThe `token` is required only for cloud inference with DeGirum AI Hub:  \n\n```python\n# No token needed for local inference\ntoken = ''\n\n# Alternative: Fetch token for cloud inference\n# token = degirum_tools.get_token()  # Use this when running on AI Hub\n```  \n\n#### **Specify Target Hardware**  \nThe `device_type` defines the hardware used for inference:  \n\n```python\n# Default: Hailo8L device\ndevice_type = \"HAILORT/HAILO8L\"\n\n# Alternative: Hailo8 device (Note: Hailo8L models work on Hailo8, but not vice versa)\n# device_type = \"HAILORT/HAILO8\"\n```  \n---\n## Additional Resources\n\n- [Hailo Model Zoo](./hailo_model_zoo.md): Explore the full list of models optimized for Hailo hardware.\n- [DeGirum Documentation](https://docs.degirum.com)\n- [Hailo Documentation](https://hailo.ai/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdegirum%2Fhailo_examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdegirum%2Fhailo_examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdegirum%2Fhailo_examples/lists"}