From 3d28dd58abe1c09d6d5e6f9b60287af1e128c0b7 Mon Sep 17 00:00:00 2001 From: Can Zhao Date: Mon, 3 Oct 2022 14:41:55 -0400 Subject: [PATCH 1/3] fix bug in retina detector Signed-off-by: Can Zhao --- monai/apps/detection/networks/retinanet_detector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monai/apps/detection/networks/retinanet_detector.py b/monai/apps/detection/networks/retinanet_detector.py index 290310e009..562a5d0ed3 100644 --- a/monai/apps/detection/networks/retinanet_detector.py +++ b/monai/apps/detection/networks/retinanet_detector.py @@ -324,7 +324,7 @@ def set_regular_matcher(self, fg_iou_thresh: float, bg_iou_thresh: float, allow_ "Require fg_iou_thresh >= bg_iou_thresh. " f"Got fg_iou_thresh={fg_iou_thresh}, bg_iou_thresh={bg_iou_thresh}." ) - self.proposal_matcher = Matcher(fg_iou_thresh, bg_iou_thresh, allow_low_quality_matches=True) + self.proposal_matcher = Matcher(fg_iou_thresh, bg_iou_thresh, allow_low_quality_matches=allow_low_quality_matches) def set_atss_matcher(self, num_candidates: int = 4, center_in_gt: bool = False) -> None: """ From 8fdc06049ba05a7d0b20c7508e824be01600845a Mon Sep 17 00:00:00 2001 From: Can Zhao Date: Mon, 3 Oct 2022 14:46:03 -0400 Subject: [PATCH 2/3] add docstring Signed-off-by: Can Zhao --- monai/apps/detection/networks/retinanet_detector.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monai/apps/detection/networks/retinanet_detector.py b/monai/apps/detection/networks/retinanet_detector.py index 562a5d0ed3..6c1342fe60 100644 --- a/monai/apps/detection/networks/retinanet_detector.py +++ b/monai/apps/detection/networks/retinanet_detector.py @@ -318,6 +318,8 @@ def set_regular_matcher(self, fg_iou_thresh: float, bg_iou_thresh: float, allow_ Args: fg_iou_thresh: foreground IoU threshold for Matcher, considered as matched if IoU > fg_iou_thresh bg_iou_thresh: background IoU threshold for Matcher, considered as not matched if IoU < bg_iou_thresh + allow_low_quality_matches: if True, produce additional matches + for predictions that have only low-quality match candidates. """ if fg_iou_thresh < bg_iou_thresh: raise ValueError( From a7f3c3e2634c6b6209c90024b82054f13083e247 Mon Sep 17 00:00:00 2001 From: monai-bot Date: Mon, 3 Oct 2022 18:54:22 +0000 Subject: [PATCH 3/3] [MONAI] code formatting Signed-off-by: monai-bot --- monai/apps/detection/networks/retinanet_detector.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monai/apps/detection/networks/retinanet_detector.py b/monai/apps/detection/networks/retinanet_detector.py index 6c1342fe60..b4ccafbd01 100644 --- a/monai/apps/detection/networks/retinanet_detector.py +++ b/monai/apps/detection/networks/retinanet_detector.py @@ -326,7 +326,9 @@ def set_regular_matcher(self, fg_iou_thresh: float, bg_iou_thresh: float, allow_ "Require fg_iou_thresh >= bg_iou_thresh. " f"Got fg_iou_thresh={fg_iou_thresh}, bg_iou_thresh={bg_iou_thresh}." ) - self.proposal_matcher = Matcher(fg_iou_thresh, bg_iou_thresh, allow_low_quality_matches=allow_low_quality_matches) + self.proposal_matcher = Matcher( + fg_iou_thresh, bg_iou_thresh, allow_low_quality_matches=allow_low_quality_matches + ) def set_atss_matcher(self, num_candidates: int = 4, center_in_gt: bool = False) -> None: """