ultralytics / ultralytics

Ultralytics YOLO11 🚀
https://docs.ultralytics.com
GNU Affero General Public License v3.0
32.32k stars 6.21k forks source link

Adjust segmentation label format to support multiple polygons for one instance #6530

Closed menggui1993 closed 10 months ago

menggui1993 commented 11 months ago

Search before asking

Description

The YOLO label format for instance segmentation is like <class-index> <x1> <y1> <x2> <y2> ... <xn> <yn>

However, it is common to have occlusion in real life data. So one instance could have multiple seperated mask regions like in the following picture. The current format can only represent a single polygon for each instance. It would be helpful to support multiple polygons for each instance. The new format can be like <class-index> <x11> <y11> <x12> <y12> ... <x1n> <y1n> | <x21> <y21> ... <x2n> <y2n> ...

Screenshot from 2023-11-23 13-55-36

Use case

No response

Additional

No response

Are you willing to submit a PR?

glenn-jocher commented 11 months ago

@menggui1993 hello, thank you for bringing up this feature request regarding the handling of multiple polygons for single-instance segmentation in YOLOv8. You've highlighted an important aspect of instance segmentation in real-world scenarios, where occlusions indeed occur frequently, necessitating the capability to represent one instance with multiple separated mask regions.

Currently, as you correctly pointed out, the YOLOv8 label format for segmentation supports single continuous polygons for each instance. The ability to process and utilize multiple disconnected polygons per instance can significantly improve the accuracy in certain cases.

This is a non-trivial enhancement as it requires changes to how labels are parsed, managed, and utilized within the training and inference pipelines of YOLOv8. Therefore, the proposal would need to be carefully considered by the development team for its feasibility, implications on the codebase, and general user requirements.

Your suggested format using a separator is one way to approach this problem, though any changes must maintain backward compatibility and user-friendliness. We appreciate your input and understand the potential value this feature could add to the YOLOv8 ecosystem.

While I can't make any commitments, we'll keep this in mind for future updates. Contributions and suggestions are always welcome, as they help improve the model for everyone. You can check our documentation in the "Segmentation" section for updates or details on current capabilities. If more users request this feature or you are interested in contributing, we're open to further discussions on this topic.

Thank you once again for your interest in contributing to the Ultralytics YOLOv8 project. Your engagement is invaluable for the continuous improvement of the model.

github-actions[bot] commented 10 months ago

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐