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

YOLOv8 OBB detection angle issue #12696

Open
1 task done
CCCCccc8825 opened this issue May 15, 2024 · 2 comments
Open
1 task done

YOLOv8 OBB detection angle issue #12696

CCCCccc8825 opened this issue May 15, 2024 · 2 comments
Labels
question Further information is requested

Comments

@CCCCccc8825
Copy link

Search before asking

Question

Hello! First of all, thank you very much for your team's outstanding contributions! I am using YOLOv8OBB to complete my own project, but I have noticed some issues: the angle of the detection object is always between [0180 °], and there is no distinction between the head and tail of the object recognition. I am not sure if it is because the model itself cannot recognize the difference between 0 ° and 180 °, or if it is a problem with my own dataset or operation. How can I achieve directed detection of yolov8-OBB to detect the head and tail of the target object? What modifications should I make to which item in the source file?

Additional

Secondly, I read the head.py in the model and found that according to theory, the output angle after detection should be between -45 ° and 135 °, but my output angle is between 0 ° and 180 °. What is the reason for this?

@CCCCccc8825 CCCCccc8825 added the question Further information is requested label May 15, 2024
Copy link

👋 Hello @CCCCccc8825, 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
Copy link
Member

Hello! Thanks for reaching out and for your kind words about the project. It’s great to hear you're making use of YOLOv8 OBB for your own projects!

Regarding the OBB angle outputs, the model itself provides angle predictions that typically cover the 0° to 180° range, leveraging cosine and sine encoding which inherently consider angles symmetrical around 180° (making 0° indistinguishable from 180°). To enable directed detection and differentiate between the head and tail of objects, you might need to adjust or extend the model architecture to encode additional directional information or consider post-processing techniques that incorporate context or sequence data.

For the discrepancy in angle ranges from what you expected based on head.py, it’s possible that the observed behavior might result from different configurations or interpretations. OBB outputs use the atan2 function, which should provide a range of [−π, π] (or in degrees, -180° to 180°), adjusted to [0°, 180°] for practical use and symmetry. If this isn’t the case, I recommend reviewing the data preprocessing and augmentation stages and how the angles are manipulated or constrained during these phases.

Your insights and queries help improve YOLOv8, so I appreciate your detailed exploration. If this doesn't resolve your issue, consider providing a minimal reproduction of the error, and we can investigate further! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants