class_docstr: Implementation of `Per-Pixel Classification is
  NOT All You Need for Semantic Segmentation
  <https://arxiv.org/pdf/2107.06278>`_.
class_docstr_tok: ["Implementation","of","`","Per-Pixel","Classification","is","NOT","All","You","Need","for","Semantic","Segmentation","<","https",":","\/\/arxiv.org\/pdf\/2107.06278",">","`","_","."]
code: def __init__(
      self,
      backbone: ConfigType,
      neck: OptConfigType = None,
      panoptic_head: OptConfigType = None,
      panoptic_fusion_head: OptConfigType = None,
      train_cfg: OptConfigType = None,
      test_cfg: OptConfigType = None,
      data_preprocessor: OptConfigType = None,
      init_cfg: OptMultiConfig = None,
  ):
      super(SingleStageDetector, self).__init__(
          data_preprocessor=data_preprocessor, init_cfg=init_cfg
      )
      self.backbone = MODELS.build(backbone)
      if neck is not None:
          self.neck = MODELS.build(neck)
  
      panoptic_head_ = panoptic_head.deepcopy()
      panoptic_head_.update(train_cfg=train_cfg)
      panoptic_head_.update(test_cfg=test_cfg)
      self.panoptic_head = MODELS.build(panoptic_head_)
  
      panoptic_fusion_head_ = panoptic_fusion_head.deepcopy()
      panoptic_fusion_head_.update(test_cfg=test_cfg)
      self.panoptic_fusion_head = MODELS.build(panoptic_fusion_head_)
  
      self.num_things_classes = self.panoptic_head.num_things_classes
      self.num_stuff_classes = self.panoptic_head.num_stuff_classes
      self.num_classes = self.panoptic_head.num_classes
  
      self.train_cfg = train_cfg
      self.test_cfg = test_cfg
  
file_path: mmdetection/mmdet/models/detectors/maskformer.py
imports: from typing import Dict, List, Tuple
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig
  from .single_stage import SingleStageDetector
label_desc: Use image node_id 1 to create a new MaskFormer object from inherited base classes: SingleStageDetector with example: obj = MaskFormer(backbone, neck, panoptic_head, panoptic_fusion_head, train_cfg, test_cfg, data_preprocessor, init_cfg)