class_docstr: A instance embedding head described in :paper:`Panoptic-DeepLab`.
code: def from_config(cls, cfg, input_shape):
      if cfg.INPUT.CROP.ENABLED:
          assert cfg.INPUT.CROP.TYPE == "absolute"
          train_size = cfg.INPUT.CROP.SIZE
      else:
          train_size = None
      decoder_channels = [cfg.MODEL.INS_EMBED_HEAD.CONVS_DIM] * (
          len(cfg.MODEL.INS_EMBED_HEAD.IN_FEATURES) - 1
      ) + [cfg.MODEL.INS_EMBED_HEAD.ASPP_CHANNELS]
      ret = dict(
          input_shape={
              k: v
              for k, v in input_shape.items()
              if k in cfg.MODEL.INS_EMBED_HEAD.IN_FEATURES
          },
          project_channels=cfg.MODEL.INS_EMBED_HEAD.PROJECT_CHANNELS,
          aspp_dilations=cfg.MODEL.INS_EMBED_HEAD.ASPP_DILATIONS,
          aspp_dropout=cfg.MODEL.INS_EMBED_HEAD.ASPP_DROPOUT,
          decoder_channels=decoder_channels,
          common_stride=cfg.MODEL.INS_EMBED_HEAD.COMMON_STRIDE,
          norm=cfg.MODEL.INS_EMBED_HEAD.NORM,
          train_size=train_size,
          head_channels=cfg.MODEL.INS_EMBED_HEAD.HEAD_CHANNELS,
          center_loss_weight=cfg.MODEL.INS_EMBED_HEAD.CENTER_LOSS_WEIGHT,
          offset_loss_weight=cfg.MODEL.INS_EMBED_HEAD.OFFSET_LOSS_WEIGHT,
          use_depthwise_separable_conv=cfg.MODEL.SEM_SEG_HEAD.USE_DEPTHWISE_SEPARABLE_CONV,
      )
      return ret
  
imports: import numpy
  from typing import Callable, Dict, List, Union
  import fvcore.nn.weight_init
  import torch
  from torch import nn
  from torch.nn import functional
  from detectron2.config import configurable
  from detectron2.data import MetadataCatalog
  from detectron2.layers import Conv2d, DepthwiseSeparableConv2d, ShapeSpec, get_norm
  from detectron2.modeling import META_ARCH_REGISTRY, SEM_SEG_HEADS_REGISTRY, build_backbone, build_sem_seg_head
  from detectron2.modeling.postprocessing import sem_seg_postprocess
  from detectron2.projects.deeplab import DeepLabV3PlusHead
  from detectron2.projects.deeplab.loss import DeepLabCE
  from detectron2.structures import BitMasks, ImageList, Instances
  from detectron2.utils.registry import Registry
  from .post_processing import get_panoptic_segmentation
label_desc: Use image node_id 2 for calling the PanopticDeepLabInsEmbedHead obj's underlying member method code with example usage: obj.from_config(cls, cfg, input_shape) and returns: ret