MCPcopy Create free account
hub / github.com/aigc3d/LHM / __init__

Method __init__

engine/BiRefNet/models/refinement/stem_layer.py:15–36  ·  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

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