MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / forward

Method forward

models/builder.py:241–254  ·  view source on GitHub ↗
(self, rgb, modal_x=None, label=None)

Source from the content-addressed store, hash-verified

239 self.aux_head,
240 nn.init.kaiming_normal_,
241 self.norm_layer,
242 cfg.bn_eps,
243 cfg.bn_momentum,
244 mode="fan_in",
245 nonlinearity="relu",
246 )
247
248 def encode_decode(self, rgb, modal_x):
249 """Encode images with backbone and decode into a semantic segmentation
250 map of the same size as input."""
251 orisize = rgb.shape
252 # print('builder',rgb.shape,modal_x.shape)
253 x = self.backbone(rgb, modal_x)
254 if len(x) == 2: # if output is (rgb, depth) only use rgb features
255 x = x[0]
256 out = self.decode_head.forward(x)
257 out = F.interpolate(out, size=orisize[-2:], mode="bilinear", align_corners=False)

Callers 1

encode_decodeMethod · 0.45

Calls 1

encode_decodeMethod · 0.95

Tested by

no test coverage detected