This guide will walk you through creating and structuring your community project in the repository.
Ensure your environment is set up properly by following the repository instructions and successfully running the basic pipelines. This step verifies your setup.
Familiarize yourself with the basic pipeline by reading the documentation here.
Navigate to the community_projects
folder and create a directory for your project:
cd community_projects
mkdir <your_project_name>
cd <your_project_name>
Copy the contents of the template example to your project directory:
cp ../template_example/* .
The following sections explain how to build your project based on the existing basic pipelines.
- Update the callback class, which inherits from
app_callback_class
. - Add the necessary members and methods to customize your application's behavior.
- Inside your callback class, define a callback function.
- This function will handle data from the pipeline and can include your custom logic.
- Update the
main
function to initialize and run your application. - Replace
GStreamerDetectionApp
with the appropriate GStreamer application for your use case.
This structure ensures your project can run as a standalone script.
If your project requires a new pipeline:
- Use the existing pipelines as references.
- You must inherit from the
GStreamerApp
template class for consistency and maintainability. - Note: We may consider incorporating your pipeline into the core codebase if it is generic, well-tested, and addresses a broader need.
Basic Pipelines are optimized for high performance and frame rates. However, there are scenarios where you might prefer an alternative approach, here are some examples:
- Running a single inference job on demand for a specific service.
- Switching between multiple networks and tasks dynamically.
- Using special preprocessing stages or data types unsupported by Basic Pipelines.
- Our pipelines leverage GStreamer, which is built for video and audio data. For more information, refer to the GStreamer documentation.
We encourage projects that explore alternative approaches. We will add our 'native' examples as well If your project does not use Basic Pipelines, please ensure you include comprehensive documentation and installation instructions.
We are working on a "Community Model Zoo" to allow users to share models and post-processes on our servers. Meanwhile, follow these steps:
- Save your HEF file on a file-sharing service like Google Drive.
- Provide a
download_resources.sh
script to automate the download. - If you develop a new post-process:
- Add the necessary code and a compilation script.
- Refer to the Hailo Apps Infra repository for guidance on creating and compiling new post-processes.
See the template example README.md for guidance on updating your project files.
To contribute your project or improvements:
- Submit a PR to the
dev
branch of the repository. - Your code should remain within your
community_projects/<your_project_name>
directory. PRs modifying core code will be rejected. - If you must alter core code for your project:
- Copy the relevant code into your directory and modify it as needed.
- Alternatively, suggest manual edits in your instructions.
- Be aware: This approach may cause compatibility issues in future releases due to lack of backward compatibility. Breaking your code.
Suggestions for improving the core codebase are welcome. However, they must be generic, well-tested, and adaptable to multiple platforms. If you identify missing functionality in our framework, you are welcome to implement it in your project directory. Exceptional features or common functions might be integrated into our core codebase. Important: Code added to the core must meet these requirements:
- Thoroughly tested and verified.
- Generic and adaptable to multiple platforms.
By adhering to these guidelines, you help maintain the repository's stability and enable better integration of your work.
- Avoid adding non-code files (e.g., images, HEFs, videos) directly to the repository.
- Use a
download_resources.sh
script to fetch these files from external sources like Google Drive. - For Model Zoo HEFs, download them directly from Hailo's servers.
We are committed to fostering a welcoming and inclusive community. Please ensure that your contributions adhere to the following guidelines:
- Use clean and non-offensive language.
- Be respectful and considerate of others.
- Avoid any form of harassment or discrimination.