MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / __init__

Method __init__

segmentation/backbones/fast_scnn.py:116–158  ·  view source on GitHub ↗
(self,
                 in_channels=64,
                 block_channels=(64, 96, 128),
                 out_channels=128,
                 expand_ratio=6,
                 num_blocks=(3, 3, 3),
                 strides=(2, 2, 1),
                 pool_scales=(1, 2, 3, 6),
                 conv_cfg=None,
                 norm_cfg=dict(type='BN'),
                 act_cfg=dict(type='ReLU'),
                 align_corners=False)

Source from the content-addressed store, hash-verified

114 """
115
116 def __init__(self,
117 in_channels=64,
118 block_channels=(64, 96, 128),
119 out_channels=128,
120 expand_ratio=6,
121 num_blocks=(3, 3, 3),
122 strides=(2, 2, 1),
123 pool_scales=(1, 2, 3, 6),
124 conv_cfg=None,
125 norm_cfg=dict(type='BN'),
126 act_cfg=dict(type='ReLU'),
127 align_corners=False):
128 super(GlobalFeatureExtractor, self).__init__()
129 self.conv_cfg = conv_cfg
130 self.norm_cfg = norm_cfg
131 self.act_cfg = act_cfg
132 assert len(block_channels) == len(num_blocks) == 3
133 self.bottleneck1 = self._make_layer(in_channels, block_channels[0],
134 num_blocks[0], strides[0],
135 expand_ratio)
136 self.bottleneck2 = self._make_layer(block_channels[0],
137 block_channels[1], num_blocks[1],
138 strides[1], expand_ratio)
139 self.bottleneck3 = self._make_layer(block_channels[1],
140 block_channels[2], num_blocks[2],
141 strides[2], expand_ratio)
142 self.ppm = PPM(
143 pool_scales,
144 block_channels[2],
145 block_channels[2] // 4,
146 conv_cfg=self.conv_cfg,
147 norm_cfg=self.norm_cfg,
148 act_cfg=self.act_cfg,
149 align_corners=align_corners)
150
151 self.out = ConvModule(
152 block_channels[2] * 2,
153 out_channels,
154 3,
155 padding=1,
156 conv_cfg=self.conv_cfg,
157 norm_cfg=self.norm_cfg,
158 act_cfg=self.act_cfg)
159
160 def _make_layer(self,
161 in_channels,

Callers

nothing calls this directly

Calls 2

_make_layerMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected