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

Method _aggregate_feature2

script/feature/model.py:471–482  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 '''

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected