MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / __init__

Method __init__

mmseg/models/backbones/unet.py:182–214  ·  view source on GitHub ↗
(
        self,
        in_channels,
        out_channels,
        with_cp=False,
        norm_cfg=dict(type="BN"),
        act_cfg=dict(type="ReLU"),
        *,
        conv_cfg=None,
        conv_first=False,
        kernel_size=1,
        stride=1,
        padding=0,
        upsample_cfg=dict(scale_factor=2, mode="bilinear", align_corners=False),
    )

Source from the content-addressed store, hash-verified

180 """
181
182 def __init__(
183 self,
184 in_channels,
185 out_channels,
186 with_cp=False,
187 norm_cfg=dict(type="BN"),
188 act_cfg=dict(type="ReLU"),
189 *,
190 conv_cfg=None,
191 conv_first=False,
192 kernel_size=1,
193 stride=1,
194 padding=0,
195 upsample_cfg=dict(scale_factor=2, mode="bilinear", align_corners=False),
196 ):
197 super(InterpConv, self).__init__()
198
199 self.with_cp = with_cp
200 conv = ConvModule(
201 in_channels,
202 out_channels,
203 kernel_size=kernel_size,
204 stride=stride,
205 padding=padding,
206 conv_cfg=conv_cfg,
207 norm_cfg=norm_cfg,
208 act_cfg=act_cfg,
209 )
210 upsample = Upsample(**upsample_cfg)
211 if conv_first:
212 self.interp_upsample = nn.Sequential(conv, upsample)
213 else:
214 self.interp_upsample = nn.Sequential(upsample, conv)
215
216 def forward(self, x):
217 """Forward function."""

Callers

nothing calls this directly

Calls 2

UpsampleClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected