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

Method __init__

engine/BiRefNet/models/refinement/refiner.py:120–139  ·  view source on GitHub ↗
(self, channels)

Source from the content-addressed store, hash-verified

118
119class Decoder(nn.Module):
120 def __init__(self, channels):
121 super(Decoder, self).__init__()
122 self.config = Config()
123 DecoderBlock = eval("BasicDecBlk")
124 LateralBlock = eval("BasicLatBlk")
125
126 self.decoder_block4 = DecoderBlock(channels[0], channels[1])
127 self.decoder_block3 = DecoderBlock(channels[1], channels[2])
128 self.decoder_block2 = DecoderBlock(channels[2], channels[3])
129 self.decoder_block1 = DecoderBlock(channels[3], channels[3] // 2)
130
131 self.lateral_block4 = LateralBlock(channels[1], channels[1])
132 self.lateral_block3 = LateralBlock(channels[2], channels[2])
133 self.lateral_block2 = LateralBlock(channels[3], channels[3])
134
135 if self.config.ms_supervision:
136 self.conv_ms_spvn_4 = nn.Conv2d(channels[1], 1, 1, 1, 0)
137 self.conv_ms_spvn_3 = nn.Conv2d(channels[2], 1, 1, 1, 0)
138 self.conv_ms_spvn_2 = nn.Conv2d(channels[3], 1, 1, 1, 0)
139 self.conv_out1 = nn.Sequential(nn.Conv2d(channels[3] // 2, 1, 1, 1, 0))
140
141 def forward(self, features):
142 x, x1, x2, x3, x4 = features

Callers

nothing calls this directly

Calls 3

ConfigClass · 0.90
evalFunction · 0.50
__init__Method · 0.45

Tested by

no test coverage detected