(self,
backbone,
decode_head,
neck=None,
auxiliary_head=None,
train_cfg=None,
test_cfg=None,
data_preprocessor=None,
pretrained=None,
init_cfg=None)
| 26 | """ |
| 27 | |
| 28 | def __init__(self, |
| 29 | backbone, |
| 30 | decode_head, |
| 31 | neck=None, |
| 32 | auxiliary_head=None, |
| 33 | train_cfg=None, |
| 34 | test_cfg=None, |
| 35 | data_preprocessor=None, |
| 36 | pretrained=None, |
| 37 | init_cfg=None): |
| 38 | super(EncoderDecoder, self).__init__(init_cfg) |
| 39 | if pretrained is not None: |
| 40 | assert backbone.get('pretrained') is None, \ |
| 41 | 'both backbone and segmentor set pretrained weight' |
| 42 | if backbone.pretrained is None: |
| 43 | backbone.pretrained = pretrained |
| 44 | self.backbone = builder.build_backbone(backbone) |
| 45 | if neck is not None: |
| 46 | self.neck = builder.build_neck(neck) |
| 47 | self._init_decode_head(decode_head) |
| 48 | self._init_auxiliary_head(auxiliary_head) |
| 49 | |
| 50 | self.train_cfg = train_cfg |
| 51 | self.test_cfg = test_cfg |
| 52 | |
| 53 | assert self.with_decode_head |
| 54 | |
| 55 | def _init_decode_head(self, decode_head): |
| 56 | """Initialize ``decode_head``""" |
nothing calls this directly
no test coverage detected