(self, x, flow, scale=1)
| 43 | self.conv2 = nn.Sequential(nn.ConvTranspose2d(c, c//2, 4, 2, 1), nn.PReLU(c//2), nn.ConvTranspose2d(c//2, 1, 4, 2, 1)) |
| 44 | |
| 45 | def forward(self, x, flow, scale=1): |
| 46 | x = F.interpolate(x, scale_factor= 1. / scale, mode="bilinear", align_corners=False, recompute_scale_factor=False) |
| 47 | flow = F.interpolate(flow, scale_factor= 1. / scale, mode="bilinear", align_corners=False, recompute_scale_factor=False) * 1. / scale |
| 48 | feat = self.conv0(torch.cat((x, flow), 1)) |
| 49 | feat = self.convblock0(feat) + feat |
| 50 | feat = self.convblock1(feat) + feat |
| 51 | feat = self.convblock2(feat) + feat |
| 52 | feat = self.convblock3(feat) + feat |
| 53 | flow = self.conv1(feat) |
| 54 | mask = self.conv2(feat) |
| 55 | flow = F.interpolate(flow, scale_factor=scale, mode="bilinear", align_corners=False, recompute_scale_factor=False) * scale |
| 56 | mask = F.interpolate(mask, scale_factor=scale, mode="bilinear", align_corners=False, recompute_scale_factor=False) |
| 57 | return flow, mask |
| 58 | |
| 59 | |
| 60 | class IFNet(nn.Module): |
nothing calls this directly
no test coverage detected