Giter VIP home page Giter VIP logo

Comments (4)

github-actions avatar github-actions commented on June 17, 2024

πŸ‘‹ Hello @1005183361, 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.

from ultralytics.

glenn-jocher avatar glenn-jocher commented on June 17, 2024

@1005183361 hi there! πŸ‘‹

For obtaining orientation angles from YOLOv8-obb (oriented bounding boxes) within the 0-360 degree range, you can ensure that the angle output from the model is properly normalized and adjusted. If the output doesn't directly reflect this range, you might need to convert or adjust the predictions accordingly.

In the case that your model outputs angle predictions in radians or another scale, you can convert these to degrees using a simple calculation in Python:

import numpy as np

# Example angle in radians
angle_rad = model_output_angle  # This would be your model's angle output in radians
angle_deg = np.degrees(angle_rad) % 360  # Converts to degrees and normalizes to 0-360

Ensure that you apply this conversion after you receive the angle output from your model predictions. If further tweaks are necessary, it could involve modifications in the post-processing step where the model's raw output is interpreted.

I hope this helps! Let me know if you need more details. 😊

from ultralytics.

1005183361 avatar 1005183361 commented on June 17, 2024

I used the obb model to predict the rotation of the screw locking line (the labeling method is that the positive direction of the x-axis is 0, and the clockwise direction is the increasing direction, until a circle of 360 degrees). I modified the
angle = ( in head.py angle.sigmoid()) * 2*math.pi,
it is found that it does not work. When the rotation angle exceeds 180 degrees, the model will predict incorrectly. What other codes should I modify?

from ultralytics.

glenn-jocher avatar glenn-jocher commented on June 17, 2024

Hi there! πŸ‘‹

It sounds like you're encountering issues with angle normalization in the YOLOv8-obb model. The modification you made in head.py is a good start, but it seems like the model might still be interpreting angles in a range that doesn't fully accommodate your 0-360 degrees requirement.

One approach could be to adjust the angle post-prediction to ensure it fits within the 0-360 range. Here’s a quick Python snippet that might help:

import math

# Assuming 'angle' is your model's output in radians
angle_deg = (angle.sigmoid().item() * 360) % 360  # Normalize to 0-360 degrees

This modification ensures that the output angle is always within the desired range by converting the sigmoid output directly to degrees and then applying modulo 360.

If the issue persists, it might be necessary to delve deeper into how the angles are being trained and whether the loss function correctly penalizes deviations for angles near the 0/360-degree boundary.

Hope this helps! Let me know if there's anything else you'd like to explore. 😊

from ultralytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.