MCPcopy Create free account
hub / github.com/ZHKKKe/MODNet / forward

Method forward

torchscript/modnet_torchscript.py:184–194  ·  view source on GitHub ↗
(self, img, lr8x, hr2x)

Source from the content-addressed store, hash-verified

182 )
183
184 def forward(self, img, lr8x, hr2x):
185 lr4x = F.interpolate(lr8x, scale_factor=2.0, mode='bilinear', align_corners=False)
186 lr4x = self.conv_lr4x(lr4x)
187 lr2x = F.interpolate(lr4x, scale_factor=2.0, mode='bilinear', align_corners=False)
188
189 f2x = self.conv_f2x(torch.cat((lr2x, hr2x), dim=1))
190 f = F.interpolate(f2x, scale_factor=2.0, mode='bilinear', align_corners=False)
191 f = self.conv_f(torch.cat((f, img), dim=1))
192 pred_matte = torch.sigmoid(f)
193
194 return pred_matte
195
196
197#------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected