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

Method _aggregate_feature2

script/feature/model.py:415–426  ·  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

413 return feature
414
415 def _aggregate_feature2(self, x):
416 '''
417 assume target and nerf rgb are inferenced at the same time,
418 slice target batch and nerf batch and output stacked features
419 :param x: image blob (2B x C x H x W)
420 :return feature: (2 x B x C x H x W)
421 '''
422 batch = x.shape[0] # should be target batch_size + rgb batch_size
423 feature_t = x[:batch//2]
424 feature_r = x[batch//2:]
425 feature = torch.stack([feature_t, feature_r])
426 return feature
427
428 def forward(self, x, upsampleH=224, upsampleW=224, isTrain=False, isSingleStream=False):
429 '''

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected