<p>The <code>cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST</code> value is the threshold used to filter out low-scored bounding boxes predicted by the <a href="https://arxiv.org/abs/1504.08083" rel="noreferrer">Fast R-CNN</a> component of the model during inference/test time.</p>
<p>Basically, any prediction with a confidence score above the threshold value is kept, and the remaining are discarded.</p>
<p>This thresholding can be seen in the Detectron2 code <a href="https://github.com/facebookresearch/detectron2/blob/c55d3816c52f22bb2d7cbe4d08a2e760cf6b8e31/detectron2/modeling/roi_heads/fast_rcnn.py#L151" rel="noreferrer">here</a>.</p>
<pre><code>def fast_rcnn_inference_single_image(
    boxes,
    scores,
    image_shape: Tuple[int, int],
    score_thresh: float,
    nms_thresh: float,
    topk_per_image: int,
):

    ### clipped code ###

    # 1. Filter results based on detection scores. It can make NMS more efficient
    #    by filtering out low-confidence detections.
    filter_mask = scores &gt; score_thresh  # R x K

    ### clipped code ###
</code></pre>
<p>You can also see <a href="https://github.com/facebookresearch/detectron2/blob/c55d3816c52f22bb2d7cbe4d08a2e760cf6b8e31/detectron2/modeling/roi_heads/fast_rcnn.py#L251" rel="noreferrer">here</a> to confirm that that parameter value originates from the config.</p>
<pre><code>class FastRCNNOutputLayers(nn.Module):
    &quot;&quot;&quot;
    Two linear layers for predicting Fast R-CNN outputs:
    1. proposal-to-detection box regression deltas
    2. classification scores
    &quot;&quot;&quot;
    
    ### clipped code ###

    @classmethod
    def from_config(cls, cfg, input_shape):
        return {
            &quot;input_shape&quot;: input_shape,
            &quot;box2box_transform&quot;: Box2BoxTransform(weights=cfg.MODEL.ROI_BOX_HEAD.BBOX_REG_WEIGHTS),
            # fmt: off
            &quot;num_classes&quot;           : cfg.MODEL.ROI_HEADS.NUM_CLASSES,
            &quot;cls_agnostic_bbox_reg&quot; : cfg.MODEL.ROI_BOX_HEAD.CLS_AGNOSTIC_BBOX_REG,
            &quot;smooth_l1_beta&quot;        : cfg.MODEL.ROI_BOX_HEAD.SMOOTH_L1_BETA,
            &quot;test_score_thresh&quot;     : cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST,
            &quot;test_nms_thresh&quot;       : cfg.MODEL.ROI_HEADS.NMS_THRESH_TEST,
            &quot;test_topk_per_image&quot;   : cfg.TEST.DETECTIONS_PER_IMAGE,
            &quot;box_reg_loss_type&quot;     : cfg.MODEL.ROI_BOX_HEAD.BBOX_REG_LOSS_TYPE,
            &quot;loss_weight&quot;           : {&quot;loss_box_reg&quot;: cfg.MODEL.ROI_BOX_HEAD.BBOX_REG_LOSS_WEIGHT},
            # fmt: on
        }

    ### clipped code ###
</code></pre>
what does cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5 do in detectron2?
<p>Hope you're doing great!</p>
<p>I didn't really understand these 2 lines from the detectron2 <a href="https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5" rel="nofollow noreferrer">colab notebook</a> tutorial, I tried looking in the official documentation but i didn't understand much, can someone please explain this to me :</p>
<pre><code>cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5  # set threshold for this model
# Find a model from detectron2's model zoo. You can use the https://dl.fbaipublicfiles... url as well
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url(&quot;COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml&quot;)
</code></pre>
<p>I thank you in advance and wish you a great day!</p>