From a14afd7f7088d980652c550de3d02ab72db7353b Mon Sep 17 00:00:00 2001 From: Aditya Oke Date: Fri, 29 Apr 2022 17:23:20 +0530 Subject: [PATCH 1/4] Add inception --- docs/source/models_new.rst | 1 + torchvision/models/inception.py | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/source/models_new.rst b/docs/source/models_new.rst index b4945938824..6d3461e84cd 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/inception models/mobilenetv2 models/mobilenetv3 models/regnet diff --git a/torchvision/models/inception.py b/torchvision/models/inception.py index 1428f7f7002..fb88b41c992 100644 --- a/torchvision/models/inception.py +++ b/torchvision/models/inception.py @@ -427,7 +427,8 @@ class Inception_V3_Weights(WeightsEnum): @handle_legacy_interface(weights=("pretrained", Inception_V3_Weights.IMAGENET1K_V1)) def inception_v3(*, weights: Optional[Inception_V3_Weights] = None, progress: bool = True, **kwargs: Any) -> Inception3: - r"""Inception v3 model architecture from + """ + Inception v3 model architecture from `"Rethinking the Inception Architecture for Computer Vision" `_. The required minimum input size of the model is 75x75. @@ -436,12 +437,20 @@ def inception_v3(*, weights: Optional[Inception_V3_Weights] = None, progress: bo N x 3 x 299 x 299, so ensure your images are sized accordingly. Args: - weights (Inception_V3_Weights, optional): The pretrained weights for the model - progress (bool): If True, displays a progress bar of the download to stderr - aux_logits (bool): If True, add an auxiliary branch that can improve training. - Default: *True* - transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: True if ``weights=Inception_V3_Weights.IMAGENET1K_V1``, else False. + weights (:class:`~torchvision.models.Inception_V3_Weights`, optional): The + pretrained weights for the model. See + :class:`~torchvision.models.Inception_V3_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.Inception3`` + base class. Please refer to the `source code + `_ + for more details about this class. + + .. autoclass:: torchvision.models.Inception_V3_Weights + :members: """ weights = Inception_V3_Weights.verify(weights) From 05c653c64999732425fdbea22863641176fbc50e Mon Sep 17 00:00:00 2001 From: Aditya Oke Date: Fri, 29 Apr 2022 17:23:40 +0530 Subject: [PATCH 2/4] Fix googlenet bug --- torchvision/models/googlenet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchvision/models/googlenet.py b/torchvision/models/googlenet.py index cb65306b9fd..3de5662d59b 100644 --- a/torchvision/models/googlenet.py +++ b/torchvision/models/googlenet.py @@ -307,7 +307,7 @@ def googlenet(*, weights: Optional[GoogLeNet_Weights] = None, progress: bool = T 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.squeezenet.GoogLeNet`` + **kwargs: parameters passed to the ``torchvision.models.GoogLeNet`` base class. Please refer to the `source code `_ for more details about this class. From 97bd16a2d053acd7d9a1555a7f211750c2add8dc Mon Sep 17 00:00:00 2001 From: Aditya Oke Date: Fri, 29 Apr 2022 17:25:40 +0530 Subject: [PATCH 3/4] Fix bug add file --- docs/source/models.rst | 2 +- docs/source/models/inception.rst | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 docs/source/models/inception.rst diff --git a/docs/source/models.rst b/docs/source/models.rst index 3b1db1b3bf4..919ab1d37e4 100644 --- a/docs/source/models.rst +++ b/docs/source/models.rst @@ -457,7 +457,7 @@ ConvNeXt convnext_large SwinTransformer --------- +--------------- .. autosummary:: :toctree: generated/ diff --git a/docs/source/models/inception.rst b/docs/source/models/inception.rst new file mode 100644 index 00000000000..6ba42fc2385 --- /dev/null +++ b/docs/source/models/inception.rst @@ -0,0 +1,23 @@ +Inception V3 +============ + +.. currentmodule:: torchvision.models + +The EfficientNet model is based on the `Rethinking the Inception Architecture for Computer Vision `__ +paper. + + +Model builders +-------------- + +The following model builders can be used to instanciate an InceptionV3 model, with or +without pre-trained weights. All the model builders internally rely on the +``torchvision.models.efficientnet.Inception3`` base class. Please refer to the `source +code `_ for +more details about this class. + +.. autosummary:: + :toctree: generated/ + :template: function.rst + + inception_v3 From 972b6398d4bdfa76ef64ea4e67220599fba8132c Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Tue, 3 May 2022 10:36:06 +0100 Subject: [PATCH 4/4] Update torchvision/models/inception.py --- torchvision/models/inception.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchvision/models/inception.py b/torchvision/models/inception.py index fb88b41c992..e8eecca5db6 100644 --- a/torchvision/models/inception.py +++ b/torchvision/models/inception.py @@ -429,7 +429,7 @@ class Inception_V3_Weights(WeightsEnum): def inception_v3(*, weights: Optional[Inception_V3_Weights] = None, progress: bool = True, **kwargs: Any) -> Inception3: """ Inception v3 model architecture from - `"Rethinking the Inception Architecture for Computer Vision" `_. + `Rethinking the Inception Architecture for Computer Vision `_. The required minimum input size of the model is 75x75. .. note::