Build segmentor.
(cfg, train_cfg=None, test_cfg=None)
| 44 | |
| 45 | |
| 46 | def build_segmentor(cfg, train_cfg=None, test_cfg=None): |
| 47 | """Build segmentor.""" |
| 48 | if train_cfg is not None or test_cfg is not None: |
| 49 | warnings.warn("train_cfg and test_cfg is deprecated, please specify them in model", UserWarning) |
| 50 | assert cfg.get("train_cfg") is None or train_cfg is None, ( |
| 51 | "train_cfg specified in both outer field and model field " |
| 52 | ) |
| 53 | assert cfg.get("test_cfg") is None or test_cfg is None, "test_cfg specified in both outer field and model field " |
| 54 | return SEGMENTORS.build(cfg, default_args=dict(train_cfg=train_cfg, test_cfg=test_cfg)) |
| 55 | |
| 56 | |
| 57 | logger = get_logger() |
nothing calls this directly
no outgoing calls
no test coverage detected