mirror of
https://github.com/open-mmlab/mmsegmentation.git
synced 2025-06-03 22:03:48 +08:00
doc strings added
This commit is contained in:
parent
d3a53423c3
commit
2c77085dc2
@ -188,6 +188,44 @@ class FastSCNN(nn.Module):
|
|||||||
norm_cfg=dict(type='BN'),
|
norm_cfg=dict(type='BN'),
|
||||||
act_cfg=dict(type='ReLU'),
|
act_cfg=dict(type='ReLU'),
|
||||||
align_corners=False):
|
align_corners=False):
|
||||||
|
|
||||||
|
"""Fast-SCNN Backbone.
|
||||||
|
Args:
|
||||||
|
in_channels(int): Number of input image channels. Default=3 (RGB)
|
||||||
|
|
||||||
|
downsample_dw_channels1(int): Number of output channels after
|
||||||
|
the first conv layer in Learning-To-Downsample (LTD) module.
|
||||||
|
|
||||||
|
downsample_dw_channels2(int): Number of output channels after the second conv layer in LTD.
|
||||||
|
|
||||||
|
global_in_channels(int): Number of input channels of Global Feature Extractor(GFE).
|
||||||
|
Equal to number of output channels of LTD.
|
||||||
|
|
||||||
|
global_block_channels(tuple): Tuple of integers that describe the output channels for
|
||||||
|
each of the MobileNet-v2 bottleneck residual blocks in GFE.
|
||||||
|
|
||||||
|
global_out_channels(int): Number of output channels of GFE.
|
||||||
|
|
||||||
|
higher_in_channels(int): Number of input channels of the higher resolution branch in FFM.
|
||||||
|
Equal to global_in_channels.
|
||||||
|
|
||||||
|
lower_in_channels(int): Number of input channels of the lower resolution branch in FFM.
|
||||||
|
Equal to global_out_channels.
|
||||||
|
|
||||||
|
fusion_out_channels(int): Number of output channels of FFM.
|
||||||
|
|
||||||
|
scale_factor(int): The upsampling factor of the higher resolution branch in FFM.
|
||||||
|
Equal to the downsampling factor in GFE.
|
||||||
|
|
||||||
|
out_indices(tuple): Tuple of indices of list [higher_res_features, lower_res_features, fusion_output].
|
||||||
|
Often set to (0,1,2) to enable aux. heads.
|
||||||
|
|
||||||
|
conv_cfg (dict|None): Config of conv layers.
|
||||||
|
norm_cfg (dict|None): Config of norm layers.
|
||||||
|
act_cfg (dict): Config of activation layers.
|
||||||
|
align_corners (bool): align_corners argument of F.interpolate.
|
||||||
|
"""
|
||||||
|
|
||||||
super(FastSCNN, self).__init__()
|
super(FastSCNN, self).__init__()
|
||||||
self.in_channels = in_channels
|
self.in_channels = in_channels
|
||||||
self.downsample_dw_channels1 = downsample_dw_channels1
|
self.downsample_dw_channels1 = downsample_dw_channels1
|
||||||
|
@ -5,6 +5,27 @@ from .fcn_head import FCNHead
|
|||||||
|
|
||||||
@HEADS.register_module()
|
@HEADS.register_module()
|
||||||
class SepFCNHead(FCNHead):
|
class SepFCNHead(FCNHead):
|
||||||
|
"""Depthwise-Separable Fully Convolutional Network for Semantic Segmentation
|
||||||
|
|
||||||
|
This head is implemented according to Fast-SCNN.
|
||||||
|
Args:
|
||||||
|
in_channels(int): Number of output channels of FFM.
|
||||||
|
|
||||||
|
channels(int): Number of middle-stage channels in the decode head.
|
||||||
|
|
||||||
|
concat_input(bool): Whether to concatenate original decode input into
|
||||||
|
the result of consecutive convolution layers.
|
||||||
|
|
||||||
|
num_classes(int): Used to determine the dimension of final prediction tensor.
|
||||||
|
|
||||||
|
in_index(int): Correspond with 'out_indices' in FastSCNN backbone.
|
||||||
|
|
||||||
|
norm_cfg (dict|None): Config of norm layers.
|
||||||
|
|
||||||
|
align_corners (bool): align_corners argument of F.interpolate.
|
||||||
|
|
||||||
|
loss_decode(dict): Config of loss type and some relevant additional options.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super(SepFCNHead, self).__init__(**kwargs)
|
super(SepFCNHead, self).__init__(**kwargs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user