@@ -414,7 +414,8 @@ def fasterrcnn_mobilenet_v3_large(pretrained=False, progress=True, num_classes=9
414414
415415
416416def fasterrcnn_mobilenet_v3_large_fpn (pretrained = False , progress = True , num_classes = 91 , pretrained_backbone = True ,
417- trainable_backbone_layers = None , min_size = 320 , max_size = 640 , ** kwargs ):
417+ trainable_backbone_layers = None , min_size = 320 , max_size = 640 , rpn_score_thresh = 0.05 ,
418+ ** kwargs ):
418419 """
419420 Constructs a Faster R-CNN model with a MobileNetV3-Large FPN backbone. It works similarly
420421 to Faster R-CNN with ResNet-50 FPN backbone. See `fasterrcnn_resnet50_fpn` for more details.
@@ -435,6 +436,8 @@ def fasterrcnn_mobilenet_v3_large_fpn(pretrained=False, progress=True, num_class
435436 Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable.
436437 min_size (int): minimum size of the image to be rescaled before feeding it to the backbone
437438 max_size (int): maximum size of the image to be rescaled before feeding it to the backbone
439+ rpn_score_thresh (float): during inference, only return proposals with a classification score
440+ greater than rpn_score_thresh
438441 """
439442 trainable_backbone_layers = _validate_trainable_layers (
440443 pretrained or pretrained_backbone , trainable_backbone_layers , 6 , 3 )
@@ -448,7 +451,7 @@ def fasterrcnn_mobilenet_v3_large_fpn(pretrained=False, progress=True, num_class
448451 aspect_ratios = ((0.5 , 1.0 , 2.0 ),) * len (anchor_sizes )
449452
450453 model = FasterRCNN (backbone , num_classes , rpn_anchor_generator = AnchorGenerator (anchor_sizes , aspect_ratios ),
451- min_size = min_size , max_size = max_size , ** kwargs )
454+ min_size = min_size , max_size = max_size , rpn_score_thresh = rpn_score_thresh , ** kwargs )
452455 if pretrained :
453456 state_dict = load_state_dict_from_url (model_urls ['fasterrcnn_mobilenet_v3_large_fpn_coco' ], progress = progress )
454457 model .load_state_dict (state_dict )
0 commit comments