diff --git a/docs/source/models/ssd300.rst b/docs/source/models/ssd300.rst new file mode 100644 index 00000000000..a9ceadcdf06 --- /dev/null +++ b/docs/source/models/ssd300.rst @@ -0,0 +1,24 @@ +SSD300 +====== + +.. currentmodule:: torchvision.models.detection + +The SSD300 model is based on the `SSD: Single Shot MultiBox Detector +`__ paper. + + +Model builders +-------------- + +The following model builders can be used to instanciate a SSD300 model, with or +without pre-trained weights. All the model builders internally rely on the +``torchvision.models.detection.SSD`` base class. Please refer to the `source +code +`_ for +more details about this class. + +.. autosummary:: + :toctree: generated/ + :template: function.rst + + ssd300_vgg16 diff --git a/docs/source/models_new.rst b/docs/source/models_new.rst index d8f3317c0de..1ccbcdb0f13 100644 --- a/docs/source/models_new.rst +++ b/docs/source/models_new.rst @@ -51,6 +51,7 @@ weights: models/resnext models/shufflenetv2 models/squeezenet + models/ssd300 models/swin_transformer models/vgg models/vision_transformer diff --git a/torchvision/models/detection/ssd.py b/torchvision/models/detection/ssd.py index e0045a21640..d83147f81f5 100644 --- a/torchvision/models/detection/ssd.py +++ b/torchvision/models/detection/ssd.py @@ -578,9 +578,8 @@ def ssd300_vgg16( trainable_backbone_layers: Optional[int] = None, **kwargs: Any, ) -> SSD: - """Constructs an SSD model with input size 300x300 and a VGG16 backbone. - - Reference: `"SSD: Single Shot MultiBox Detector" `_. + """The SSD300 model is based on the `SSD: Single Shot MultiBox Detector + `_ paper. 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 but they will be resized @@ -615,13 +614,26 @@ def ssd300_vgg16( >>> predictions = model(x) Args: - weights (SSD300_VGG16_Weights, optional): The pretrained weights for the model - progress (bool): If True, displays a progress bar of the download to stderr + weights (:class:`~torchvision.models.detection.SSD300_VGG16_Weights`, optional): The pretrained + weights to use. See + :class:`~torchvision.models.detection.SSD300_VGG16_Weights` + below for more details, and possible values. By default, no + pre-trained weights are used. + progress (bool, optional): If True, displays a progress bar of the download to stderr + Default is True. num_classes (int, optional): number of output classes of the model (including the background) - weights_backbone (VGG16_Weights, optional): The pretrained weights for the backbone + weights_backbone (:class:`~torchvision.models.VGG16_Weights`, optional): The pretrained weights for the + backbone trainable_backbone_layers (int, optional): number of trainable (not frozen) 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 4. + **kwargs: parameters passed to the ``torchvision.models.detection.SSD`` + base class. Please refer to the `source code + `_ + for more details about this class. + + .. autoclass:: torchvision.models.detection.SSD300_VGG16_Weights + :members: """ weights = SSD300_VGG16_Weights.verify(weights) weights_backbone = VGG16_Weights.verify(weights_backbone)