ultralytics / ultralytics

NEW - YOLOv8 ๐Ÿš€ in PyTorch > ONNX > OpenVINO > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
23.76k stars 4.74k forks source link

<A bug in Data Augmentation>YOLOv8-OBB #11246

Open Wangfeng2394 opened 2 weeks ago

github-actions[bot] commented 2 weeks ago

๐Ÿ‘‹ Hello @Wangfeng2394, 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.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

pip install ultralytics

Environments

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

Status

Ultralytics CI

If 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.

glenn-jocher commented 2 weeks ago

@Wangfeng2394 hi there! Thanks for bringing this to our attention. It looks like there might be an issue with the OBB labels in the data augmentation process for specific images.

To better diagnose and potentially resolve this issue, could you please provide a snippet of the code you're using for the data augmentation? Additionally, checking if the problematic images have anything in common (such as unusual aspect ratios or annotations) might be helpful.

Here's a general check you can perform to ensure that your annotations are being read correctly:

from ultralytics import YOLO
model = YOLO('path/to/your/model.yaml').load('path/to/your/model.weights')
dataset = model.load_data('path/to/your/data.yaml')
print(dataset[0]['labels'])  # Check the first image labels

This will help confirm whether the issue is occurring during the initial data loading or during the augmentation process.

Let me know if this helps or if you need further assistance!

Wangfeng2394 commented 2 weeks ago

I

Wangfeng2394 commented 2 weeks ago

I try to confirm as your according to your guidance, but It seem like my "YOLO" object has no attribute 'load_data'.

ๅพฎไฟกๅ›พ็‰‡_20240505033616
glenn-jocher commented 2 weeks ago

Hey there! ๐Ÿ‘‹ It looks like there's a small confusion. The correct method to load data directly isnโ€™t available like that. Instead, you can verify your dataset's labels during training with the displayed batch samples in your train_batch0.jpg or by utilizing the DataLoader like this:

from ultralytics import YOLO, Dataloader

# Load your model
model = YOLO('models/v8/yolov8-obb.yaml').load('Traning_Large/best.pt')

# Create a DataLoader
loader = Dataloader('datasets/my.yaml', img_size=model.imgsz, batch_size=model.batch, stride=model.stride)

# Access an image and its labels
img, labels, _, _ = next(iter(loader))
print(labels)  # Display labels

This way, you can check if labels are loaded correctly as part of your verification process. Let me know if this clears things up or if there's anything else you need! ๐Ÿ˜Š

Wangfeng2394 commented 2 weeks ago

Thanks for your help and patience patience๏ผ

ImportError: cannot import name 'Dataloader' from 'ultralytics' (C:\Users\admin.conda\envs\yolov8\lib\site-packages\ultralytics__init__.py)

so how can I get Dataloader ๏ผŸ It seem like 'Dataloader' in my 'ultralytics' ใ€‚

Wangfeng2394 commented 2 weeks ago

Could you please use the data I provided above to check it๏ผŸ๐Ÿ˜Š

glenn-jocher commented 1 week ago

@Wangfeng2394 hi there! ๐Ÿ˜Š

Thank you for providing the data! Since you've already shared some data details in previous comments, I'll use that information for debugging. I recommend running local checks or visual inspections on specific data samples you're concerned about to see if there's a clear discrepancy or error in how labels are being applied during training.

In the meantime, if you wish to test out specific scenarios, feel free to adjust your code as needed and re-check the outputs. If you continue to encounter problems, providing more data examples, or describing in detail the discrepancies you notice, can help us assist you better!

Thanks for your cooperation! ๐Ÿš€

Wangfeng2394 commented 1 week ago

@Wangfeng2394 hi there! ๐Ÿ˜Š

Thank you for providing the data! Since you've already shared some data details in previous comments, I'll use that information for debugging. I recommend running local checks or visual inspections on specific data samples you're concerned about to see if there's a clear discrepancy or error in how labels are being applied during training.

In the meantime, if you wish to test out specific scenarios, feel free to adjust your code as needed and re-check the outputs. If you continue to encounter problems, providing more data examples, or describing in detail the discrepancies you notice, can help us assist you better!

Thanks for your cooperation! ๐Ÿš€

Okay, please let me know as soon as possible. Thank you I will also continue to provide feedback on my information

glenn-jocher commented 1 week ago

@Wangfeng2394 Thanks for your response and willingness to keep the feedback coming! ๐ŸŒŸ I'll get back to you as soon as I have an update based on the debugging. In the meantime, any additional information you provide will be incredibly helpful. Happy testing! ๐Ÿ˜Š