-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
Add confidence score to label txt files #994
Add confidence score to label txt files #994
Conversation
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
π |
@oakhtar147 I'll merge the save-conf argument, but I'll leave the colors alone, as I think we want some uniformity in the label colors. |
rebase/ |
save_conf variable removed as only used once, so we can use opt.save_conf instead.
/rebase |
1 similar comment
/rebase |
rebase/ |
Rebased my branch with the main branch. I hope it has went smooth because I am new to contributing and there was quite a learning curve to this. Thanks! |
@oakhtar147 thanks for the rebase! Yes everything's good. I took the liberty of cleaning up the changes a bit. It looks like you inspired another PR #1175 |
@glenn-jocher you're welcome! It was quite a subtle yet important feature that was going to be needed sooner or later. I'm glad PR #1175 was inspired. |
I just had an idea. Maybe we could output confidence as a 6th value by default, and make the dataloader robust to 6 element labels. This might be very useful for active learning etc. in the future, where you are mixing human labelled and autolabelled data, and it would allow you to gradually introduce more autolabelled data starting with the highest confidence labels as you train. |
The current approach is a bit 'dumber', as it only provides for setting a --conf threshold at autolabel time, and never again. Then afterwards of course, there is no autolabel confidence information retained for techniques that would choose to try to exploit that. |
That's actually a good thought. It would make use of the confidence scores instead of just saving them in the output files. I do not see a reason for this to be an option; I mean, what's the harm of outputting the score by default anyway? Definitely you could use it for active learning! |
@oakhtar147 yeah. I don't know exactly how one would best exploit the info, but having it available for future algorithms might be nice, and then we could remove a few lines of code here and in test.py, which is also outputting labels. I'd have to take a look at the dataloader though, it might be easier said than done. I'll leave a TODO here to investigate this option. TODO: consider outputting confidence on all autolabels, and then have dataloader check 5 or 6 column label format and handle each appropriately. Purpose is to make way for future active learning techniques that may exploit label confidence. |
* add contrast to conf/class against bbox rectangle color * added feature to save conf in txt labels * Update general.py * Update detect.py * Update detect.py * Update detect.py save_conf variable removed as only used once, so we can use opt.save_conf instead. * Update detect.py * Update detect.py Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* add contrast to conf/class against bbox rectangle color * added feature to save conf in txt labels * Update general.py * Update detect.py * Update detect.py * Update detect.py save_conf variable removed as only used once, so we can use opt.save_conf instead. * Update detect.py * Update detect.py Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Removing TODO as this is now implemented in detect.py and test.py with |
* add contrast to conf/class against bbox rectangle color * added feature to save conf in txt labels * Update general.py * Update detect.py * Update detect.py * Update detect.py save_conf variable removed as only used once, so we can use opt.save_conf instead. * Update detect.py * Update detect.py Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Added a feature where any user is able to optionally save the confidence scores of each bounding box in txt files during inference. Sometimes the user may need to acquire the bounding box confidence scores and they did not have an option before.
I hope this PR is helpful! π π βοΈ
π οΈ PR Summary
Made with β€οΈ by Ultralytics Actions
π Summary
Enhanced detection output with confidence scores in saved text files πβ¨
π Key Changes
--save-conf
option).π― Purpose & Impact