You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is about docstrings in MaskRCNN, FasterRCNN, RegionProposalNetwork classes. Since it's not a bug, or a documentation (../index.html) issue, I opened a blank issue.
Issue
I think the rpn_score_thresh argument is wrongly defined in both MaskRCNN & FasterRCNN docstrings;
In RegionProposalNetwork (here the score_thresh argument is missing in the docstring), rpn_score_thresh is used inside filter_proposals function to filter proposals based on the objectness score:
Hence, the docstring should change from: "during inference, only return proposals with a classification score greater than rpn_score_thresh" to: "only return proposals with an objectness score greater than rpn_score_thresh"
In RoIHeads, box_score_thresh is used inside postprocess_detections:
Thanks a lot for the detailed report @rizavelioglu, I think you're 100% correct! We'd love to review your PR. On top of MaskRCNN and FasterRCNN, it looks like this is affecting MaskRCNN (edit: KeypointRCNN!) as well?
This issue is about docstrings in
MaskRCNN
,FasterRCNN
,RegionProposalNetwork
classes. Since it's not a bug, or a documentation (../index.html) issue, I opened a blank issue.Issue
rpn_score_thresh
argument is wrongly defined in bothMaskRCNN
&FasterRCNN
docstrings;vision/torchvision/models/detection/mask_rcnn.py
Lines 87 to 88 in 6f0deb9
probably because of simple copy/paste from
box_score_thresh
argument, which is correctly defined:vision/torchvision/models/detection/mask_rcnn.py
Lines 94 to 95 in 6f0deb9
score_thresh
argument is missing in theRegionProposalNetwork
docstring:vision/torchvision/models/detection/rpn.py
Line 158 in 6f0deb9
Possible fix:
mask_rcnn.py
andfaster_rcnn.py
for the argument:rpn.py
, add the following argument inside the docstring:Explanation:
Both arguments (
rpn_score_thresh
&box_score_thresh
) are first passed toFasterRCNN
:vision/torchvision/models/detection/mask_rcnn.py
Lines 227 to 252 in 6f0deb9
where
rpn_score_thresh
is passed toRegionProposalNetwork
:vision/torchvision/models/detection/faster_rcnn.py
Lines 234 to 244 in 6f0deb9
and
box_score_thresh
is passed toRoIHeads
:vision/torchvision/models/detection/faster_rcnn.py
Lines 259 to 269 in 6f0deb9
In
RegionProposalNetwork
(here thescore_thresh
argument is missing in the docstring),rpn_score_thresh
is used insidefilter_proposals
function to filter proposals based on the objectness score:vision/torchvision/models/detection/rpn.py
Lines 271 to 284 in 6f0deb9
and the
filter_proposals
function is used during both training and inference:vision/torchvision/models/detection/rpn.py
Line 372 in 6f0deb9
Hence, the docstring should change from: "during inference, only return proposals with a classification score greater than rpn_score_thresh" to: "only return proposals with an objectness score greater than rpn_score_thresh"
In
RoIHeads
,box_score_thresh
is used insidepostprocess_detections
:vision/torchvision/models/detection/roi_heads.py
Lines 707 to 708 in 6f0deb9
and the
postprocess_detections
is only executed during inference:vision/torchvision/models/detection/roi_heads.py
Lines 767 to 775 in 6f0deb9
Hence, the docstring is correct for
box_score_thresh
.In case my observations are correct, I would be glad to submit a PR.
The text was updated successfully, but these errors were encountered: