Limit detections without explicit if condition#10502
Merged
glenn-jocher merged 5 commits intoultralytics:masterfrom Dec 18, 2022
Merged
Limit detections without explicit if condition#10502glenn-jocher merged 5 commits intoultralytics:masterfrom
glenn-jocher merged 5 commits intoultralytics:masterfrom
Conversation
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
for more information, see https://pre-commit.ci
Member
|
@developer0hye interesting! What if we just do this? Can you add it to your profiling results? I tested it and it keeps tensor shape the same if dimension exceeds max_det. - if i.shape[0] > max_det: # limit detections
- i = i[:max_det]
+ i = i[:max_det] # limit detections |
Contributor
Author
|
It seems that we don't need explicit processing for this case! When I test this code with pretrained YOLOv5s on COCO datset, mAP is computed without any issues! |
developer0hye
added a commit
to developer0hye/yolov5
that referenced
this pull request
Dec 17, 2022
it is related to ultralytics#10502.
Member
|
@developer0hye PR is merged. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐ |
glenn-jocher
added a commit
that referenced
this pull request
Dec 19, 2022
* sort by confidence and remove excess boxes without explicit if Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com> * cleanup indexing boxes for remove excess boxes it is related to #10502. Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
00Monkoo
pushed a commit
to 00Monkoo/cam_test
that referenced
this pull request
Aug 26, 2025
* sort by confidence and remove excess boxes without explicit if Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com> * cleanup indexing boxes for remove excess boxes it is related to ultralytics/yolov5#10502. Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Signed-off-by: Yonghye Kwon developer.0hye@gmail.com
minis slightly faster thanifon average-case .🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Refinement of non-max suppression in YOLOv5.
📊 Key Changes
🎯 Purpose & Impact