Skip to content

Commit ea43d54

Browse files
Can-Zhaomonai-bot
andauthored
fix bug in retina detector (#5255)
Signed-off-by: Can Zhao <[email protected]> Fixes #5250. ### Description Fixed bug that allow_low_quality_matches in set_regular_matcher was always set to True and it's not using value from the argument, in retinanet. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Can Zhao <[email protected]> Signed-off-by: monai-bot <[email protected]> Co-authored-by: monai-bot <[email protected]>
1 parent 9b4b84f commit ea43d54

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

monai/apps/detection/networks/retinanet_detector.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,17 @@ def set_regular_matcher(self, fg_iou_thresh: float, bg_iou_thresh: float, allow_
318318
Args:
319319
fg_iou_thresh: foreground IoU threshold for Matcher, considered as matched if IoU > fg_iou_thresh
320320
bg_iou_thresh: background IoU threshold for Matcher, considered as not matched if IoU < bg_iou_thresh
321+
allow_low_quality_matches: if True, produce additional matches
322+
for predictions that have only low-quality match candidates.
321323
"""
322324
if fg_iou_thresh < bg_iou_thresh:
323325
raise ValueError(
324326
"Require fg_iou_thresh >= bg_iou_thresh. "
325327
f"Got fg_iou_thresh={fg_iou_thresh}, bg_iou_thresh={bg_iou_thresh}."
326328
)
327-
self.proposal_matcher = Matcher(fg_iou_thresh, bg_iou_thresh, allow_low_quality_matches=True)
329+
self.proposal_matcher = Matcher(
330+
fg_iou_thresh, bg_iou_thresh, allow_low_quality_matches=allow_low_quality_matches
331+
)
328332

329333
def set_atss_matcher(self, num_candidates: int = 4, center_in_gt: bool = False) -> None:
330334
"""

0 commit comments

Comments
 (0)