MCPcopy Create free account
hub / github.com/NVlabs/SegFormer / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

19 """
20
21 def __init__(self,
22 backbone,
23 decode_head,
24 neck=None,
25 auxiliary_head=None,
26 train_cfg=None,
27 test_cfg=None,
28 pretrained=None):
29 super(EncoderDecoder, self).__init__()
30 self.backbone = builder.build_backbone(backbone)
31 if neck is not None:
32 self.neck = builder.build_neck(neck)
33 self._init_decode_head(decode_head)
34 self._init_auxiliary_head(auxiliary_head)
35
36 self.train_cfg = train_cfg
37 self.test_cfg = test_cfg
38
39 self.init_weights(pretrained=pretrained)
40
41 assert self.with_decode_head
42
43 def _init_decode_head(self, decode_head):
44 """Initialize ``decode_head``"""

Callers

nothing calls this directly

Calls 3

_init_decode_headMethod · 0.95
_init_auxiliary_headMethod · 0.95
init_weightsMethod · 0.95

Tested by

no test coverage detected