diff --git a/docs/source/models/mobilenetv2.rst b/docs/source/models/mobilenetv2.rst new file mode 100644 index 00000000000..666dcce57ce --- /dev/null +++ b/docs/source/models/mobilenetv2.rst @@ -0,0 +1,24 @@ +MobileNet V2 +============ + +.. currentmodule:: torchvision.models + +The MobileNet V2 model is based on the `MobileNetV2: Inverted Residuals and Linear +Bottlenecks `__ paper. + + +Model builders +-------------- + +The following model builders can be used to instantiate a MobileNetV2 model, with or +without pre-trained weights. All the model builders internally rely on the +``torchvision.models.mobilenetv2.MobileNetV2`` base class. Please refer to the `source +code +`_ for +more details about this class. + +.. autosummary:: + :toctree: generated/ + :template: function.rst + + mobilenet_v2 diff --git a/docs/source/models_new.rst b/docs/source/models_new.rst index 12249571e5c..f3924205710 100644 --- a/docs/source/models_new.rst +++ b/docs/source/models_new.rst @@ -42,6 +42,7 @@ weights: models/efficientnet models/efficientnetv2 models/googlenet + models/mobilenetv2 models/regnet models/resnet models/resnext diff --git a/torchvision/models/mobilenetv2.py b/torchvision/models/mobilenetv2.py index 5763fb79acb..ab7b69ed005 100644 --- a/torchvision/models/mobilenetv2.py +++ b/torchvision/models/mobilenetv2.py @@ -233,13 +233,24 @@ class MobileNet_V2_Weights(WeightsEnum): def mobilenet_v2( *, weights: Optional[MobileNet_V2_Weights] = None, progress: bool = True, **kwargs: Any ) -> MobileNetV2: - """ - Constructs a MobileNetV2 architecture from - `"MobileNetV2: Inverted Residuals and Linear Bottlenecks" `_. + """MobileNetV2 architecture from the `MobileNetV2: Inverted Residuals and Linear + Bottlenecks `_ paper. Args: - weights (MobileNet_V2_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.MobileNet_V2_Weights`, optional): The + pretrained weights to use. See + :class:`~torchvision.models.MobileNet_V2_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. + **kwargs: parameters passed to the ``torchvision.models.mobilenetv2.MobileNetV2`` + base class. Please refer to the `source code + `_ + for more details about this class. + + .. autoclass:: torchvision.models.MobileNet_V2_Weights + :members: """ weights = MobileNet_V2_Weights.verify(weights)