Unverified Commit 0a94ce70 authored by puhuk's avatar puhuk Committed by GitHub
Browse files

docs: Added SSD300 to the new doc (#5934)



* docs: Added SSD300 to the new doc

To resolve #5897

* Minor fixes

* ufmt
Co-authored-by: default avatarNicolas Hug <contact@nicolas-hug.com>
parent e556640b
SSD300
======
.. currentmodule:: torchvision.models.detection
The SSD300 model is based on the `SSD: Single Shot MultiBox Detector
<https://arxiv.org/abs/1512.02325>`__ 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
<https://github.com/pytorch/vision/blob/main/torchvision/models/detection/ssd.py>`_ for
more details about this class.
.. autosummary::
:toctree: generated/
:template: function.rst
ssd300_vgg16
...@@ -51,6 +51,7 @@ weights: ...@@ -51,6 +51,7 @@ weights:
models/resnext models/resnext
models/shufflenetv2 models/shufflenetv2
models/squeezenet models/squeezenet
models/ssd300
models/swin_transformer models/swin_transformer
models/vgg models/vgg
models/vision_transformer models/vision_transformer
......
...@@ -578,9 +578,8 @@ def ssd300_vgg16( ...@@ -578,9 +578,8 @@ def ssd300_vgg16(
trainable_backbone_layers: Optional[int] = None, trainable_backbone_layers: Optional[int] = None,
**kwargs: Any, **kwargs: Any,
) -> SSD: ) -> SSD:
"""Constructs an SSD model with input size 300x300 and a VGG16 backbone. """The SSD300 model is based on the `SSD: Single Shot MultiBox Detector
<https://arxiv.org/abs/1512.02325>`_ paper.
Reference: `"SSD: Single Shot MultiBox Detector" <https://arxiv.org/abs/1512.02325>`_.
The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each 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 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( ...@@ -615,13 +614,26 @@ def ssd300_vgg16(
>>> predictions = model(x) >>> predictions = model(x)
Args: Args:
weights (SSD300_VGG16_Weights, optional): The pretrained weights for the model weights (:class:`~torchvision.models.detection.SSD300_VGG16_Weights`, optional): The pretrained
progress (bool): If True, displays a progress bar of the download to stderr 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) 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. 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 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. 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
<https://github.com/pytorch/vision/blob/main/torchvision/models/detection/ssd.py>`_
for more details about this class.
.. autoclass:: torchvision.models.detection.SSD300_VGG16_Weights
:members:
""" """
weights = SSD300_VGG16_Weights.verify(weights) weights = SSD300_VGG16_Weights.verify(weights)
weights_backbone = VGG16_Weights.verify(weights_backbone) weights_backbone = VGG16_Weights.verify(weights_backbone)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment