@@ -414,7 +414,8 @@ def fasterrcnn_mobilenet_v3_large(pretrained=False, progress=True, num_classes=9
414
414
415
415
416
416
def 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 ):
418
419
"""
419
420
Constructs a Faster R-CNN model with a MobileNetV3-Large FPN backbone. It works similarly
420
421
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
435
436
Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable.
436
437
min_size (int): minimum size of the image to be rescaled before feeding it to the backbone
437
438
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
438
441
"""
439
442
trainable_backbone_layers = _validate_trainable_layers (
440
443
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
448
451
aspect_ratios = ((0.5 , 1.0 , 2.0 ),) * len (anchor_sizes )
449
452
450
453
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 )
452
455
if pretrained :
453
456
state_dict = load_state_dict_from_url (model_urls ['fasterrcnn_mobilenet_v3_large_fpn_coco' ], progress = progress )
454
457
model .load_state_dict (state_dict )
0 commit comments