Skip to content
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

There seems to be a bug in the Mosaic data augmentation? #1020

Closed
haoyuefan opened this issue Sep 23, 2020 · 7 comments
Closed

There seems to be a bug in the Mosaic data augmentation? #1020

haoyuefan opened this issue Sep 23, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@haoyuefan
Copy link
Contributor

haoyuefan commented Sep 23, 2020

I visualized the Mosaic data augmentation and found that some of the labels wrong shifted after the data augmentation. After debugging, I find there seems to be a problem with this line of the load_mosaic function:
x1b, y1b, x2b, y2b = w - (x2a - x1a), 0, max(xc, w), min(y2a - y1a, h)
the line 664 of dataset.py, I want to ask if this line should be changed:
x1b, y1b, x2b, y2b = w - (x2a - x1a), 0, w, min(y2a - y1a, h)
because in the bottom left patch of mosaic image, the xmax point of source image shouldn't be changed.
Hope you can reply me soon, thank you.

@haoyuefan haoyuefan added the bug Something isn't working label Sep 23, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Sep 23, 2020

Hello @yuefanhao, 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.

@gengyanlei
Copy link

@yuefanhao
I also found this problem, but it has no effect.

@haoyuefan
Copy link
Contributor Author

@yuefanhao
I also found this problem, but it has no effect.

But it will create wrong label shift when I visualized the mosaic image with my own datasets, have you visualized the mosaic image?

@gengyanlei
Copy link

I used yolov5 to train my own data set and found no abnormalities. But when I studied mosaic code, I found this error by reasoning, but it didn't affect the image.
For example: a=np.ones([10,10,3]), a[:10] and a[:14] are equivalent.

@haoyuefan
Copy link
Contributor Author

I used yolov5 to train my own data set and found no abnormalities. But when I studied mosaic code, I found this error by reasoning, but it didn't affect the image.
For example: a=np.ones([10,10,3]), a[:10] and a[:14] are equivalent.

ok, I understand that, thank you.

@glenn-jocher
Copy link
Member

@gengyanlei @yuefanhao thanks for the bug report! Can you show an image of the mislabelled instances?

Would you like to submit a PR for this change?

@glenn-jocher
Copy link
Member

@gengyanlei @yuefanhao I'm removing the TODO label and closing this issue, as this has been resolved in PR #1021 submitted by @yuefanhao and merged a few weeks ago. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants