Skip to content
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
26 changes: 26 additions & 0 deletions docs/source/models/ssdlite.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
SSDlite
=======

.. currentmodule:: torchvision.models.detection

The SSDLite model is based on the `SSD: Single Shot MultiBox Detector
<https://arxiv.org/abs/1512.02325>`__, `Searching for MobileNetV3
<https://arxiv.org/abs/1905.02244>`__ and `MobileNetV2: Inverted Residuals and Linear
Bottlenecks <https://arxiv.org/abs/1801.04381>__` papers.


Model builders
--------------

The following model builders can be used to instantiate a SSD Lite model, with or
without pre-trained weights. All the model builders internally rely on the
``torchvision.models.detection.ssd.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

ssdlite320_mobilenet_v3_large
1 change: 1 addition & 0 deletions docs/source/models_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ weights:
models/fcos
models/mask_rcnn
models/retinanet
models/ssdlite

Table of all available detection weights
----------------------------------------
Expand Down
38 changes: 26 additions & 12 deletions torchvision/models/detection/ssdlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,9 @@ def ssdlite320_mobilenet_v3_large(
norm_layer: Optional[Callable[..., nn.Module]] = None,
**kwargs: Any,
) -> SSD:
"""Constructs an SSDlite model with input size 320x320 and a MobileNetV3 Large backbone, as described at
`"Searching for MobileNetV3"
<https://arxiv.org/abs/1905.02244>`_ and
`"MobileNetV2: Inverted Residuals and Linear Bottlenecks"
<https://arxiv.org/abs/1801.04381>`_.
"""SSDlite model architecture with input size 320x320 and a MobileNetV3 Large backbone, as
described at `Searching for MobileNetV3 <https://arxiv.org/abs/1905.02244>`__ and
`MobileNetV2: Inverted Residuals and Linear Bottlenecks <https://arxiv.org/abs/1801.04381>`__.

See :func:`~torchvision.models.detection.ssd300_vgg16` for more details.

Expand All @@ -231,15 +229,31 @@ def ssdlite320_mobilenet_v3_large(
>>> predictions = model(x)

Args:
weights (FasterRCNN_ResNet50_FPN_Weights, optional): The pretrained weights for the model
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
trainable_backbone_layers (int, optional): number of trainable (not frozen) layers starting from final block.
Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable. If ``None`` is
passed (the default) this value is set to 6.
weights (:class:`~torchvision.models.detection.SSDLite320_MobileNet_V3_Large_Weights`, optional): The
pretrained weights to use. See
:class:`~torchvision.models.detection.SSDLite320_MobileNet_V3_Large_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 (:class:`~torchvision.models.MobileNet_V3_Large_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 6, with 6 meaning all
backbone layers are trainable. If ``None`` is passed (the default) this value is
set to 6.
norm_layer (callable, optional): Module specifying the normalization layer to use.
**kwargs: parameters passed to the ``torchvision.models.detection.ssd.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.SSDLite320_MobileNet_V3_Large_Weights
:members:
"""

weights = SSDLite320_MobileNet_V3_Large_Weights.verify(weights)
weights_backbone = MobileNet_V3_Large_Weights.verify(weights_backbone)

Expand Down