diff --git a/docs/source/models/fcos.rst b/docs/source/models/fcos.rst new file mode 100644 index 00000000000..4096cc30f68 --- /dev/null +++ b/docs/source/models/fcos.rst @@ -0,0 +1,22 @@ +FCOS +========= + +.. currentmodule:: torchvision.models.detection + +The RetinaNet model is based on the `FCOS: Fully Convolutional One-Stage Object Detection +`__ paper. + +Model builders +-------------- + +The following model builders can be used to instantiate a FCOS model, with or +without pre-trained weights. All the model buidlers internally rely on the +``torchvision.models.detection.fcos.FCOS`` base class. Please refer to the `source code +`_ for +more details about this class. + +.. autosummary:: + :toctree: generated/ + :template: function.rst + + fcos_resnet50_fpn diff --git a/docs/source/models_new.rst b/docs/source/models_new.rst index 96cc260043a..c1b7e04339c 100644 --- a/docs/source/models_new.rst +++ b/docs/source/models_new.rst @@ -93,8 +93,9 @@ weights: .. toctree:: :maxdepth: 1 - models/retinanet + models/fcos models/mask_rcnn + models/retinanet Table of all available detection weights ---------------------------------------- diff --git a/torchvision/models/detection/fcos.py b/torchvision/models/detection/fcos.py index 628a343e5a3..54094d2fa22 100644 --- a/torchvision/models/detection/fcos.py +++ b/torchvision/models/detection/fcos.py @@ -679,7 +679,7 @@ def fcos_resnet50_fpn( """ Constructs a FCOS model with a ResNet-50-FPN backbone. - Reference: `"FCOS: Fully Convolutional One-Stage Object Detection" `_. + Reference: `FCOS: Fully Convolutional One-Stage Object Detection `_. The input to the model is expected to be a list of tensors, each of shape ``[C, H, W]``, one for each image, and should be in ``0-1`` range. Different images can have different sizes. @@ -715,13 +715,25 @@ def fcos_resnet50_fpn( >>> predictions = model(x) Args: - weights (FCOS_ResNet50_FPN_Weights, optional): The pretrained weights for the model + weights (:class:`~torchvision.models.detection.FCOS_ResNet50_FPN_Weights`, optional): The + pretrained weights to use. See + :class:`~torchvision.models.detection.FCOS_ResNet50_FPN_Weights` + below for more details, and possible values. By default, no + pre-trained weights are used. progress (bool): If True, displays a progress bar of the download to stderr num_classes (int, optional): number of output classes of the model (including the background) - weights_backbone (ResNet50_Weights, optional): The pretrained weights for the backbone + weights_backbone (:class:`~torchvision.models.ResNet50_Weights`, optional): The pretrained weights for + the backbone. trainable_backbone_layers (int, optional): number of trainable (not frozen) resnet layers starting from final block. Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. If ``None`` is passed (the default) this value is set to 3. Default: None + **kwargs: parameters passed to the ``torchvision.models.detection.FCOS`` + base class. Please refer to the `source code + `_ + for more details about this class. + + .. autoclass:: torchvision.models.detection.FCOS_ResNet50_FPN_Weights + :members: """ weights = FCOS_ResNet50_FPN_Weights.verify(weights) weights_backbone = ResNet50_Weights.verify(weights_backbone)