| 246 | |
| 247 | |
| 248 | class InterFA(nn.Module): |
| 249 | def __init__(self, in_channels): |
| 250 | super(InterFA, self).__init__() |
| 251 | self.conv3x3 = BasicConv2d(in_channels * 2, in_channels, kernel_size=3, padding=1) |
| 252 | self.cbam = CBAM(in_channels) |
| 253 | self.conv1x1 = BasicConv2d(in_channels * 2, in_channels, kernel_size=1, stride=1, padding=0) |
| 254 | |
| 255 | def forward(self, f1, f2): |
| 256 | f2_up = F.interpolate(f2, size=f1.size()[2:], mode='bilinear', align_corners=True) |
| 257 | cat = torch.cat([f1, f2_up], dim=1) |
| 258 | f = self.conv3x3(cat) |
| 259 | f = self.cbam(f) |
| 260 | cat2 = torch.cat([f, f1], dim=1) |
| 261 | out = self.conv1x1(cat2) |
| 262 | return f, out |
| 263 | |
| 264 | |
| 265 | class GCM_interFA(nn.Module): |