Encode images with backbone and decode into a semantic segmentation map of the same size as input.
(self, rgb, modal_x)
| 223 | def init_weights(self, cfg, pretrained=None): |
| 224 | if pretrained: |
| 225 | logger.info("Loading pretrained model: {}".format(pretrained)) |
| 226 | self.backbone.init_weights(pretrained=pretrained) |
| 227 | logger.info("Initing weights ...") |
| 228 | init_weight( |
| 229 | self.decode_head, |
| 230 | nn.init.kaiming_normal_, |
| 231 | self.norm_layer, |
| 232 | cfg.bn_eps, |
| 233 | cfg.bn_momentum, |
| 234 | mode="fan_in", |
| 235 | nonlinearity="relu", |
| 236 | ) |
| 237 | if self.aux_head: |
| 238 | init_weight( |
| 239 | self.aux_head, |
| 240 | nn.init.kaiming_normal_, |
| 241 | self.norm_layer, |
| 242 | cfg.bn_eps, |