[Bug-fix]Add support for max_detection_per_image hyperparam#543
Open
RihaanBH-1810 wants to merge 5 commits intoJdeRobot:masterfrom
Open
[Bug-fix]Add support for max_detection_per_image hyperparam#543RihaanBH-1810 wants to merge 5 commits intoJdeRobot:masterfrom
RihaanBH-1810 wants to merge 5 commits intoJdeRobot:masterfrom
Conversation
dpascualhe
reviewed
Apr 17, 2026
Collaborator
dpascualhe
left a comment
There was a problem hiding this comment.
Looks good! Upon addressing the comments raised we can merge
… if max_detections is less than no of outputs
Contributor
Author
|
Hi @dpascualhe, thanks for the review. I've set the default value to -1 so that the filter is bypassed by default, and also change the code to check if max_detections is less than the number of outputs and apply filter only in that case. |
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.
This PR fixes #497 by filtering the best results in
postprocess_detectionfor both yolo and torchvision. I have updated the docstrings and formatted the changed files with black.Here is a video of me testing the PR on both yolo and torchvision models :
max_image_fix.mp4
@dpascualhe