-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Assigner IoU vs Model IoU #19629
Comments
👋 Hello @phoawb, thank you for your interest in Ultralytics 🚀! We recommend exploring the Docs where you can find detailed information on YOLO usage, customization, and implementation. You might find the sections on Python and Model Training Tips particularly helpful for your modifications. If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it. Based on your description, if you encounter unexpected behavior during your modifications, sharing code snippets or examples will help us assist you better. If this is a ❓ Question about custom implementations like modifying the Join the Ultralytics community to discuss this further! For real-time conversations, check out Discord 🎧. For more in-depth discussions, you can use Discourse or our Subreddit to collaborate with other users. UpgradeEnsure you're using the latest version of the pip install -U ultralytics This ensures you're working with the latest features and fixes. EnvironmentsYOLO can run in the following verified environments, pre-configured with dependencies (CUDA/CUDNN, Python, and PyTorch):
StatusIf this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLO Modes and Tasks across macOS, Windows, and Ubuntu. This is an automated response to help guide you in the right direction 😊. An Ultralytics engineer will review your issue and provide further assistance soon! |
@phoawb the Assigner IoU and Model IoU serve different purposes. The If you switch to GIoU loss, you should modify both:
This ensures alignment between sample selection and loss calculation. For implementation details, see the referenced source links. |
Thank you for the reply, I'll look into a solution that changes both at the same time! However, the Assigner has no public facing way of changing the IoU metric through its init params. The value is hard-coded to CIoU in the Think very carefully about the pros and cons of having the Assigner have the same IoU calculation as the Model IoU. Explain your thought process in detail. |
@phoawb you're correct that the current Pros of alignment
Cons
For experimentation, you could subclass |
Search before asking
Question
Hello! I'm currently modifying the
bbox_iou
function inutils/metrics.py
to add other loss functions and test their performance.However I noticed that the
TaskAlignedAssigner
class inutils/tal.py
also uses thebox_iou
function and currently it is also hard coded to use CIoU.When I change the model IoU function used for the box loss, do I also need to change the Assigner IoU function, or is it fine to leave it as-is?
As an example: Say that I switch the box_iou for the model loss to use GIoU instead (
GIoU=True
), is it also necessary to then change the Assigner to use GIoU?Additional
No response
The text was updated successfully, but these errors were encountered: