MCPcopy Create free account
hub / github.com/devinxzhang/MFuser / __init__

Method __init__

mmseg/models/plugins/pixel_decoder.py:31–74  ·  view source on GitHub ↗
(self,
                 in_channels,
                 feat_channels,
                 out_channels,
                 norm_cfg=dict(type='GN', num_groups=32),
                 act_cfg=dict(type='ReLU'),
                 init_cfg=None)

Source from the content-addressed store, hash-verified

29 Default: None
30 """
31 def __init__(self,
32 in_channels,
33 feat_channels,
34 out_channels,
35 norm_cfg=dict(type='GN', num_groups=32),
36 act_cfg=dict(type='ReLU'),
37 init_cfg=None):
38 super().__init__(init_cfg=init_cfg)
39 self.in_channels = in_channels
40 self.num_inputs = len(in_channels)
41 self.lateral_convs = ModuleList()
42 self.output_convs = ModuleList()
43 self.use_bias = norm_cfg is None
44 for i in range(0, self.num_inputs - 1):
45 l_conv = ConvModule(
46 in_channels[i],
47 feat_channels,
48 kernel_size=1,
49 bias=self.use_bias,
50 norm_cfg=norm_cfg,
51 act_cfg=None)
52 o_conv = ConvModule(
53 feat_channels,
54 feat_channels,
55 kernel_size=3,
56 stride=1,
57 padding=1,
58 bias=self.use_bias,
59 norm_cfg=norm_cfg,
60 act_cfg=act_cfg)
61 self.lateral_convs.append(l_conv)
62 self.output_convs.append(o_conv)
63
64 self.last_feat_conv = ConvModule(
65 in_channels[-1],
66 feat_channels,
67 kernel_size=3,
68 padding=1,
69 stride=1,
70 bias=self.use_bias,
71 norm_cfg=norm_cfg,
72 act_cfg=act_cfg)
73 self.mask_feature = Conv2d(
74 feat_channels, out_channels, kernel_size=3, stride=1, padding=1)
75
76 def init_weights(self):
77 """Initialize weights."""

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected