MCPcopy Create free account
hub / github.com/ActiveVisionLab/DFNet / MapNet

Class MapNet

script/dm/pose_model.py:302–324  ·  view source on GitHub ↗

Implements the MapNet model (green block in Fig. 2 of paper)

Source from the content-addressed store, hash-verified

300 return torch.cat((xyz, wpqr), 1)
301
302class MapNet(nn.Module):
303 """
304 Implements the MapNet model (green block in Fig. 2 of paper)
305 """
306 def __init__(self, mapnet):
307 """
308 :param mapnet: the MapNet (two CNN blocks inside the green block in Fig. 2
309 of paper). Not to be confused with MapNet, the model!
310 """
311 super(MapNet, self).__init__()
312 self.mapnet = mapnet
313
314 def forward(self, x):
315 """
316 :param x: image blob (N x T x C x H x W)
317 :return: pose outputs
318 (N x T x 6)
319 """
320 s = x.size()
321 x = x.view(-1, *s[2:])
322 poses = self.mapnet(x)
323 poses = poses.view(s[0], s[1], -1)
324 return poses
325
326def eval_on_epoch(args, dl, model, optimizer, loss_func, device):
327 model.eval()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected