From 2415941f810aee49801a6ed7334084c9952cc7cd Mon Sep 17 00:00:00 2001 From: Aditya Oke Date: Fri, 29 Apr 2022 16:02:09 +0530 Subject: [PATCH 1/3] add docs --- docs/source/models/lraspp.rst | 22 ++++++++++++++++++++ docs/source/models_new.rst | 1 + torchvision/models/segmentation/lraspp.py | 25 ++++++++++++++++++----- 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 docs/source/models/lraspp.rst diff --git a/docs/source/models/lraspp.rst b/docs/source/models/lraspp.rst new file mode 100644 index 00000000000..bda76327bc4 --- /dev/null +++ b/docs/source/models/lraspp.rst @@ -0,0 +1,22 @@ +LRASPP +====== + +.. currentmodule:: torchvision.models.segmentation + +The FCN model is based on the `"Searching for MobileNetV3" `_ paper. + +Model builders +-------------- + +The following model builders can be used to instantiate a FCN model, with or +without pre-trained weights. All the model builders internally rely on the +``torchvision.models.segmentation.LRASPP`` base class. Please refer to the `source +code +`_ for +more details about this class. + +.. autosummary:: + :toctree: generated/ + :template: function.rst + + lraspp_mobilenet_v3_large diff --git a/docs/source/models_new.rst b/docs/source/models_new.rst index b4945938824..e9fd102c59b 100644 --- a/docs/source/models_new.rst +++ b/docs/source/models_new.rst @@ -73,6 +73,7 @@ pre-trained weights: :maxdepth: 1 models/deeplabv3 + models/lraspp Table of all available semantic segmentation weights diff --git a/torchvision/models/segmentation/lraspp.py b/torchvision/models/segmentation/lraspp.py index 316c91d2cea..f6a0c662cda 100644 --- a/torchvision/models/segmentation/lraspp.py +++ b/torchvision/models/segmentation/lraspp.py @@ -123,13 +123,28 @@ def lraspp_mobilenet_v3_large( weights_backbone: Optional[MobileNet_V3_Large_Weights] = MobileNet_V3_Large_Weights.IMAGENET1K_V1, **kwargs: Any, ) -> LRASPP: - """Constructs a Lite R-ASPP Network model with a MobileNetV3-Large backbone. + """Constructs a Lite R-ASPP Network model with a MobileNetV3-Large backbone from + `Searching for MobileNetV3 `_ paper. Args: - weights (LRASPP_MobileNet_V3_Large_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 (MobileNet_V3_Large_Weights, optional): The pretrained weights for the backbone + weights (:class:`~torchvision.models.segmentation.LRASPP_MobileNet_V3_Large_Weights`, optional): The + pretrained weights to use. See + :class:`~torchvision.models.segmentation.LRASPP_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). + aux_loss (bool, optional): If True, it uses an auxiliary loss. + weights_backbone (:class:`~torchvision.models.MobileNet_V3_Large_Weights`, optional): The pretrained + weights for the backbone. + **kwargs: parameters passed to the ``torchvision.models.segmentation.LRASPP`` + base class. Please refer to the `source code + `_ + for more details about this class. + + .. autoclass:: torchvision.models.segmentation.LRASPP_MobileNet_V3_Large_Weights + :members: """ if kwargs.pop("aux_loss", False): raise NotImplementedError("This model does not use auxiliary loss") From 2c17f2c31d669862cf56a7008980776ff3c4b7f8 Mon Sep 17 00:00:00 2001 From: Aditya Oke Date: Fri, 29 Apr 2022 16:28:45 +0530 Subject: [PATCH 2/3] Small fix --- docs/source/models/lraspp.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/models/lraspp.rst b/docs/source/models/lraspp.rst index bda76327bc4..0d8d9471f85 100644 --- a/docs/source/models/lraspp.rst +++ b/docs/source/models/lraspp.rst @@ -3,7 +3,7 @@ LRASPP .. currentmodule:: torchvision.models.segmentation -The FCN model is based on the `"Searching for MobileNetV3" `_ paper. +The LRASPP model is based on the `"Searching for MobileNetV3" `_ paper. Model builders -------------- From 2f2f658e447b1967bdfd374a630a065ab8fc9509 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Tue, 3 May 2022 10:33:46 +0100 Subject: [PATCH 3/3] Update docs/source/models/lraspp.rst --- docs/source/models/lraspp.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/models/lraspp.rst b/docs/source/models/lraspp.rst index 0d8d9471f85..7d419eb21e8 100644 --- a/docs/source/models/lraspp.rst +++ b/docs/source/models/lraspp.rst @@ -3,7 +3,7 @@ LRASPP .. currentmodule:: torchvision.models.segmentation -The LRASPP model is based on the `"Searching for MobileNetV3" `_ paper. +The LRASPP model is based on the `Searching for MobileNetV3 `_ paper. Model builders --------------