mmagic.models.archs.aspp
¶
Module Contents¶
Classes¶
ASPP Pooling module. |
|
ASPP module from DeepLabV3. |
- class mmagic.models.archs.aspp.ASPPPooling(in_channels: int, out_channels: int, conv_cfg: Optional[dict], norm_cfg: Optional[dict], act_cfg: Optional[dict])[source]¶
Bases:
torch.nn.Sequential
ASPP Pooling module.
The code is adopted from https://github.com/pytorch/vision/blob/master/torchvision/models/ segmentation/deeplabv3.py
- Parameters
in_channels (int) – Input channels of the module.
out_channels (int) – Output channels of the module.
conv_cfg (dict) – Config dict for convolution layer. If “None”, nn.Conv2d will be applied.
norm_cfg (dict) – Config dict for normalization layer.
act_cfg (dict) – Config dict for activation layer.
- class mmagic.models.archs.aspp.ASPP(in_channels: int, out_channels: int = 256, mid_channels: int = 256, dilations: Sequence[int] = (12, 24, 36), conv_cfg: Optional[dict] = None, norm_cfg: Optional[dict] = dict(type='BN'), act_cfg: Optional[dict] = dict(type='ReLU'), separable_conv: bool = False)[source]¶
Bases:
torch.nn.Module
ASPP module from DeepLabV3.
The code is adopted from https://github.com/pytorch/vision/blob/master/torchvision/models/ segmentation/deeplabv3.py
For more information about the module: “Rethinking Atrous Convolution for Semantic Image Segmentation”.
- Parameters
in_channels (int) – Input channels of the module.
out_channels (int) – Output channels of the module. Default: 256.
mid_channels (int) – Output channels of the intermediate ASPP conv modules. Default: 256.
dilations (Sequence[int]) – Dilation rate of three ASPP conv module. Default: [12, 24, 36].
conv_cfg (dict) – Config dict for convolution layer. If “None”, nn.Conv2d will be applied. Default: None.
norm_cfg (dict) – Config dict for normalization layer. Default: dict(type=’BN’).
act_cfg (dict) – Config dict for activation layer. Default: dict(type=’ReLU’).
separable_conv (bool) – Whether replace normal conv with depthwise separable conv which is faster. Default: False.