ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.56k stars 16.3k forks source link

Strange appearance of the mosaic #11604

Closed jakubsadel closed 1 year ago

jakubsadel commented 1 year ago

Search before asking

Question

I have a question about the strange appearance of the input image mosaic created before training. What can cause it to look like it does in my case?

train_batch0

My input size is 640x360, and I specified 640 as the -img argument. Why does it jitter so much, what am I doing wrong? In addition to the strange shape of the images, I see that the labels also appear in strange places. Any suggestions?

Regards Jakub

Additional

No response

github-actions[bot] commented 1 year ago

👋 Hello @jakubsadel, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

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.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

YOLOv5 CI

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

Introducing YOLOv8 🚀

We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀!

Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.

Check out our YOLOv8 Docs for details and get started with:

pip install ultralytics
glenn-jocher commented 1 year ago

@jakubsadel hello Jakub,

Thank you for reaching out and providing the details of the strange appearance of the input image mosaic you created before training. From the image you shared, it looks like the images and labels are jittering, and the labels are appearing in strange places.

Based on your input size and -img arguments, there could be several reasons why this is happening. One possibility is that your input images might have different sizes, which could cause the images to jitter and the labels to appear in different locations. To fix this problem, you could preprocess your data to ensure that all input images have the same size.

Another possibility is that your images might have a low resolution or be of poor quality, which could affect the output of your training. You could try using images with a higher resolution or improving the quality of your images to get better results.

I hope this helps, and if you have any more questions or concerns, please feel free to ask.

Best regards.

usapeshka commented 1 year ago

@glenn-jocher Thanks for your response. Could you please clarify a bit more on why a training dataset with different image sizes could be a cause of the problem described? Additionally, are there any other known and verified issues that a nonuniform (in dimensions) image dataset could cause? Thank you in advance!

glenn-jocher commented 1 year ago

@usapeshka hello!

Thanks for following up with your question. The reason that a training dataset with different image sizes could cause issues is that YOLOv5 requires input images to have the same dimensions. If the dimensions are different, the model might have difficulty detecting objects consistently or it might result in incorrect detections.

When training on a dataset with different image sizes, one way to address this issue is to preprocess the data to ensure all images have the same dimensions. A tool like imgaug could be used to resize images and make them uniform-sized.

As for other known issues, another possible issue could be related to the anchor boxes used by YOLOv5 during training. These anchor boxes are based on the dataset used for training and if the images being trained on have different dimensions, the anchor boxes may not work well, leading to incorrect object detection.

I hope this response helps to clarify your doubts. If you have any further questions, please don't hesitate to ask.

github-actions[bot] commented 1 year ago

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

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 YOLO 🚀 and Vision AI ⭐