MCPcopy Create free account
hub / github.com/Sense-X/Co-DETR / __init__

Method __init__

mmdet/models/plugins/pixel_decoder.py:34–77  ·  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

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

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected