class_docstr: Mask IoU Head.
  
  This head predicts the IoU of predicted masks and corresponding gt masks.
  
  Args:
      num_convs (int): The number of convolution layers. Defaults to 4.
      num_fcs (int): The number of fully connected layers. Defaults to 2.
      roi_feat_size (int): RoI feature size. Default to 14.
      in_channels (int): The channel number of inputs features.
          Defaults to 256.
      conv_out_channels (int): The feature channels of convolution layers.
          Defaults to 256.
      fc_out_channels (int): The feature channels of fully connected layers.
          Defaults to 1024.
      num_classes (int): Number of categories excluding the background
          category. Defaults to 80.
      loss_iou (:obj:`ConfigDict` or dict): IoU loss.
      init_cfg (:obj:`ConfigDict` or dict or list[:obj:`ConfigDict` or             dict], optional): Initialization config dict.
class_docstr_tok: ["Mask","IoU","Head",".","This","head","predicts","the","IoU","of","predicted","masks","and","corresponding","gt","masks",".","Args",":","num_convs","(","int",")",":","The","number","of","convolution","layers",".","Defaults","to","4.","num_fcs","(","int",")",":","The","number","of","fully","connected","layers",".","Defaults","to","2.","roi_feat_size","(","int",")",":","RoI","feature","size",".","Default","to","14.","in_channels","(","int",")",":","The","channel","number","of","inputs","features",".","Defaults","to","256.","conv_out_channels","(","int",")",":","The","feature","channels","of","convolution","layers",".","Defaults","to","256.","fc_out_channels","(","int",")",":","The","feature","channels","of","fully","connected","layers",".","Defaults","to","1024.","num_classes","(","int",")",":","Number","of","categories","excluding","the","background","category",".","Defaults","to","80.","loss_iou","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","IoU","loss",".","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict","or","list","[",":","obj",":","`","ConfigDict","`","or","dict","]",",","optional",")",":","Initialization","config","dict","."]
docstr: Predict the mask iou and calculate it into ``results.scores``.
  
  Args:
      mask_iou_preds (Tensor): Mask IoU predictions results, has shape
          (num_proposals, num_classes)
      results_list (list[:obj:`InstanceData`]): Detection results of
          each image.
  
  Returns:
      list[:obj:`InstanceData`]: Detection results of each image
      after the post process. Each item usually contains following keys.
  
          - scores (Tensor): Classification scores, has a shape
            (num_instance, )
          - labels (Tensor): Labels of bboxes, has a shape
            (num_instances, ).
          - bboxes (Tensor): Has a shape (num_instances, 4),
            the last dimension 4 arrange as (x1, y1, x2, y2).
          - masks (Tensor): Has a shape (num_instances, H, W).
docstr_tok: ["Predict","the","mask","iou","and","calculate","it","into","``","results.scores","``",".","Args",":","mask_iou_preds","(","Tensor",")",":","Mask","IoU","predictions","results",",","has","shape","(","num_proposals",",","num_classes",")","results_list","(","list","[",":","obj",":","`","InstanceData","`","]",")",":","Detection","results","of","each","image",".","Returns",":","list","[",":","obj",":","`","InstanceData","`","]",":","Detection","results","of","each","image","after","the","post","process",".","Each","item","usually","contains","following","keys",".","-","scores","(","Tensor",")",":","Classification","scores",",","has","a","shape","(","num_instance",",",")","-","labels","(","Tensor",")",":","Labels","of","bboxes",",","has","a","shape","(","num_instances",",",")",".","-","bboxes","(","Tensor",")",":","Has","a","shape","(","num_instances",",","4",")",",","the","last","dimension","4","arrange","as","(","x1",",","y1",",","x2",",","y2",")",".","-","masks","(","Tensor",")",":","Has","a","shape","(","num_instances",",","H",",","W",")","."]
code: def predict_by_feat(
      self, mask_iou_preds: Tuple[Tensor], results_list: InstanceList
  ) -> InstanceList:
      """Predict the mask iou and calculate it into ``results.scores``.
  
      Args:
          mask_iou_preds (Tensor): Mask IoU predictions results, has shape
              (num_proposals, num_classes)
          results_list (list[:obj:`InstanceData`]): Detection results of
              each image.
  
      Returns:
          list[:obj:`InstanceData`]: Detection results of each image
          after the post process. Each item usually contains following keys.
  
              - scores (Tensor): Classification scores, has a shape
                (num_instance, )
              - labels (Tensor): Labels of bboxes, has a shape
                (num_instances, ).
              - bboxes (Tensor): Has a shape (num_instances, 4),
                the last dimension 4 arrange as (x1, y1, x2, y2).
              - masks (Tensor): Has a shape (num_instances, H, W).
      """
      assert len(mask_iou_preds) == len(results_list)
      for results, mask_iou_pred in zip(results_list, mask_iou_preds):
          labels = results.labels
          scores = results.scores
          results.scores = (
              scores * mask_iou_pred[range(labels.size(0)), labels]
          )
      return results_list
  
imports: from typing import List, Tuple
  import numpy
  import torch
  import torch.nn
  from mmcv.cnn import Conv2d, Linear, MaxPool2d
  from mmengine.config import ConfigDict
  from mmengine.model import BaseModule
  from mmengine.structures import InstanceData
  from torch import Tensor
  from torch.nn.modules.utils import _pair
  from mmdet.models.task_modules.samplers import SamplingResult
  from mmdet.registry import MODELS
  from mmdet.utils import ConfigType, InstanceList, OptMultiConfig
label_desc: Use image node_id 6 for calling the MaskIoUHead obj's underlying member method code with example usage: obj.predict_by_feat(mask_iou_preds, results_list) and returns: results_list