class_docstr: Computes matching between predictions and ground truth.
  Args:
      center_radius (int | float, optional): Ground truth center size
          to judge whether a prior is in center. Default 2.5.
      candidate_topk (int, optional): The candidate top-k which used to
          get top-k ious to calculate dynamic-k. Default 10.
      iou_weight (int | float, optional): The scale factor for regression
          iou cost. Default 3.0.
      cls_weight (int | float, optional): The scale factor for classification
          cost. Default 1.0.
      num_classes (int): The num_classes of dataset.
      use_vfl (int): Whether to use varifocal_loss when calculating the cost matrix.
class_docstr_tok: ["Computes","matching","between","predictions","and","ground","truth",".","Args",":","center_radius","(","int","|","float",",","optional",")",":","Ground","truth","center","size","to","judge","whether","a","prior","is","in","center",".","Default","2.5.","candidate_topk","(","int",",","optional",")",":","The","candidate","top-k","which","used","to","get","top-k","ious","to","calculate","dynamic-k",".","Default","10.","iou_weight","(","int","|","float",",","optional",")",":","The","scale","factor","for","regression","iou","cost",".","Default","3.0.","cls_weight","(","int","|","float",",","optional",")",":","The","scale","factor","for","classification","cost",".","Default","1.0.","num_classes","(","int",")",":","The","num_classes","of","dataset",".","use_vfl","(","int",")",":","Whether","to","use","varifocal_loss","when","calculating","the","cost","matrix","."]
code: def get_in_gt_and_in_center_info(
      self, flatten_center_and_stride, gt_bboxes
  ):
      num_gt = gt_bboxes.shape[0]
  
      flatten_x = (
          flatten_center_and_stride[:, 0].unsqueeze(1).tile([1, num_gt])
      )
      flatten_y = (
          flatten_center_and_stride[:, 1].unsqueeze(1).tile([1, num_gt])
      )
      flatten_stride_x = (
          flatten_center_and_stride[:, 2].unsqueeze(1).tile([1, num_gt])
      )
      flatten_stride_y = (
          flatten_center_and_stride[:, 3].unsqueeze(1).tile([1, num_gt])
      )
  
      # is prior centers in gt bboxes, shape: [n_center, n_gt]
      l_ = flatten_x - gt_bboxes[:, 0]
      t_ = flatten_y - gt_bboxes[:, 1]
      r_ = gt_bboxes[:, 2] - flatten_x
      b_ = gt_bboxes[:, 3] - flatten_y
  
      deltas = paddle.stack([l_, t_, r_, b_], axis=1)
      is_in_gts = deltas.min(axis=1) > 0
      is_in_gts_all = is_in_gts.sum(axis=1) > 0
  
      # is prior centers in gt centers
      gt_center_xs = (gt_bboxes[:, 0] + gt_bboxes[:, 2]) / 2.0
      gt_center_ys = (gt_bboxes[:, 1] + gt_bboxes[:, 3]) / 2.0
      ct_bound_l = gt_center_xs - self.center_radius * flatten_stride_x
      ct_bound_t = gt_center_ys - self.center_radius * flatten_stride_y
      ct_bound_r = gt_center_xs + self.center_radius * flatten_stride_x
      ct_bound_b = gt_center_ys + self.center_radius * flatten_stride_y
  
      cl_ = flatten_x - ct_bound_l
      ct_ = flatten_y - ct_bound_t
      cr_ = ct_bound_r - flatten_x
      cb_ = ct_bound_b - flatten_y
  
      ct_deltas = paddle.stack([cl_, ct_, cr_, cb_], axis=1)
      is_in_cts = ct_deltas.min(axis=1) > 0
      is_in_cts_all = is_in_cts.sum(axis=1) > 0
  
      # in any of gts or gt centers, shape: [n_center]
      is_in_gts_or_centers_all = paddle.logical_or(
          is_in_gts_all, is_in_cts_all
      )
  
      is_in_gts_or_centers_all_inds = paddle.nonzero(
          is_in_gts_or_centers_all
      ).squeeze(1)
  
      # both in gts and gt centers, shape: [num_fg, num_gt]
      is_in_gts_and_centers = paddle.logical_and(
          paddle.gather(
              is_in_gts.cast("int"),
              is_in_gts_or_centers_all_inds,
              axis=0,
          ).cast("bool"),
          paddle.gather(
              is_in_cts.cast("int"),
              is_in_gts_or_centers_all_inds,
              axis=0,
          ).cast("bool"),
      )
      return (
          is_in_gts_or_centers_all,
          is_in_gts_or_centers_all_inds,
          is_in_gts_and_centers,
      )
  
file_path: PaddleDetection/ppdet/modeling/assigners/simota_assigner.py
imports: import paddle
  import numpy
  import paddle.nn.functional
  from ppdet.modeling.losses.varifocal_loss import varifocal_loss
  from ppdet.modeling.bbox_utils import batch_bbox_overlaps
  from ppdet.core.workspace import register
label_desc: Use image node_id 2 for calling the SimOTAAssigner obj's underlying member method code with example usage: obj.get_in_gt_and_in_center_info(flatten_center_and_stride, gt_bboxes) and returns: is_in_gts_or_centers_all,  is_in_gts_or_centers_all_inds,  is_in_gts_and_centers