Yolov5: How to get the related class labels from Mosaic augmentation?

Created on 15 Oct 2020  路  7Comments  路  Source: ultralytics/yolov5

I'm trying to get the related class label from mosaic augmentation for multi-class object detection. I'm not using Yolo5 but the mosaic implementation in my case inspired by Yolo implementation. I described my query in more detail over here, SO. Please, have a look.

question

Most helpful comment

The problem is solved. Here is the answer, leaving it here for future readers.

All 7 comments

Hello @innat, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook Open In Colab, Docker Image, and Google Cloud Quickstart Guide for example environments.

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom model or data training question, please note Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:

  • Cloud-based AI systems operating on hundreds of HD video streams in realtime.
  • Edge AI integrated into custom iOS and Android apps for realtime 30 FPS video inference.
  • Custom data training, hyperparameter evolution, and model exportation to any destination.

For more information please visit https://www.ultralytics.com.

@innat if you are looking for multi-class object detection, I would simply use YOLOv5, which already incorporates all the mosaic augmentation you want.

@glenn-jocher Could you please point me to the specific code snippet where the mosaic augmentation in Yolo5 deals with such cases? So, that I can understand when it randomly making a mosaic, how it tracks the labels in final results.

@innat of course. load_mosaic() in datasets.py is responsible for all mosaic activity. Your dataset trains with Mosaic by default in YOLOv5, no extra action is needed on your part, simply python train.py --data custom.yaml

https://github.com/ultralytics/yolov5/blob/4d3680c81dad760e5d1ffe397ab2fc9169d9fb70/utils/datasets.py#L643-L699

You can also view your mosaics during training. Suggest you start with the custom training tutorial, it explains all of this already.
https://github.com/ultralytics/yolov5#tutorials

train_batch0

Thanks for the pointer and suggestion. -)

The problem is solved. Here is the answer, leaving it here for future readers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

we1pingyu picture we1pingyu  路  3Comments

nanometer34688 picture nanometer34688  路  3Comments

cswwp picture cswwp  路  4Comments

dereyly picture dereyly  路  4Comments

Single430 picture Single430  路  4Comments