class_docstr: YOLACT segmentation branch used in <https://arxiv.org/abs/1904.02689>`_
  
  In mmdet v2.x `segm_loss` is calculated in YOLACTSegmHead, while in
  mmdet v3.x `SegmentationModule` is used to obtain the predicted semantic
  segmentation map and `segm_loss` is calculated in YOLACTProtonet.
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      init_cfg (dict or list[dict], optional): Initialization config dict.
class_docstr_tok: ["YOLACT","segmentation","branch","used","in","<","https",":","\/\/arxiv.org\/abs\/1904.02689",">","`","_","In","mmdet","v2.x","`","segm_loss","`","is","calculated","in","YOLACTSegmHead",",","while","in","mmdet","v3.x","`","SegmentationModule","`","is","used","to","obtain","the","predicted","semantic","segmentation","map","and","`","segm_loss","`","is","calculated","in","YOLACTProtonet",".","Args",":","num_classes","(","int",")",":","Number","of","categories","excluding","the","background","category",".","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","init_cfg","(","dict","or","list","[","dict","]",",","optional",")",":","Initialization","config","dict","."]
code: def __init__(
      self,
      num_classes: int,
      in_channels: int = 256,
      init_cfg: ConfigType = dict(
          type="Xavier",
          distribution="uniform",
          override=dict(name="segm_conv"),
      ),
  ) -> None:
      super().__init__(init_cfg=init_cfg)
      self.in_channels = in_channels
      self.num_classes = num_classes
      self._init_layers()
  
imports: import copy
  from typing import List, Optional
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule
  from mmengine.model import BaseModule, ModuleList
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.utils import ConfigType, InstanceList, OptConfigType, OptInstanceList, OptMultiConfig
  from ..layers import fast_nms
  from ..utils import images_to_levels, multi_apply, select_single_mlvl
  from ..utils.misc import empty_instances
  from .anchor_head import AnchorHead
  from .base_mask_head import BaseMaskHead
label_desc: Use image node_id 1 to create a new SegmentationModule object from inherited base classes: BaseModule with example: obj = SegmentationModule(num_classes, in_channels, init_cfg)