Replies: 2 comments
-
👋 Hello @MoAbbasid, thank you for your interest in Ultralytics 🚀! Extending YOLOv8 for regression tasks is an exciting challenge, and we’re happy to support you! Here’s how you can proceed: If this is a 🐛 Bug Report, we’ll need a minimum reproducible example to help debug any issues during your implementation. For a custom training ❓ Question, like yours, additional details about your setup will help guide our support. This can include configuration details, snippets of your dataset structure, and training logs. Also, consider reviewing best practices for designing custom tasks, as this can often make the difference in achieving optimal results. UpgradeMake sure your environment is up to date with the latest version of pip install -U ultralytics EnvironmentsTesting your custom modification in verified development environments, such as notebooks with preconfigured GPUs or any up-to-date cloud platforms, can help ensure a smooth workflow. Proper dependencies and configurations for libraries like Python, PyTorch, and CUDA are crucial for avoiding runtime issues. YAML and Manual ModificationsYour YAML snippet looks like a good start for adding a regression head. However, you’re correct that additional configuration will be needed for the loss function and potentially the dataloader if your input/output structure deviates from standard YOLO implementations. If you choose the manual stripping route, you’ll need to reconfigure the following components:
Both approaches have their merits. YAML modifications are simpler, but manual adjustments provide greater flexibility. An Ultralytics engineer will review your discussion shortly and provide more tailored guidance based on your specific use case 😊. In the meantime, feel free to share more details about your dataset structure and the intended outputs! |
Beta Was this translation helpful? Give feedback.
-
@MoAbbasid thank you for your detailed query! Modifying the YAML is a good starting point for adding a regression head, but you are correct that defining a suitable loss function is also necessary to handle the additional regression outputs effectively. Here's a breakdown:
For additional guidance, refer to the Ultralytics YOLO documentation. Let us know if you need further clarification! |
Beta Was this translation helpful? Give feedback.
-
Hi Ultralytics team,
I’m extending YOLOv8 to predict clearance values (4 outputs) alongside detection.
My input is basically the same just plus 4 cm values added in the labeling file (is this the correct approach)
I’m considering two approaches:
Modifying the YAML to add a regression head.
Manually stripping the torch backbone and configuring the head, loss, and dataloader.
For the YAML approach, I’ve added this snippet:
My questions are:
-What is the preferred way of making changes?
-Is modifying the YAML like I did enough? I need to define the loss somewhere right?
-If manual stripping is better, what changes are needed (the dataloader, loss function, head configuration) or more? am I missing something?
your guidance is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions