class_docstr: CondInst box head used in https://arxiv.org/abs/1904.02689.
  
  Note that CondInst Bbox Head is a extension of FCOS head.
  Two differences are described as follows:
  
  1. CondInst box head predicts a set of params for each instance.
  2. CondInst box head return the pos_gt_inds and pos_inds.
  
  Args:
      num_params (int): Number of params for instance segmentation.
class_docstr_tok: ["CondInst","box","head","used","in","https",":","\/\/arxiv.org\/abs\/1904.02689",".","Note","that","CondInst","Bbox","Head","is","a","extension","of","FCOS","head",".","Two","differences","are","described","as","follows",":","1",".","CondInst","box","head","predicts","a","set","of","params","for","each","instance",".","2",".","CondInst","box","head","return","the","pos_gt_inds","and","pos_inds",".","Args",":","num_params","(","int",")",":","Number","of","params","for","instance","segmentation","."]
docstr: Compute regression, classification and centerness targets for points
  in multiple images.
  
  Args:
      points (list[Tensor]): Points of each fpn level, each has shape
          (num_points, 2).
      batch_gt_instances (list[:obj:`InstanceData`]): Batch of
          gt_instance.  It usually includes ``bboxes`` and ``labels``
          attributes.
  
  Returns:
      tuple: Targets of each level.
  
      - concat_lvl_labels (list[Tensor]): Labels of each level.
      - concat_lvl_bbox_targets (list[Tensor]): BBox targets of each             level.
      - pos_inds_list (list[Tensor]): pos_inds of each image.
      - pos_gt_inds_list (List[Tensor]): pos_gt_inds of each image.
docstr_tok: ["Compute","regression",",","classification","and","centerness","targets","for","points","in","multiple","images",".","Args",":","points","(","list","[","Tensor","]",")",":","Points","of","each","fpn","level",",","each","has","shape","(","num_points",",","2",")",".","batch_gt_instances","(","list","[",":","obj",":","`","InstanceData","`","]",")",":","Batch","of","gt_instance",".","It","usually","includes","``","bboxes","``","and","``","labels","``","attributes",".","Returns",":","tuple",":","Targets","of","each","level",".","-","concat_lvl_labels","(","list","[","Tensor","]",")",":","Labels","of","each","level",".","-","concat_lvl_bbox_targets","(","list","[","Tensor","]",")",":","BBox","targets","of","each","level",".","-","pos_inds_list","(","list","[","Tensor","]",")",":","pos_inds","of","each","image",".","-","pos_gt_inds_list","(","List","[","Tensor","]",")",":","pos_gt_inds","of","each","image","."]
code: def get_targets(
      self, points: List[Tensor], batch_gt_instances: InstanceList
  ) -> Tuple[List[Tensor], List[Tensor], List[Tensor], List[Tensor]]:
      """Compute regression, classification and centerness targets for points
          in multiple images.
  
          Args:
              points (list[Tensor]): Points of each fpn level, each has shape
                  (num_points, 2).
              batch_gt_instances (list[:obj:`InstanceData`]): Batch of
                  gt_instance.  It usually includes ``bboxes`` and ``labels``
                  attributes.
  
          Returns:
              tuple: Targets of each level.
  
              - concat_lvl_labels (list[Tensor]): Labels of each level.
              - concat_lvl_bbox_targets (list[Tensor]): BBox targets of each \
              level.
              - pos_inds_list (list[Tensor]): pos_inds of each image.
              - pos_gt_inds_list (List[Tensor]): pos_gt_inds of each image.
          """
      assert len(points) == len(self.regress_ranges)
      num_levels = len(points)
      # expand regress ranges to align with points
      expanded_regress_ranges = [
          points[i]
          .new_tensor(self.regress_ranges[i])[None]
          .expand_as(points[i])
          for i in range(num_levels)
      ]
      # concat all levels points and regress ranges
      concat_regress_ranges = torch.cat(expanded_regress_ranges, dim=0)
      concat_points = torch.cat(points, dim=0)
  
      # the number of points per img, per lvl
      num_points = [center.size(0) for center in points]
  
      # get labels and bbox_targets of each image
      (
          labels_list,
          bbox_targets_list,
          pos_inds_list,
          pos_gt_inds_list,
      ) = multi_apply(
          self._get_targets_single,
          batch_gt_instances,
          points=concat_points,
          regress_ranges=concat_regress_ranges,
          num_points_per_lvl=num_points,
      )
  
      # split to per img, per level
      labels_list = [
          labels.split(num_points, 0) for labels in labels_list
      ]
      bbox_targets_list = [
          bbox_targets.split(num_points, 0)
          for bbox_targets in bbox_targets_list
      ]
  
      # concat per level image
      concat_lvl_labels = []
      concat_lvl_bbox_targets = []
      for i in range(num_levels):
          concat_lvl_labels.append(
              torch.cat([labels[i] for labels in labels_list])
          )
          bbox_targets = torch.cat(
              [bbox_targets[i] for bbox_targets in bbox_targets_list]
          )
          if self.norm_on_bbox:
              bbox_targets = bbox_targets / self.strides[i]
          concat_lvl_bbox_targets.append(bbox_targets)
      return (
          concat_lvl_labels,
          concat_lvl_bbox_targets,
          pos_inds_list,
          pos_gt_inds_list,
      )
  
imports: import copy
  from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, Scale
  from mmengine.config import ConfigDict
  from mmengine.model import BaseModule, kaiming_init
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import cat_boxes
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptConfigType, OptInstanceList, reduce_mean
  from ..task_modules.prior_generators import MlvlPointGenerator
  from ..utils import aligned_bilinear, filter_scores_and_topk, multi_apply, relative_coordinate_maps, select_single_mlvl
  from ..utils.misc import empty_instances
  from .base_mask_head import BaseMaskHead
  from .fcos_head import FCOSHead
label_desc: Use image node_id 5 for calling the CondInstBboxHead obj's underlying member method code with example usage: obj.get_targets(points, batch_gt_instances) and returns: concat_lvl_labels,  concat_lvl_bbox_targets,  pos_inds_list,  pos_gt_inds_list