@@ -453,10 +453,9 @@ def fasterrcnn_resnet50_fpn(
453
453
** kwargs : Any ,
454
454
) -> FasterRCNN :
455
455
"""
456
- Constructs a Faster R-CNN model with a ResNet-50-FPN backbone.
457
-
458
- Reference: `"Faster R-CNN: Towards Real-Time Object Detection with
459
- Region Proposal Networks" <https://arxiv.org/abs/1506.01497>`_.
456
+ Faster R-CNN model with a ResNet-50-FPN backbone from the `Faster R-CNN: Towards Real-Time Object
457
+ Detection with Region Proposal Networks <https://arxiv.org/abs/1703.06870>`__
458
+ paper.
460
459
461
460
The input to the model is expected to be a list of tensors, each of shape ``[C, H, W]``, one for each
462
461
image, and should be in ``0-1`` range. Different images can have different sizes.
@@ -510,13 +509,26 @@ def fasterrcnn_resnet50_fpn(
510
509
>>> torch.onnx.export(model, x, "faster_rcnn.onnx", opset_version = 11)
511
510
512
511
Args:
513
- weights (FasterRCNN_ResNet50_FPN_Weights, optional): The pretrained weights for the model
514
- progress (bool): If True, displays a progress bar of the download to stderr
512
+ weights (:class:`~torchvision.models.detection.FasterRCNN_ResNet50_FPN_Weights`, optional): The
513
+ pretrained weights to use. See
514
+ :class:`~torchvision.models.detection.FasterRCNN_ResNet50_FPN_Weights` below for
515
+ more details, and possible values. By default, no pre-trained
516
+ weights are used.
517
+ progress (bool, optional): If True, displays a progress bar of the
518
+ download to stderr. Default is True.
515
519
num_classes (int, optional): number of output classes of the model (including the background)
516
- weights_backbone (ResNet50_Weights, optional): The pretrained weights for the backbone
517
- trainable_backbone_layers (int, optional): number of trainable (not frozen) layers starting from final block.
518
- Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. If ``None`` is
519
- passed (the default) this value is set to 3.
520
+ weights_backbone (:class:`~torchvision.models.ResNet50_Weights`, optional): The
521
+ pretrained weights for the backbone.
522
+ trainable_backbone_layers (int, optional): number of trainable (not frozen) layers starting from
523
+ final block. Valid values are between 0 and 5, with 5 meaning all backbone layers are
524
+ trainable. If ``None`` is passed (the default) this value is set to 3.
525
+ **kwargs: parameters passed to the ``torchvision.models.detection.faster_rcnn.FasterRCNN``
526
+ base class. Please refer to the `source code
527
+ <https://github.com/pytorch/vision/blob/main/torchvision/models/detection/faster_rcnn.py>`_
528
+ for more details about this class.
529
+
530
+ .. autoclass:: torchvision.models.detection.FasterRCNN_ResNet50_FPN_Weights
531
+ :members:
520
532
"""
521
533
weights = FasterRCNN_ResNet50_FPN_Weights .verify (weights )
522
534
weights_backbone = ResNet50_Weights .verify (weights_backbone )
@@ -553,21 +565,34 @@ def fasterrcnn_resnet50_fpn_v2(
553
565
** kwargs : Any ,
554
566
) -> FasterRCNN :
555
567
"""
556
- Constructs an improved Faster R-CNN model with a ResNet-50-FPN backbone.
557
-
558
- Reference: `"Benchmarking Detection Transfer Learning with Vision Transformers"
559
- <https://arxiv.org/abs/2111.11429>`_.
568
+ Constructs an improved Faster R-CNN model with a ResNet-50-FPN backbone from `Benchmarking Detection
569
+ Transfer Learning with Vision Transformers <https://arxiv.org/abs/2111.11429>`__ paper.
560
570
561
- :func:`~torchvision.models.detection.fasterrcnn_resnet50_fpn` for more details.
571
+ It works similarly to Faster R-CNN with ResNet-50 FPN backbone. See
572
+ :func:`~torchvision.models.detection.fasterrcnn_resnet50_fpn` for more
573
+ details.
562
574
563
575
Args:
564
- weights (FasterRCNN_ResNet50_FPN_V2_Weights, optional): The pretrained weights for the model
565
- progress (bool): If True, displays a progress bar of the download to stderr
576
+ weights (:class:`~torchvision.models.detection.FasterRCNN_ResNet50_FPN_V2_Weights`, optional): The
577
+ pretrained weights to use. See
578
+ :class:`~torchvision.models.detection.FasterRCNN_ResNet50_FPN_V2_Weights` below for
579
+ more details, and possible values. By default, no pre-trained
580
+ weights are used.
581
+ progress (bool, optional): If True, displays a progress bar of the
582
+ download to stderr. Default is True.
566
583
num_classes (int, optional): number of output classes of the model (including the background)
567
- weights_backbone (ResNet50_Weights, optional): The pretrained weights for the backbone
568
- trainable_backbone_layers (int, optional): number of trainable (not frozen) layers starting from final block.
569
- Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. If ``None`` is
570
- passed (the default) this value is set to 3.
584
+ weights_backbone (:class:`~torchvision.models.ResNet50_Weights`, optional): The
585
+ pretrained weights for the backbone.
586
+ trainable_backbone_layers (int, optional): number of trainable (not frozen) layers starting from
587
+ final block. Valid values are between 0 and 5, with 5 meaning all backbone layers are
588
+ trainable. If ``None`` is passed (the default) this value is set to 3.
589
+ **kwargs: parameters passed to the ``torchvision.models.detection.faster_rcnn.FasterRCNN``
590
+ base class. Please refer to the `source code
591
+ <https://github.com/pytorch/vision/blob/main/torchvision/models/detection/faster_rcnn.py>`_
592
+ for more details about this class.
593
+
594
+ .. autoclass:: torchvision.models.detection.FasterRCNN_ResNet50_FPN_V2_Weights
595
+ :members:
571
596
"""
572
597
weights = FasterRCNN_ResNet50_FPN_V2_Weights .verify (weights )
573
598
weights_backbone = ResNet50_Weights .verify (weights_backbone )
@@ -658,7 +683,8 @@ def fasterrcnn_mobilenet_v3_large_320_fpn(
658
683
** kwargs : Any ,
659
684
) -> FasterRCNN :
660
685
"""
661
- Constructs a low resolution Faster R-CNN model with a MobileNetV3-Large FPN backbone tunned for mobile use-cases.
686
+ Low resolution Faster R-CNN model with a MobileNetV3-Large backbone tunned for mobile use cases.
687
+
662
688
It works similarly to Faster R-CNN with ResNet-50 FPN backbone. See
663
689
:func:`~torchvision.models.detection.fasterrcnn_resnet50_fpn` for more
664
690
details.
@@ -671,13 +697,26 @@ def fasterrcnn_mobilenet_v3_large_320_fpn(
671
697
>>> predictions = model(x)
672
698
673
699
Args:
674
- weights (FasterRCNN_MobileNet_V3_Large_320_FPN_Weights, optional): The pretrained weights for the model
675
- progress (bool): If True, displays a progress bar of the download to stderr
700
+ weights (:class:`~torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_320_FPN_Weights`, optional): The
701
+ pretrained weights to use. See
702
+ :class:`~torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_320_FPN_Weights` below for
703
+ more details, and possible values. By default, no pre-trained
704
+ weights are used.
705
+ progress (bool, optional): If True, displays a progress bar of the
706
+ download to stderr. Default is True.
676
707
num_classes (int, optional): number of output classes of the model (including the background)
677
- weights_backbone (MobileNet_V3_Large_Weights, optional): The pretrained weights for the backbone
678
- trainable_backbone_layers (int, optional): number of trainable (not frozen) layers starting from final block.
679
- Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable. If ``None`` is
680
- passed (the default) this value is set to 3.
708
+ weights_backbone (:class:`~torchvision.models.MobileNet_V3_Large_Weights`, optional): The
709
+ pretrained weights for the backbone.
710
+ trainable_backbone_layers (int, optional): number of trainable (not frozen) layers starting from
711
+ final block. Valid values are between 0 and 6, with 6 meaning all backbone layers are
712
+ trainable. If ``None`` is passed (the default) this value is set to 3.
713
+ **kwargs: parameters passed to the ``torchvision.models.detection.faster_rcnn.FasterRCNN``
714
+ base class. Please refer to the `source code
715
+ <https://github.com/pytorch/vision/blob/main/torchvision/models/detection/faster_rcnn.py>`_
716
+ for more details about this class.
717
+
718
+ .. autoclass:: torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_320_FPN_Weights
719
+ :members:
681
720
"""
682
721
weights = FasterRCNN_MobileNet_V3_Large_320_FPN_Weights .verify (weights )
683
722
weights_backbone = MobileNet_V3_Large_Weights .verify (weights_backbone )
@@ -728,13 +767,26 @@ def fasterrcnn_mobilenet_v3_large_fpn(
728
767
>>> predictions = model(x)
729
768
730
769
Args:
731
- weights (FasterRCNN_MobileNet_V3_Large_FPN_Weights, optional): The pretrained weights for the model
732
- progress (bool): If True, displays a progress bar of the download to stderr
770
+ weights (:class:`~torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_FPN_Weights`, optional): The
771
+ pretrained weights to use. See
772
+ :class:`~torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_FPN_Weights` below for
773
+ more details, and possible values. By default, no pre-trained
774
+ weights are used.
775
+ progress (bool, optional): If True, displays a progress bar of the
776
+ download to stderr. Default is True.
733
777
num_classes (int, optional): number of output classes of the model (including the background)
734
- weights_backbone (MobileNet_V3_Large_Weights, optional): The pretrained weights for the backbone
735
- trainable_backbone_layers (int, optional): number of trainable (not frozen) layers starting from final block.
736
- Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable. If ``None`` is
737
- passed (the default) this value is set to 3.
778
+ weights_backbone (:class:`~torchvision.models.MobileNet_V3_Large_Weights`, optional): The
779
+ pretrained weights for the backbone.
780
+ trainable_backbone_layers (int, optional): number of trainable (not frozen) layers starting from
781
+ final block. Valid values are between 0 and 6, with 6 meaning all backbone layers are
782
+ trainable. If ``None`` is passed (the default) this value is set to 3.
783
+ **kwargs: parameters passed to the ``torchvision.models.detection.faster_rcnn.FasterRCNN``
784
+ base class. Please refer to the `source code
785
+ <https://github.com/pytorch/vision/blob/main/torchvision/models/detection/faster_rcnn.py>`_
786
+ for more details about this class.
787
+
788
+ .. autoclass:: torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_FPN_Weights
789
+ :members:
738
790
"""
739
791
weights = FasterRCNN_MobileNet_V3_Large_FPN_Weights .verify (weights )
740
792
weights_backbone = MobileNet_V3_Large_Weights .verify (weights_backbone )
0 commit comments