-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Loss of "iscrowd" annotations when converting COCO dataset to YOLOv8 dataset #12671
Comments
👋 Hello @astringfield, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered. If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it. If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results. Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users. InstallPip install the pip install ultralytics EnvironmentsYOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit. |
Hi there! The current implementation of the For instance, you could manually preprocess and separate out the Let me know if you need further guidance! Happy coding! 😊🚀 |
@glenn-jocher thank you! I appreciate your advice. I have a follow-up question if you wouldn't mind, please. A few more details about my application:
Below is a sample image from my dataset. It's feasible to annotate some individual This is where I planned to utilise pixel segmentation masks and make annotating these grouped objects more efficient. Separating the grouped Do you have any recommendations on how these groups of trees could be annotated in a way that's compatible with the YOLOv8 format for instance segmentation? I'd be grateful for any suggestions you have 🙂 |
Hi there! 😊 Thank you for sharing more about your project. When dealing with clustered objects like trees where the boundaries aren't clear, one approach could be to annotate the entire cluster as a single object. This can be treated as a special class, say For instance segmentation with YOLOv8, you can continue using pixel segmentation masks which are quite effective for such scenarios. Here’s a snippet on how you might define these classes in your dataset annotations: names:
- tree # individual trees
- tree_cluster # groups of trees This approach should help maintain consistency in your annotations without confusing the model during training. Let me know if this helps or if you need more information! 🌳 |
@glenn-jocher thanks! The clustering idea is a fantastic suggestion and it'll apply to a few other classes in my application - I'll try it out. I do have a couple of follow-up questions, please. To first clarify the terminology I use:
Q1. Q2.
how would I use pixel segmentation masks for objects in this dataset? Should I ensure all annotations are defined as polygons to make them compatible with the COCO->YOLO converter? Q3. Q4. That's a lot of questions I know, I hope you don't mind! Thanks again 🙂 |
@astringfield hi there! 😄 Great to hear that the clustering idea resonates with your project! Regarding your questions: Q1 & Q3: YOLOv8 primarily supports annotations in the form of bounding boxes and does not directly handle pixel segmentation masks. For traditional instance segmentation, polygons represented as masks (often converted to a specific bounding shape in YOLO) are more widely used. Pixel-wise segmentation masks are typically not utilized in the YOLO architecture. Q2: For compatibility with the COCO->YOLO converter, you should indeed ensure all annotations are defined as polygons. This also aligns with YOLO's preference for geometric bounding annotations over pixel-wise masks. Q4: In the training of YOLOv8 models on the COCO dataset, I hope this helps clarify your concerns! If you have any more questions or need further assistance, feel free to ask. Happy training! 🌲☀️ |
@glenn-jocher thank you for the detailed insights, the information you've provided is very helpful. Regarding Q4 - with the Were there any issues during model training/validation/testing due to some images containing unlabelled instances? For example, did the model ever get "confused" (or perform poorly in some other way) because some of the images contained unlabelled |
Hi there! 😊 I'm glad you found the information helpful! Regarding your question about the impact of skipping In practice, skipping these annotations does mean that some objects like If performance issues are noticed in specific scenarios, additional fine-tuning with more representative data of those scenarios can help improve the model's accuracy. Let me know if you need more details or further assistance! Happy modeling! 🚀 |
@glenn-jocher That makes sense - It's great to know how crowd data can be excluded for efficiency without loss in model performance using suitable mitigation. I really appreciate your time answering my questions - thanks again 😃 |
@astringfield You're very welcome! I'm glad I could help clarify your queries. If you have any more questions down the line or need further assistance, feel free to reach out. Happy training! 😊🚀 |
Search before asking
Question
Hi,
I'm trying to convert a custom COCO-formatted dataset to YOLOv8 format so that I can train YOLOv8 using my custom data.
I've run the Ultralytics data conversion tool to convert from COCO to YOLOv8, but the output annotations don't contain any of the COCO annotations where
iscrowd = True
.I checked out the
ultralytics/data/converter.py
code and indeed it does appear to skip anyiscrowd
annotations:I've searched the YOLOv8 docs regarding the COCO dataset and haven't found any information on the handling of
iscrowd
pixiel-mask annotations.Is there a way to include the pixel segmentation masks when converting to a YOLOv8 dataset?
Thanks!
Additional
No response
The text was updated successfully, but these errors were encountered: