Skip to content

Commit e87e6e4

Browse files
jdsgomesNicolasHug
authored andcommitted
[fbsync] docs: Added SSD300 to the new doc (#5934)
Summary: * docs: Added SSD300 to the new doc To resolve #5897 * Minor fixes * ufmt Reviewed By: YosuaMichael Differential Revision: D36204387 fbshipit-source-id: 57ba33406aa52e62d2dcca3fd73ca96f5440f717 Co-authored-by: Nicolas Hug <[email protected]>
1 parent 3bd8a2b commit e87e6e4

File tree

3 files changed

+43
-6
lines changed

3 files changed

+43
-6
lines changed

docs/source/models/ssd300.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
SSD300
2+
======
3+
4+
.. currentmodule:: torchvision.models.detection
5+
6+
The SSD300 model is based on the `SSD: Single Shot MultiBox Detector
7+
<https://arxiv.org/abs/1512.02325>`__ paper.
8+
9+
10+
Model builders
11+
--------------
12+
13+
The following model builders can be used to instanciate a SSD300 model, with or
14+
without pre-trained weights. All the model builders internally rely on the
15+
``torchvision.models.detection.SSD`` base class. Please refer to the `source
16+
code
17+
<https://github.com/pytorch/vision/blob/main/torchvision/models/detection/ssd.py>`_ for
18+
more details about this class.
19+
20+
.. autosummary::
21+
:toctree: generated/
22+
:template: function.rst
23+
24+
ssd300_vgg16

docs/source/models_new.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ weights:
5151
models/resnext
5252
models/shufflenetv2
5353
models/squeezenet
54+
models/ssd300
5455
models/swin_transformer
5556
models/vgg
5657
models/vision_transformer

torchvision/models/detection/ssd.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,8 @@ def ssd300_vgg16(
578578
trainable_backbone_layers: Optional[int] = None,
579579
**kwargs: Any,
580580
) -> SSD:
581-
"""Constructs an SSD model with input size 300x300 and a VGG16 backbone.
582-
583-
Reference: `"SSD: Single Shot MultiBox Detector" <https://arxiv.org/abs/1512.02325>`_.
581+
"""The SSD300 model is based on the `SSD: Single Shot MultiBox Detector
582+
<https://arxiv.org/abs/1512.02325>`_ paper.
584583
585584
The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each
586585
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(
615614
>>> predictions = model(x)
616615
617616
Args:
618-
weights (SSD300_VGG16_Weights, optional): The pretrained weights for the model
619-
progress (bool): If True, displays a progress bar of the download to stderr
617+
weights (:class:`~torchvision.models.detection.SSD300_VGG16_Weights`, optional): The pretrained
618+
weights to use. See
619+
:class:`~torchvision.models.detection.SSD300_VGG16_Weights`
620+
below for more details, and possible values. By default, no
621+
pre-trained weights are used.
622+
progress (bool, optional): If True, displays a progress bar of the download to stderr
623+
Default is True.
620624
num_classes (int, optional): number of output classes of the model (including the background)
621-
weights_backbone (VGG16_Weights, optional): The pretrained weights for the backbone
625+
weights_backbone (:class:`~torchvision.models.VGG16_Weights`, optional): The pretrained weights for the
626+
backbone
622627
trainable_backbone_layers (int, optional): number of trainable (not frozen) layers starting from final block.
623628
Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. If ``None`` is
624629
passed (the default) this value is set to 4.
630+
**kwargs: parameters passed to the ``torchvision.models.detection.SSD``
631+
base class. Please refer to the `source code
632+
<https://github.com/pytorch/vision/blob/main/torchvision/models/detection/ssd.py>`_
633+
for more details about this class.
634+
635+
.. autoclass:: torchvision.models.detection.SSD300_VGG16_Weights
636+
:members:
625637
"""
626638
weights = SSD300_VGG16_Weights.verify(weights)
627639
weights_backbone = VGG16_Weights.verify(weights_backbone)

0 commit comments

Comments
 (0)