MCPcopy Create free account
hub / github.com/ChunmingHe/WS-SAM / forward

Method forward

lib/Modules.py:854–863  ·  view source on GitHub ↗
(self, f4, prior_cam)

Source from the content-addressed store, hash-verified

852 self.out_s = nn.Conv2d(in_channels, 1, kernel_size=3, padding=1)
853
854 def forward(self, f4, prior_cam):
855 prior_cam = F.interpolate(prior_cam, size=f4.size()[2:], mode='bilinear', align_corners=True) # 2,1,12,12->2,1,48,48
856 r_prior_cam = 1 - torch.sigmoid(prior_cam)
857 prior_cam = torch.sigmoid(prior_cam)
858 f4_a = self.rcab_a(f4 * r_prior_cam.expand(-1, f4.size()[1], -1, -1) + f4)
859 f4_b = self.rcab_b(f4 * prior_cam.expand(-1, f4.size()[1], -1, -1) + f4)
860 f4_s = self.conv3x3(torch.cat([f4_a, f4_b], 1))
861 p4_s = self.out_s(f4_s)
862
863 return p4_s
864
865
866class Decoder_noSpade(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected