ultralytics / hub

Ultralytics HUB tutorials and support
https://hub.ultralytics.com
GNU Affero General Public License v3.0
136 stars 13 forks source link

How to deploy a model on Raspberry Pi 5 + AI Hat with HAILO8L #759

Open norms-mv opened 4 months ago

norms-mv commented 4 months ago

Search before asking

Question

Hi, I would like to deploy the model in my Raspberry Pi. I am actually using the new AI Hat for Raspberry Pi with Hailo8L and it has some segmentation, pose, face recognition and detection examples using Yolo5 and Yolo8, and the result is incredible. It runs at 30fps, but I have no idea on how to train a new model and make my own project.

Is anyone working on this?

https://github.com/ultralytics/hub/assets/5667486/4e549cb9-41c6-47af-907d-6aa7454387f7

github-actions[bot] commented 4 months ago

πŸ‘‹ Hello @norms-mv, thank you for raising an issue about Ultralytics HUB πŸš€! Please visit our HUB Docs to learn more:

If this is a πŸ› Bug Report, please provide screenshots and steps to reproduce your problem to help us get started working on a fix.

If this is a ❓ Question, please provide as much information as possible, including dataset, model, environment details etc. so that we might provide the most helpful response.

We try to respond to all issues as promptly as possible. Thank you for your patience!

pderrenger commented 4 months ago

@norms-mv hello!

Thank you for reaching out and sharing your interest in deploying YOLO models on a Raspberry Pi 5 with the AI Hat featuring the HAILO8L. It's great to hear that you're seeing impressive results with the pre-existing examples!

To train a new model and create your own project, you can leverage the Ultralytics HUB, which simplifies the process significantly. Here’s a step-by-step guide to get you started:

  1. Prepare Your Dataset: Ensure your dataset is properly annotated and formatted. You can find detailed instructions on how to prepare and upload your datasets in the Datasets section of the HUB documentation.

  2. Train Your Model: Use the Ultralytics HUB to train your custom YOLOv5 or YOLOv8 model. The HUB provides an intuitive interface to configure your training parameters. For a quick start, refer to the Quickstart guide.

  3. Export Your Model: Once your model is trained, you can export it to various formats suitable for deployment. Detailed instructions are available in the Models section.

  4. Deploy on Raspberry Pi: For deploying on the Raspberry Pi with the HAILO8L, you will need to convert your model to a format compatible with the Hailo SDK. The Hailo SDK documentation should provide guidance on how to integrate your YOLO model. Additionally, you might find the Integrations section useful for exploring different deployment options.

Here is a basic example of how you might start training a model using the Ultralytics HUB:

from ultralytics import YOLO

# Load a model
model = YOLO('yolov8n.yaml')  # or 'yolov5s.yaml' for YOLOv5

# Train the model
model.train(data='path/to/your/dataset.yaml', epochs=100)

For more detailed instructions, please refer to the Ultralytics HUB documentation.

If you encounter any issues or need further assistance, feel free to raise an issue here or join our Discord community for discussions and support.

Best of luck with your project, and happy modeling! πŸš€

dunz21 commented 3 months ago

@norms-mv Finally do you get to advance in your project? I have been training a model, also I want to do it also in a raspberry pi 5 just like you, contact me dsepul21 gmail

saurabh-git-dev commented 2 months ago

I am also looking for an example? Any update on this.

glenn-jocher commented 2 months ago

@saurabh-git-dev hello! 😊

To deploy a YOLO model on a Raspberry Pi with the Hailo8L AI Hat, you'll want to follow these general steps:

  1. Train Your Model: Use Ultralytics HUB to train your custom YOLOv5 or YOLOv8 model. You can start by uploading your dataset and selecting a pre-trained model to fine-tune.

  2. Export the Model: Once trained, export your model to a format compatible with the Hailo8L. Typically, this involves converting the model to ONNX or another supported format.

  3. Set Up the Raspberry Pi: Ensure your Raspberry Pi is configured with the necessary dependencies and libraries. You may need to install the Hailo SDK to interface with the AI Hat.

  4. Deploy the Model: Load the model onto your Raspberry Pi and use the Hailo SDK to run inference. The SDK should provide examples and documentation to help with this process.

  5. Optimize for Performance: Adjust settings and configurations to achieve optimal performance, such as batch size and inference precision.

For more detailed guidance, you might want to check out the Hailo documentation and community forums, as they can provide specific instructions for their hardware.

If you have any more questions or need further assistance, feel free to ask! πŸš€

For additional resources, you can also explore the Ultralytics HUB documentation.