diff --git a/mmseg/models/backbones/fast_scnn.py b/mmseg/models/backbones/fast_scnn.py index 3acf541c8..fb9df6383 100644 --- a/mmseg/models/backbones/fast_scnn.py +++ b/mmseg/models/backbones/fast_scnn.py @@ -188,6 +188,44 @@ class FastSCNN(nn.Module): norm_cfg=dict(type='BN'), act_cfg=dict(type='ReLU'), 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__() self.in_channels = in_channels self.downsample_dw_channels1 = downsample_dw_channels1 diff --git a/mmseg/models/decode_heads/sep_fcn_head.py b/mmseg/models/decode_heads/sep_fcn_head.py index e93dfab9b..d93c246f7 100644 --- a/mmseg/models/decode_heads/sep_fcn_head.py +++ b/mmseg/models/decode_heads/sep_fcn_head.py @@ -5,6 +5,27 @@ from .fcn_head import FCNHead @HEADS.register_module() 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): super(SepFCNHead, self).__init__(**kwargs)