class_docstr: Base class of Two-stage Panoptic Segmentor.
  
  As well as the components in TwoStageDetector, Panoptic Segmentor has extra
  semantic_head and panoptic_fusion_head.
class_docstr_tok: ["Base","class","of","Two-stage","Panoptic","Segmentor",".","As","well","as","the","components","in","TwoStageDetector",",","Panoptic","Segmentor","has","extra","semantic_head","and","panoptic_fusion_head","."]
docstr: bool: whether the detector has semantic head
docstr_tok: ["bool",":","whether","the","detector","has","semantic","head"]
code: def with_semantic_head(self) -> bool:
      """bool: whether the detector has semantic head"""
      return (
          hasattr(self, "semantic_head")
          and self.semantic_head is not None
      )
  
file_path: mmdetection/mmdet/models/detectors/panoptic_two_stage_segmentor.py
imports: import copy
  from typing import List
  import torch
  from mmengine.structures import PixelData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig
  from .two_stage import TwoStageDetector
label_desc: Use image node_id 2 for calling the TwoStagePanopticSegmentor obj's underlying member method code with example usage: obj.with_semantic_head() and returns: unknown