(self, f, f_s, f_e, p_s, p_e)
| 876 | self.out_s = nn.Conv2d(in_channels, 1, kernel_size=3, padding=1) |
| 877 | |
| 878 | def forward(self, f, f_s, f_e, p_s, p_e): |
| 879 | prior_cam = F.interpolate(p_s, size=f.size()[2:], mode='bilinear', align_corners=True) # 2,1,12,12->2,1,48,48 |
| 880 | r_prior_cam = 1 - torch.sigmoid(prior_cam) |
| 881 | prior_cam = torch.sigmoid(prior_cam) |
| 882 | |
| 883 | f_a = self.rcab_a(f * r_prior_cam.expand(-1, f.size()[1], -1, -1) + f) |
| 884 | f_b = self.rcab_b(f * prior_cam.expand(-1, f.size()[1], -1, -1) + f) |
| 885 | |
| 886 | f_s_new = self.conv3x3(torch.cat([f_a, f_b], 1)) |
| 887 | p_s_new = self.out_s(f_s_new) |
| 888 | |
| 889 | p_e = F.interpolate(p_e, size=f.size()[2:], mode='bilinear', align_corners=True) |
| 890 | f_s = F.interpolate(f_s, size=f.size()[2:], mode='bilinear', align_corners=True) |
| 891 | |
| 892 | f_e_new = self.crb(torch.cat([(f * p_e.expand(-1, f.size()[1], -1, -1) + f), f_s], 1)) |
| 893 | p_e_new = self.out_e(f_e_new) |
| 894 | |
| 895 | return f_s_new, f_e_new, p_s_new, p_e_new |
| 896 | |
| 897 | class REM_decoder_noSpade(nn.Module): |
| 898 | def __init__(self, in_channels): |
nothing calls this directly
no outgoing calls
no test coverage detected