Skip to content

Commit baee41c

Browse files
YosuaMichaeloke-adityaFG FernandezNicolasHug
authored andcommitted
[fbsync] docs: Added FCN to the new doc (#5915)
Summary: * docs: Added FCN to new doc * docs: Updated docstring * docs: Fixed docstring * Update docs/source/models/fcn.rst * Apply suggestions from code review Reviewed By: jdsgomes, NicolasHug Differential Revision: D36095707 fbshipit-source-id: f8c9baa10936283efe9a1eaa151c6a79f64195a1 Co-authored-by: Aditya Oke <[email protected]> Co-authored-by: FG Fernandez <�[email protected]> Co-authored-by: Nicolas Hug <[email protected]> Co-authored-by: Aditya Oke <[email protected]>
1 parent c72ec05 commit baee41c

File tree

3 files changed

+69
-12
lines changed

3 files changed

+69
-12
lines changed

docs/source/models/fcn.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FCN
2+
===
3+
4+
.. currentmodule:: torchvision.models.segmentation
5+
6+
The FCN model is based on the `Fully Convolutional Networks for Semantic
7+
Segmentation <https://arxiv.org/abs/1411.4038>`__
8+
paper.
9+
10+
11+
Model builders
12+
--------------
13+
14+
The following model builders can be used to instantiate a FCN model, with or
15+
without pre-trained weights. All the model builders internally rely on the
16+
``torchvision.models.segmentation.FCN`` base class. Please refer to the `source
17+
code
18+
<https://github.com/pytorch/vision/blob/main/torchvision/models/segmentation/fcn.py>`_ for
19+
more details about this class.
20+
21+
.. autosummary::
22+
:toctree: generated/
23+
:template: function.rst
24+
25+
fcn_resnet50
26+
fcn_resnet101

docs/source/models_new.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ pre-trained weights:
7373
:maxdepth: 1
7474

7575
models/deeplabv3
76+
models/fcn
7677

7778

7879
Table of all available semantic segmentation weights

torchvision/models/segmentation/fcn.py

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,30 @@ def fcn_resnet50(
115115
weights_backbone: Optional[ResNet50_Weights] = ResNet50_Weights.IMAGENET1K_V1,
116116
**kwargs: Any,
117117
) -> FCN:
118-
"""Constructs a Fully-Convolutional Network model with a ResNet-50 backbone.
118+
"""Fully-Convolutional Network model with a ResNet-50 backbone from the `Fully Convolutional
119+
Networks for Semantic Segmentation <https://arxiv.org/abs/1411.4038>`_ paper.
119120
120121
Args:
121-
weights (FCN_ResNet50_Weights, optional): The pretrained weights for the model
122-
progress (bool): If True, displays a progress bar of the download to stderr
123-
num_classes (int, optional): number of output classes of the model (including the background)
124-
aux_loss (bool, optional): If True, it uses an auxiliary loss
125-
weights_backbone (ResNet50_Weights, optional): The pretrained weights for the backbone
122+
weights (:class:`~torchvision.models.segmentation.FCN_ResNet50_Weights`, optional): The
123+
pretrained weights to use. See
124+
:class:`~torchvision.models.segmentation.FCN_ResNet50_Weights` below for
125+
more details, and possible values. By default, no pre-trained
126+
weights are used.
127+
progress (bool, optional): If True, displays a progress bar of the
128+
download to stderr. Default is True.
129+
num_classes (int, optional): number of output classes of the model (including the background).
130+
aux_loss (bool, optional): If True, it uses an auxiliary loss.
131+
weights_backbone (:class:`~torchvision.models.ResNet50_Weights`, optional): The pretrained
132+
weights for the backbone.
133+
**kwargs: parameters passed to the ``torchvision.models.segmentation.fcn.FCN``
134+
base class. Please refer to the `source code
135+
<https://github.com/pytorch/vision/blob/main/torchvision/models/segmentation/fcn.py>`_
136+
for more details about this class.
137+
138+
.. autoclass:: torchvision.models.segmentation.FCN_ResNet50_Weights
139+
:members:
126140
"""
141+
127142
weights = FCN_ResNet50_Weights.verify(weights)
128143
weights_backbone = ResNet50_Weights.verify(weights_backbone)
129144

@@ -156,15 +171,30 @@ def fcn_resnet101(
156171
weights_backbone: Optional[ResNet101_Weights] = ResNet101_Weights.IMAGENET1K_V1,
157172
**kwargs: Any,
158173
) -> FCN:
159-
"""Constructs a Fully-Convolutional Network model with a ResNet-101 backbone.
174+
"""Fully-Convolutional Network model with a ResNet-101 backbone from the `Fully Convolutional
175+
Networks for Semantic Segmentation <https://arxiv.org/abs/1411.4038>`_ paper.
160176
161177
Args:
162-
weights (FCN_ResNet101_Weights, optional): The pretrained weights for the model
163-
progress (bool): If True, displays a progress bar of the download to stderr
164-
num_classes (int, optional): number of output classes of the model (including the background)
165-
aux_loss (bool, optional): If True, it uses an auxiliary loss
166-
weights_backbone (ResNet101_Weights, optional): The pretrained weights for the backbone
178+
weights (:class:`~torchvision.models.segmentation.FCN_ResNet101_Weights`, optional): The
179+
pretrained weights to use. See
180+
:class:`~torchvision.models.segmentation.FCN_ResNet101_Weights` below for
181+
more details, and possible values. By default, no pre-trained
182+
weights are used.
183+
progress (bool, optional): If True, displays a progress bar of the
184+
download to stderr. Default is True.
185+
num_classes (int, optional): number of output classes of the model (including the background).
186+
aux_loss (bool, optional): If True, it uses an auxiliary loss.
187+
weights_backbone (:class:`~torchvision.models.ResNet101_Weights`, optional): The pretrained
188+
weights for the backbone.
189+
**kwargs: parameters passed to the ``torchvision.models.segmentation.fcn.FCN``
190+
base class. Please refer to the `source code
191+
<https://github.com/pytorch/vision/blob/main/torchvision/models/segmentation/fcn.py>`_
192+
for more details about this class.
193+
194+
.. autoclass:: torchvision.models.segmentation.FCN_ResNet101_Weights
195+
:members:
167196
"""
197+
168198
weights = FCN_ResNet101_Weights.verify(weights)
169199
weights_backbone = ResNet101_Weights.verify(weights_backbone)
170200

0 commit comments

Comments
 (0)