-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions about segment support. #2565
Comments
@glenn-jocher would you please give some comments? Thanks very much. |
@Edwardmark yes, YOLOv5 now has partial support for segmentation labels. Currently segmentation labels of the following format are supported: img.txt file of the following format (each row can be any length, and row lengths can vary within a file).
rather than the current box format
This allows for better bounding box transformation during augmentation (rotation, scale, translation, etc.), helping to reduce some problems associated with augmenting box labels such as #2151. We do not have support for full segmentation training yet though, which would require substantial changes to model architectures and training pipelines (IoU functions, test metrics, visualization tools, etc.). We are hoping to introduce this at some point but I don't have a timeline for you at the moment. |
@glenn-jocher so the segment is only used for augmentation, but not for real segmentation task, is that right? |
@glenn-jocher but how the bbox is provided? I think the bbox and segmentation coordinates should be provided both. |
@Edwardmark the segmentation labels naturally contain their own extents, so converting a segment into a box is super easy: Lines 287 to 293 in ad05e37
When loading the data, the YOLOv5 dataloader examines each label to determine whether it is a segment label or a box label: Lines 465 to 471 in ad05e37
Actual segmentation models have very different architectures than detection models. For a segmentation version of YOLOv5 you'd basically want the backbone followed by an inverted backbone to return the image to the original size. Also depending on the segmentation task (semantic or instance) the output may be quite complicated, particularly for instance segmentation. |
@glenn-jocher Thanks, buddy. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
what if the mask of a single object can not be represented with a single polygon line label ? such as separated parts mask or there is a hole in a mask polygon. Any more strong representation of mask label ? @glenn-jocher |
Is there any progress with segmentation update? I am excited to see the Yolov5 with instance segmentation. |
👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs. Access additional YOLOv5 🚀 resources:
Access additional Ultralytics ⚡ resources:
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 YOLOv5 🚀 and Vision AI ⭐! |
@glenn-jocher How do I get annotations like “class x1, y1, x2, y2, x3, y3, ... xn, yn” in a VOC dataset? Why is x1y1 presented in # 2188 in decimal form? |
@jieruyao49 I don't know about VOC segmentations. If they are available you'd have to convert them to the above YOLO segmentation format for use with YOLOv5. |
Using the script general_json2yolo.py, you can convert the RLE mask with holes to the YOLO segmentation format. The RLE mask is converted to a parent polygon and a child polygon using
The RLE mask. The converted YOLO segmentation format. To run the script, put the COCO JSON file coco_train.json into Edit use_segments and use_keypoints in the script.
To convert the COCO bbox format to YOLO bbox format.
To convert the COCO segmentation format to YOLO segmentation format.
To convert the COCO keypoints format to YOLO keypoints format.
This script originates from Ultralytics JSON2YOLO repository. |
@ryouchinsa sorry for any confusion, but I wanted to clarify that the repository you mentioned at https://github.com/ryouchinsa/Rectlabel-support/ is not an official Ultralytics repository. If you find the scripts useful, feel free to use them, but since they are not part of the official YOLOv5 repository, the Ultralytics team cannot provide official support for them. If you have any inquiries related to the YOLOv5 repository, feel free to ask! |
@glenn-jocher, we will make a PR about this script to your official repository. Please let us contribute to your official repository if this script would be useful for your company and users. |
@ryouchinsa thank you for your interest in contributing! We appreciate your willingness to share your script. Before making the PR, please note that any contributions to the official YOLOv5 repository need to align with the project's guidelines and goals. Feel free to submit your PR, and our team will review it. We value community contributions that benefit the YOLOv5 user community. |
❔Question
There exists some code about segments, so does yolo-v5 support train detector like mask-rcnn with segmentation prediction?
Additional context
Could you please provide usage to train like mask-rcnn? Thanks in advance.
The text was updated successfully, but these errors were encountered: