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: Transform a batch of output features extracted from the head into
  mask results.
  
  Args:
      mlvl_mask_preds_x (list[Tensor]): Multi-level mask prediction
          from x branch. Each element in the list has shape
          (batch_size, num_grids ,h ,w).
      mlvl_mask_preds_y (list[Tensor]): Multi-level mask prediction
          from y branch. Each element in the list has shape
          (batch_size, num_grids ,h ,w).
      mlvl_cls_scores (list[Tensor]): Multi-level scores. Each element
          in the list has shape
          (batch_size, num_classes ,num_grids ,num_grids).
      batch_img_metas (list[dict]): Meta information of all images.
  
  Returns:
      list[:obj:`InstanceData`]: Processed results of multiple
      images.Each :obj:`InstanceData` usually contains
      following keys.
  
          - scores (Tensor): Classification scores, has shape
            (num_instance,).
          - labels (Tensor): Has shape (num_instances,).
          - masks (Tensor): Processed mask results, has
            shape (num_instances, h, w).
code: def predict_by_feat(
      self,
      mlvl_mask_preds_x: List[Tensor],
      mlvl_mask_preds_y: List[Tensor],
      mlvl_cls_scores: List[Tensor],
      batch_img_metas: List[dict],
      **kwargs,
  ) -> InstanceList:
      """Transform a batch of output features extracted from the head into
      mask results.
  
      Args:
          mlvl_mask_preds_x (list[Tensor]): Multi-level mask prediction
              from x branch. Each element in the list has shape
              (batch_size, num_grids ,h ,w).
          mlvl_mask_preds_y (list[Tensor]): Multi-level mask prediction
              from y branch. Each element in the list has shape
              (batch_size, num_grids ,h ,w).
          mlvl_cls_scores (list[Tensor]): Multi-level scores. Each element
              in the list has shape
              (batch_size, num_classes ,num_grids ,num_grids).
          batch_img_metas (list[dict]): Meta information of all images.
  
      Returns:
          list[:obj:`InstanceData`]: Processed results of multiple
          images.Each :obj:`InstanceData` usually contains
          following keys.
  
              - scores (Tensor): Classification scores, has shape
                (num_instance,).
              - labels (Tensor): Has shape (num_instances,).
              - masks (Tensor): Processed mask results, has
                shape (num_instances, h, w).
      """
      mlvl_cls_scores = [
          item.permute(0, 2, 3, 1) for item in mlvl_cls_scores
      ]
      assert len(mlvl_mask_preds_x) == len(mlvl_cls_scores)
      num_levels = len(mlvl_cls_scores)
  
      results_list = []
      for img_id in range(len(batch_img_metas)):
          cls_pred_list = [
              mlvl_cls_scores[i][img_id]
              .view(-1, self.cls_out_channels)
              .detach()
              for i in range(num_levels)
          ]
          mask_pred_list_x = [
              mlvl_mask_preds_x[i][img_id] for i in range(num_levels)
          ]
          mask_pred_list_y = [
              mlvl_mask_preds_y[i][img_id] for i in range(num_levels)
          ]
  
          cls_pred_list = torch.cat(cls_pred_list, dim=0)
          mask_pred_list_x = torch.cat(mask_pred_list_x, dim=0)
          mask_pred_list_y = torch.cat(mask_pred_list_y, dim=0)
          img_meta = batch_img_metas[img_id]
  
          results = self._predict_by_feat_single(
              cls_pred_list,
              mask_pred_list_x,
              mask_pred_list_y,
              img_meta=img_meta,
          )
          results_list.append(results)
      return results_list
  
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 6 for calling the DecoupledSOLOHead obj's underlying member method code with example usage: obj.predict_by_feat(mlvl_mask_preds_x, mlvl_mask_preds_y, mlvl_cls_scores, batch_img_metas) and returns: results_list