class_docstr: Decoupled SOLO mask head used in `SOLO: Segmenting Objects by Locations.
  
  <https://arxiv.org/abs/1912.04488>`_
  
  Args:
      init_cfg (dict or list[dict], optional): Initialization config dict.
docstr: Compute targets for predictions of single image.
  
  Args:
      gt_instances (:obj:`InstanceData`): Ground truth of instance
          annotations. It should includes ``bboxes``, ``labels``,
          and ``masks`` attributes.
      featmap_sizes (list[:obj:`torch.size`]): Size of each
          feature map from feature pyramid, each element
          means (feat_h, feat_w). Defaults to None.
  
  Returns:
      Tuple: Usually returns a tuple containing targets for predictions.
  
          - mlvl_pos_mask_targets (list[Tensor]): Each element represent
            the binary mask targets for positive points in this
            level, has shape (num_pos, out_h, out_w).
          - mlvl_labels (list[Tensor]): Each element is
            classification labels for all
            points in this level, has shape
            (num_grid, num_grid).
          - mlvl_xy_pos_indexes (list[Tensor]): Each element
            in the list contains the index of positive samples in
            corresponding level, has shape (num_pos, 2), last
            dimension 2 present (index_x, index_y).
code: def _get_targets_single(
      self,
      gt_instances: InstanceData,
      featmap_sizes: Optional[list] = None,
  ) -> tuple:
      """Compute targets for predictions of single image.
  
      Args:
          gt_instances (:obj:`InstanceData`): Ground truth of instance
              annotations. It should includes ``bboxes``, ``labels``,
              and ``masks`` attributes.
          featmap_sizes (list[:obj:`torch.size`]): Size of each
              feature map from feature pyramid, each element
              means (feat_h, feat_w). Defaults to None.
  
      Returns:
          Tuple: Usually returns a tuple containing targets for predictions.
  
              - mlvl_pos_mask_targets (list[Tensor]): Each element represent
                the binary mask targets for positive points in this
                level, has shape (num_pos, out_h, out_w).
              - mlvl_labels (list[Tensor]): Each element is
                classification labels for all
                points in this level, has shape
                (num_grid, num_grid).
              - mlvl_xy_pos_indexes (list[Tensor]): Each element
                in the list contains the index of positive samples in
                corresponding level, has shape (num_pos, 2), last
                dimension 2 present (index_x, index_y).
      """
      (
          mlvl_pos_mask_targets,
          mlvl_labels,
          mlvl_pos_masks,
      ) = super()._get_targets_single(
          gt_instances, featmap_sizes=featmap_sizes
      )
  
      mlvl_xy_pos_indexes = [
          (item - self.num_classes).nonzero() for item in mlvl_labels
      ]
  
      return mlvl_pos_mask_targets, mlvl_labels, mlvl_xy_pos_indexes
  
imports: from typing import List, Optional, Tuple
  import mmcv
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.models.utils.misc import floordiv
  from mmdet.registry import MODELS
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptConfigType
  from ..layers import mask_matrix_nms
  from ..utils import center_of_mass, generate_coordinate, multi_apply
  from .base_mask_head import BaseMaskHead
label_desc: Use image node_id 5 for calling the DecoupledSOLOHead obj's underlying member method code with example usage: obj._get_targets_single(gt_instances, featmap_sizes) and returns: mlvl_pos_mask_targets,  mlvl_labels,  mlvl_xy_pos_indexes