assume target and nerf rgb are inferenced at the same time, slice target batch and nerf batch and output stacked features :param x: image blob (2B x C x H x W) :return feature: (2 x B x C x H x W)
(self, x)
| 469 | self.fc_pose = nn.Linear(1536, feat_dim) # 1280 for efficientnet-b0, 1536 for efficientnet-b3 |
| 470 | |
| 471 | def _aggregate_feature2(self, x): |
| 472 | ''' |
| 473 | assume target and nerf rgb are inferenced at the same time, |
| 474 | slice target batch and nerf batch and output stacked features |
| 475 | :param x: image blob (2B x C x H x W) |
| 476 | :return feature: (2 x B x C x H x W) |
| 477 | ''' |
| 478 | batch = x.shape[0] # should be target batch_size + rgb batch_size |
| 479 | feature_t = x[:batch//2] |
| 480 | feature_r = x[batch//2:] |
| 481 | feature = torch.stack([feature_t, feature_r]) |
| 482 | return feature |
| 483 | |
| 484 | def forward(self, x, return_feature=False, isSingleStream=False): |
| 485 | ''' |