Replies: 3 comments 1 reply
-
👋 Hello @vshas, thank you for sharing your detailed use case and for your interest in Ultralytics 🚀! Your implementation of a custom dataset and dynamic data loading setup for YOLOv8 segmentation tasks is fascinating, and I'm sure the community will greatly benefit from this discussion. 😊 We understand the challenges you’ve faced in integrating your custom dataset into the YOLOv8 training pipeline. Although this particular setup may require some extra steps, it seems like it can definitely work with the right modifications. We'll do our best to help guide you! If this is a 🐛 Bug Report—i.e., something appears broken—please ensure that the issue is reproducible and provide a minimum reproducible example (MRE) that isolates the problem. It allows us to better identify any potential bugs within the training process or framework integration. Your code snippet offers a great starting point, so thank you for sharing that! 🙌 If this is a ❓ Custom Training Inquiry, here are a few suggestions to further refine your setup:
Additionally, to debug effectively and streamline experimentation:
pip install -U ultralytics
If you’re interested in community exchange, you can also join us on Discord 🎧 for real-time discussions or post your progress and questions on our Discourse or Subreddit! Lastly, stay tuned for assistance from an Ultralytics engineer who will take a closer look at your code and setup soon. Thank you again for your patience and for diving into the YOLOv8 framework—your efforts contribute greatly to the improvement of the ecosystem. 🚀✨ |
Beta Was this translation helpful? Give feedback.
-
@vshas your custom dataset must output images and labels exactly as expected by our segmentation pipeline—ensure your dynamic cropping, transforms, and annotations align with YOLO's required format. |
Beta Was this translation helpful? Give feedback.
-
For anyone with a similar issue please also see #10174. At that thread there is some back and forward but I think the answer is that you have to figure it out yourself. Basically get deep into the ultralytics source code and make it work. |
Beta Was this translation helpful? Give feedback.
-
I want to use a dataloader/dataset that generates training examples on the fly. As opposed to the standard (static) situation of having directories with images and masks/labels. In my specific example I am considering a segmentation task where I have several, big, images with the corresponding masks. As a means of data augmentation I want to sample/cut from each big image/mask pair, a smaller image/mask pair to use as training example. In this way I can augment my data and it is also easier to label medium amount of big images vs a high amount of small images. Now I have tried to train the 'yolov8n-seg.pt' model using a custom Dataset (torch.utils.data) and accompanying DataLoader. But even after quite some time hacking, I cant get it to work. Here is my code:
You can clearly see my hacking attempts in the
get_dataset
method to circumvent the dataset.yaml. I also tried it with dataset.yaml but I could not get it to work nonetheless. Can somebody explain to me what I am doing wrong? Or is this kind of thing not supported? I do not believe I am doing very exotic stuff here. Thanks in advance!Beta Was this translation helpful? Give feedback.
All reactions