Unverified Commit 2942bfa4 authored by F-G Fernandez's avatar F-G Fernandez Committed by GitHub
Browse files

docs: Added FCN to the new doc (#5915)



* docs: Added FCN to new doc

* docs: Updated docstring

* docs: Fixed docstring

* Update docs/source/models/fcn.rst
Co-authored-by: default avatarAditya Oke <47158509+oke-aditya@users.noreply.github.com>

* Apply suggestions from code review
Co-authored-by: default avatarFG Fernandez <–26927750+frgfm@users.noreply.github.com>
Co-authored-by: default avatarNicolas Hug <contact@nicolas-hug.com>
Co-authored-by: default avatarAditya Oke <47158509+oke-aditya@users.noreply.github.com>
parent 87e45f77
FCN
===
.. currentmodule:: torchvision.models.segmentation
The FCN model is based on the `Fully Convolutional Networks for Semantic
Segmentation <https://arxiv.org/abs/1411.4038>`__
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.FCN`` base class. Please refer to the `source
code
<https://github.com/pytorch/vision/blob/main/torchvision/models/segmentation/fcn.py>`_ for
more details about this class.
.. autosummary::
:toctree: generated/
:template: function.rst
fcn_resnet50
fcn_resnet101
...@@ -73,6 +73,7 @@ pre-trained weights: ...@@ -73,6 +73,7 @@ pre-trained weights:
:maxdepth: 1 :maxdepth: 1
models/deeplabv3 models/deeplabv3
models/fcn
Table of all available semantic segmentation weights Table of all available semantic segmentation weights
......
...@@ -115,15 +115,30 @@ def fcn_resnet50( ...@@ -115,15 +115,30 @@ def fcn_resnet50(
weights_backbone: Optional[ResNet50_Weights] = ResNet50_Weights.IMAGENET1K_V1, weights_backbone: Optional[ResNet50_Weights] = ResNet50_Weights.IMAGENET1K_V1,
**kwargs: Any, **kwargs: Any,
) -> FCN: ) -> FCN:
"""Constructs a Fully-Convolutional Network model with a ResNet-50 backbone. """Fully-Convolutional Network model with a ResNet-50 backbone from the `Fully Convolutional
Networks for Semantic Segmentation <https://arxiv.org/abs/1411.4038>`_ paper.
Args: Args:
weights (FCN_ResNet50_Weights, optional): The pretrained weights for the model weights (:class:`~torchvision.models.segmentation.FCN_ResNet50_Weights`, optional): The
progress (bool): If True, displays a progress bar of the download to stderr pretrained weights to use. See
num_classes (int, optional): number of output classes of the model (including the background) :class:`~torchvision.models.segmentation.FCN_ResNet50_Weights` below for
aux_loss (bool, optional): If True, it uses an auxiliary loss more details, and possible values. By default, no pre-trained
weights_backbone (ResNet50_Weights, optional): The pretrained weights for the backbone 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.ResNet50_Weights`, optional): The pretrained
weights for the backbone.
**kwargs: parameters passed to the ``torchvision.models.segmentation.fcn.FCN``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/segmentation/fcn.py>`_
for more details about this class.
.. autoclass:: torchvision.models.segmentation.FCN_ResNet50_Weights
:members:
""" """
weights = FCN_ResNet50_Weights.verify(weights) weights = FCN_ResNet50_Weights.verify(weights)
weights_backbone = ResNet50_Weights.verify(weights_backbone) weights_backbone = ResNet50_Weights.verify(weights_backbone)
...@@ -156,15 +171,30 @@ def fcn_resnet101( ...@@ -156,15 +171,30 @@ def fcn_resnet101(
weights_backbone: Optional[ResNet101_Weights] = ResNet101_Weights.IMAGENET1K_V1, weights_backbone: Optional[ResNet101_Weights] = ResNet101_Weights.IMAGENET1K_V1,
**kwargs: Any, **kwargs: Any,
) -> FCN: ) -> FCN:
"""Constructs a Fully-Convolutional Network model with a ResNet-101 backbone. """Fully-Convolutional Network model with a ResNet-101 backbone from the `Fully Convolutional
Networks for Semantic Segmentation <https://arxiv.org/abs/1411.4038>`_ paper.
Args: Args:
weights (FCN_ResNet101_Weights, optional): The pretrained weights for the model weights (:class:`~torchvision.models.segmentation.FCN_ResNet101_Weights`, optional): The
progress (bool): If True, displays a progress bar of the download to stderr pretrained weights to use. See
num_classes (int, optional): number of output classes of the model (including the background) :class:`~torchvision.models.segmentation.FCN_ResNet101_Weights` below for
aux_loss (bool, optional): If True, it uses an auxiliary loss more details, and possible values. By default, no pre-trained
weights_backbone (ResNet101_Weights, optional): The pretrained weights for the backbone 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.ResNet101_Weights`, optional): The pretrained
weights for the backbone.
**kwargs: parameters passed to the ``torchvision.models.segmentation.fcn.FCN``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/segmentation/fcn.py>`_
for more details about this class.
.. autoclass:: torchvision.models.segmentation.FCN_ResNet101_Weights
:members:
""" """
weights = FCN_ResNet101_Weights.verify(weights) weights = FCN_ResNet101_Weights.verify(weights)
weights_backbone = ResNet101_Weights.verify(weights_backbone) weights_backbone = ResNet101_Weights.verify(weights_backbone)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment