MCPcopy Create free account
hub / github.com/devinxzhang/MFuser / __init__

Method __init__

mmseg/models/segmentors/encoder_decoder.py:28–53  ·  view source on GitHub ↗
(self,
                 backbone,
                 decode_head,
                 neck=None,
                 auxiliary_head=None,
                 train_cfg=None,
                 test_cfg=None,
                 data_preprocessor=None,
                 pretrained=None,
                 init_cfg=None)

Source from the content-addressed store, hash-verified

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``"""

Callers

nothing calls this directly

Calls 2

_init_decode_headMethod · 0.95
_init_auxiliary_headMethod · 0.95

Tested by

no test coverage detected