MCPcopy Create free account
hub / github.com/drinkingcoder/FlowFormer-Official / BasicMotionEncoder

Class BasicMotionEncoder

core/update.py:79–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77 return torch.cat([out, flow], dim=1)
78
79class BasicMotionEncoder(nn.Module):
80 def __init__(self, args):
81 super(BasicMotionEncoder, self).__init__()
82 cor_planes = args.corr_levels * (2*args.corr_radius + 1)**2
83 self.convc1 = nn.Conv2d(cor_planes, 256, 1, padding=0)
84 self.convc2 = nn.Conv2d(256, 192, 3, padding=1)
85 self.convf1 = nn.Conv2d(2, 128, 7, padding=3)
86 self.convf2 = nn.Conv2d(128, 64, 3, padding=1)
87 self.conv = nn.Conv2d(64+192, 128-2, 3, padding=1)
88
89 def forward(self, flow, corr):
90 cor = F.relu(self.convc1(corr))
91 cor = F.relu(self.convc2(cor))
92 flo = F.relu(self.convf1(flow))
93 flo = F.relu(self.convf2(flo))
94
95 cor_flo = torch.cat([cor, flo], dim=1)
96 out = F.relu(self.conv(cor_flo))
97 return torch.cat([out, flow], dim=1)
98
99class SmallUpdateBlock(nn.Module):
100 def __init__(self, args, hidden_dim=96):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected