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

Method __init__

mmseg/models/backbones/stdc.py:356–379  ·  view source on GitHub ↗
(
        self,
        backbone_cfg,
        last_in_channels=(1024, 512),
        out_channels=128,
        ffm_cfg=dict(in_channels=512, out_channels=256, scale_factor=4),
        upsample_mode="nearest",
        align_corners=None,
        norm_cfg=dict(type="BN"),
        init_cfg=None,
    )

Source from the content-addressed store, hash-verified

354 """
355
356 def __init__(
357 self,
358 backbone_cfg,
359 last_in_channels=(1024, 512),
360 out_channels=128,
361 ffm_cfg=dict(in_channels=512, out_channels=256, scale_factor=4),
362 upsample_mode="nearest",
363 align_corners=None,
364 norm_cfg=dict(type="BN"),
365 init_cfg=None,
366 ):
367 super(STDCContextPathNet, self).__init__(init_cfg=init_cfg)
368 self.backbone = build_backbone(backbone_cfg)
369 self.arms = ModuleList()
370 self.convs = ModuleList()
371 for channels in last_in_channels:
372 self.arms.append(AttentionRefinementModule(channels, out_channels))
373 self.convs.append(ConvModule(out_channels, out_channels, 3, padding=1, norm_cfg=norm_cfg))
374 self.conv_avg = ConvModule(last_in_channels[0], out_channels, 1, norm_cfg=norm_cfg)
375
376 self.ffm = FeatureFusionModule(**ffm_cfg)
377
378 self.upsample_mode = upsample_mode
379 self.align_corners = align_corners
380
381 def forward(self, x):
382 outs = list(self.backbone(x))

Callers

nothing calls this directly

Calls 4

FeatureFusionModuleClass · 0.70
build_backboneFunction · 0.50
__init__Method · 0.45

Tested by

no test coverage detected