Skip to content

docs: Added SSD300 to the new doc #5934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/source/models/ssd300.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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
1 change: 1 addition & 0 deletions docs/source/models_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ weights:
models/resnext
models/shufflenetv2
models/squeezenet
models/ssd300
models/swin_transformer
models/vgg
models/vision_transformer
Expand Down
24 changes: 18 additions & 6 deletions torchvision/models/detection/ssd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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" <https://arxiv.org/abs/1512.02325>`_.
"""The SSD300 model is based on the `SSD: Single Shot MultiBox Detector
<https://arxiv.org/abs/1512.02325>`_ 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
Expand Down Expand Up @@ -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
<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_backbone = VGG16_Weights.verify(weights_backbone)
Expand Down