Implements the MapNet model (green block in Fig. 2 of paper)
| 300 | return torch.cat((xyz, wpqr), 1) |
| 301 | |
| 302 | class 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 | |
| 326 | def eval_on_epoch(args, dl, model, optimizer, loss_func, device): |
| 327 | model.eval() |
nothing calls this directly
no outgoing calls
no test coverage detected