MCPcopy Create free account
hub / github.com/Vegetebird/GraphMLP / Model

Class Model

model/graphmlp.py:10–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8from model.block.mlp_gcn import Mlp_gcn
9
10class Model(nn.Module):
11 def __init__(self, args):
12 super().__init__()
13 self.graph = Graph('hm36_gt', 'spatial', pad=1)
14 self.A = nn.Parameter(torch.tensor(self.graph.A, dtype=torch.float32), requires_grad=False)
15
16 self.embedding = nn.Linear(2*args.frames, args.channel)
17 self.mlp_gcn = Mlp_gcn(args.layers, args.channel, args.d_hid, args.token_dim, self.A, length=args.n_joints, frames=args.frames)
18 self.head = nn.Linear(args.channel, 3)
19
20 def forward(self, x):
21 x = rearrange(x, 'b f j c -> b j (c f)').contiguous() # B 17 (2f)
22
23 x = self.embedding(x) # B 17 512
24 x = self.mlp_gcn(x) # B 17 512
25 x = self.head(x) # B 17 3
26
27 x = rearrange(x, 'b j c -> b 1 j c').contiguous() # B, 1, 17, 3
28
29 return x
30

Callers 2

main.pyFile · 0.90
get_pose3DFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected