class_docstr: Base class for single-stage instance segmentors.
class_docstr_tok: ["Base","class","for","single-stage","instance","segmentors","."]
code: def __init__(
      self,
      backbone: ConfigType,
      neck: OptConfigType = None,
      bbox_head: OptConfigType = None,
      mask_head: OptConfigType = None,
      train_cfg: OptConfigType = None,
      test_cfg: OptConfigType = None,
      data_preprocessor: OptConfigType = None,
      init_cfg: OptMultiConfig = None,
  ) -> None:
      super().__init__(
          data_preprocessor=data_preprocessor, init_cfg=init_cfg
      )
      self.backbone = MODELS.build(backbone)
      if neck is not None:
          self.neck = MODELS.build(neck)
      else:
          self.neck = None
      if bbox_head is not None:
          bbox_head.update(train_cfg=copy.deepcopy(train_cfg))
          bbox_head.update(test_cfg=copy.deepcopy(test_cfg))
          self.bbox_head = MODELS.build(bbox_head)
      else:
          self.bbox_head = None
  
      assert mask_head, (
          f"`mask_head` must "
          f"be implemented in {self.__class__.__name__}"
      )
      mask_head.update(train_cfg=copy.deepcopy(train_cfg))
      mask_head.update(test_cfg=copy.deepcopy(test_cfg))
      self.mask_head = MODELS.build(mask_head)
  
      self.train_cfg = train_cfg
      self.test_cfg = test_cfg
  
file_path: mmdetection/mmdet/models/detectors/single_stage_instance_seg.py
imports: import copy
  from typing import Tuple
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures import OptSampleList, SampleList
  from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig
  from .base import BaseDetector
label_desc: Use image node_id 1 to create a new SingleStageInstanceSegmentor object from inherited base classes: BaseDetector with example: obj = SingleStageInstanceSegmentor(backbone, neck, bbox_head, mask_head, train_cfg, test_cfg, data_preprocessor, init_cfg)