diff --git a/docs/source/models/convnext.rst b/docs/source/models/convnext.rst index e400bebb466..f484bf63d94 100644 --- a/docs/source/models/convnext.rst +++ b/docs/source/models/convnext.rst @@ -1,5 +1,5 @@ ConvNeXt -====== +======== .. currentmodule:: torchvision.models diff --git a/docs/source/models/mobilenetv3.rst b/docs/source/models/mobilenetv3.rst new file mode 100644 index 00000000000..4322470286d --- /dev/null +++ b/docs/source/models/mobilenetv3.rst @@ -0,0 +1,24 @@ +MobileNet V3 +============ + +.. currentmodule:: torchvision.models + +The MobileNet V3 model is based on the `Searching for MobileNetV3 `__ paper. + + +Model builders +-------------- + +The following model builders can be used to instantiate a MobileNetV3 model, with or +without pre-trained weights. All the model builders internally rely on the +``torchvision.models.mobilenetv3.MobileNetV3`` base class. Please refer to the `source +code +`_ for +more details about this class. + +.. autosummary:: + :toctree: generated/ + :template: function.rst + + mobilenet_v3_large + mobilenet_v3_small diff --git a/docs/source/models_new.rst b/docs/source/models_new.rst index f9aa889c383..b4945938824 100644 --- a/docs/source/models_new.rst +++ b/docs/source/models_new.rst @@ -43,6 +43,7 @@ weights: models/efficientnetv2 models/googlenet models/mobilenetv2 + models/mobilenetv3 models/regnet models/resnet models/resnext diff --git a/torchvision/models/mobilenetv3.py b/torchvision/models/mobilenetv3.py index 7e68369d265..910e8fbf04b 100644 --- a/torchvision/models/mobilenetv3.py +++ b/torchvision/models/mobilenetv3.py @@ -362,11 +362,23 @@ def mobilenet_v3_large( ) -> MobileNetV3: """ Constructs a large MobileNetV3 architecture from - `"Searching for MobileNetV3" `_. + `Searching for MobileNetV3 `__. Args: - weights (MobileNet_V3_Large_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_V3_Large_Weights`, optional): The + pretrained weights to use. See + :class:`~torchvision.models.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. + **kwargs: parameters passed to the ``torchvision.models.resnet.MobileNetV3`` + base class. Please refer to the `source code + `_ + for more details about this class. + + .. autoclass:: torchvision.models.MobileNet_V3_Large_Weights + :members: """ weights = MobileNet_V3_Large_Weights.verify(weights) @@ -380,11 +392,23 @@ def mobilenet_v3_small( ) -> MobileNetV3: """ Constructs a small MobileNetV3 architecture from - `"Searching for MobileNetV3" `_. + `Searching for MobileNetV3 `__. Args: - weights (MobileNet_V3_Small_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_V3_Small_Weights`, optional): The + pretrained weights to use. See + :class:`~torchvision.models.MobileNet_V3_Small_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.resnet.MobileNetV3`` + base class. Please refer to the `source code + `_ + for more details about this class. + + .. autoclass:: torchvision.models.MobileNet_V3_Small_Weights + :members: """ weights = MobileNet_V3_Small_Weights.verify(weights)