MCPcopy Create free account
hub / github.com/ZhengPeng7/BiRefNet / __init__

Method __init__

models/refinement/stem_layer.py:14–37  ·  view source on GitHub ↗
(self,
                 in_channels=3+1,
                 inter_channels=48,
                 out_channels=96,
                 act_layer='GELU',
                 norm_layer='BN')

Source from the content-addressed store, hash-verified

12 """
13
14 def __init__(self,
15 in_channels=3+1,
16 inter_channels=48,
17 out_channels=96,
18 act_layer='GELU',
19 norm_layer='BN'):
20 super().__init__()
21 self.conv1 = nn.Conv2d(in_channels,
22 inter_channels,
23 kernel_size=3,
24 stride=1,
25 padding=1)
26 self.norm1 = build_norm_layer(
27 inter_channels, norm_layer, 'channels_first', 'channels_first'
28 )
29 self.act = build_act_layer(act_layer)
30 self.conv2 = nn.Conv2d(inter_channels,
31 out_channels,
32 kernel_size=3,
33 stride=1,
34 padding=1)
35 self.norm2 = build_norm_layer(
36 out_channels, norm_layer, 'channels_first', 'channels_first'
37 )
38
39 def forward(self, x):
40 x = self.conv1(x)

Callers

nothing calls this directly

Calls 2

build_norm_layerFunction · 0.90
build_act_layerFunction · 0.90

Tested by

no test coverage detected