(self, rgb, modal_x=None, label=None)
| 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) |
no test coverage detected