ultralytics / ultralytics

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

Why is YOLOv8_ OBB not very good at square rotating detection? #11676

Open zyiiiiiii opened 1 week ago

zyiiiiiii commented 1 week ago

Search before asking

Question

Hi All, why is YOLOv8_ OBB not very good at square rotating detection? I have tried many times, the model still can not detect the square rotational objects, like images as follow. But for the square horizontal objects, rectangle horizontal objects and rectangle rotational objects, the model can detect well. It looked like that the model have some challenges to detect square rotational objects.

I look through all of the issues, this issue https://github.com/ultralytics/ultralytics/issues/9394 had a similar problem, but I still want to get more help to fix this problem. Thanks in advance.

Additional

From the image we can see that for most of square rotational objects the output bounding boxes always looked like horizontal not rotational. val_batch0_pred

glenn-jocher commented 1 week ago

Hello! It seems like the issue with detecting square rotational objects may stem from the inherent challenges that square objects pose when rotated, as their symmetry can make orientation ambiguous to the model. One potential way to enhance detection capabilities for square rotational objects is to consider augmenting your dataset with more varied examples of these objects in multiple orientations and contexts. Also, if not already done, experimenting with adjustments to the detection thresholds and the anchor settings might prove beneficial.

Here's a basic example of how you might experiment with hyperparameters to adjust the detection settings:

# Example using Python
from ultralytics import YOLO

# Load your model
model = YOLO('path/to/your/model.pt')

# Adjust confidence and intersection over union thresholds
results = model.predict('path/to/image.jpg', conf=0.4, iou=0.6)

# Explore results
print(results.pandas().xyxy[0])  # Print predictions in bounding box format

If further tuning does not yield improvements, consider revisiting the data labeling to ensure rotational variances are accurately captured and represented. If you continue to experience difficulties, feel free to share more details or reach out for more specific guidance! 🚀

Wangfeng2394 commented 1 week ago

I have also encountered such a problem,yolov80bb seems insensitive to angles。

zyiiiiiii commented 1 week ago

I have also encountered such a problem,yolov80bb seems insensitive to angles。 @Wangfeng2394 Especially for square rotational objects, right? In my case, the model can not detect the square rotational objects well, but for the rectangle rotational objects, it did a good job.

Wangfeng2394 commented 1 week ago

I have also encountered such a problem,yolov80bb seems insensitive to angles。 @Wangfeng2394 Especially for square rotational objects, right? In my case, the model can not detect the square rotational objects well, but for the rectangle rotational objects, it did a good job.

If you are chinese,give me your WeChat(微信) ID

glenn-jocher commented 1 week ago

Hello! It sounds like you're encountering some specific challenges with YOLOv8_OBB's sensitivity to square rotational objects. Unfortunately, I'm unable to provide support using WeChat. For further assistance and to keep discussions accessible to the entire YOLO community, let's continue our conversation here or on the official GitHub repository. This will also help others who might be facing similar issues. If you have detailed logs or code snippets, feel free to share them here, and we can work together to find a solution! Thank you for your understanding. 🙌

Leo5050xvjf commented 1 week ago

@Wangfeng2394 Hi, I have encountered the same issue in this situation. Have you found a solution to this problem? thx

Wangfeng2394 commented 1 week ago

@Wangfeng2394 Hi, I have encountered the same issue in this situation. Have you found a solution to this problem? thx

qq id or wechat id?

glenn-jocher commented 1 week ago

Hello! I'm glad to see the community coming together to solve these issues. 🚀 However, I recommend discussing solutions here or in officially supported channels like GitHub Discussions to benefit everyone. If you have made any progress or experiments you can share (like code adjustments or dataset augmentations), please do share them here! This way, all users facing similar challenges can benefit from your findings. Thanks!

Sldora commented 18 hours ago

got same issue as well, I guess that's due to the limitation of prob-IoU, change loss function to MSE would get better(at least the bounding box did rotate) but not sure it's precision good enough