class_docstr: Computes matching between predictions and ground truth.
  
  Args:
      center_radius (float): Ground truth center size
          to judge whether a prior is in center. Defaults to 2.5.
      candidate_topk (int): The candidate top-k which used to
          get top-k ious to calculate dynamic-k. Defaults to 10.
      iou_weight (float): The scale factor for regression
          iou cost. Defaults to 3.0.
      cls_weight (float): The scale factor for classification
          cost. Defaults to 1.0.
      iou_calculator (ConfigType): Config of overlaps Calculator.
          Defaults to dict(type='BboxOverlaps2D').
class_docstr_tok: ["Computes","matching","between","predictions","and","ground","truth",".","Args",":","center_radius","(","float",")",":","Ground","truth","center","size","to","judge","whether","a","prior","is","in","center",".","Defaults","to","2.5.","candidate_topk","(","int",")",":","The","candidate","top-k","which","used","to","get","top-k","ious","to","calculate","dynamic-k.","Defaults","to","10.","iou_weight","(","float",")",":","The","scale","factor","for","regression","iou","cost",".","Defaults","to","3.0.","cls_weight","(","float",")",":","The","scale","factor","for","classification","cost",".","Defaults","to","1.0.","iou_calculator","(","ConfigType",")",":","Config","of","overlaps","Calculator",".","Defaults","to","dict","(","type='BboxOverlaps2D","'",")","."]
docstr: Get the information of which prior is in gt bboxes and gt center
  priors.
docstr_tok: ["Get","the","information","of","which","prior","is","in","gt","bboxes","and","gt","center","priors","."]
code: def get_in_gt_and_in_center_info(
      self, priors: Tensor, gt_bboxes: Tensor
  ) -> Tuple[Tensor, Tensor]:
      """Get the information of which prior is in gt bboxes and gt center
      priors."""
      num_gt = gt_bboxes.size(0)
  
      repeated_x = priors[:, 0].unsqueeze(1).repeat(1, num_gt)
      repeated_y = priors[:, 1].unsqueeze(1).repeat(1, num_gt)
      repeated_stride_x = priors[:, 2].unsqueeze(1).repeat(1, num_gt)
      repeated_stride_y = priors[:, 3].unsqueeze(1).repeat(1, num_gt)
  
      # is prior centers in gt bboxes, shape: [n_prior, n_gt]
      l_ = repeated_x - gt_bboxes[:, 0]
      t_ = repeated_y - gt_bboxes[:, 1]
      r_ = gt_bboxes[:, 2] - repeated_x
      b_ = gt_bboxes[:, 3] - repeated_y
  
      deltas = torch.stack([l_, t_, r_, b_], dim=1)
      is_in_gts = deltas.min(dim=1).values > 0
      is_in_gts_all = is_in_gts.sum(dim=1) > 0
  
      # is prior centers in gt centers
      gt_cxs = (gt_bboxes[:, 0] + gt_bboxes[:, 2]) / 2.0
      gt_cys = (gt_bboxes[:, 1] + gt_bboxes[:, 3]) / 2.0
      ct_box_l = gt_cxs - self.center_radius * repeated_stride_x
      ct_box_t = gt_cys - self.center_radius * repeated_stride_y
      ct_box_r = gt_cxs + self.center_radius * repeated_stride_x
      ct_box_b = gt_cys + self.center_radius * repeated_stride_y
  
      cl_ = repeated_x - ct_box_l
      ct_ = repeated_y - ct_box_t
      cr_ = ct_box_r - repeated_x
      cb_ = ct_box_b - repeated_y
  
      ct_deltas = torch.stack([cl_, ct_, cr_, cb_], dim=1)
      is_in_cts = ct_deltas.min(dim=1).values > 0
      is_in_cts_all = is_in_cts.sum(dim=1) > 0
  
      # in boxes or in centers, shape: [num_priors]
      is_in_gts_or_centers = is_in_gts_all | is_in_cts_all
  
      # both in boxes and centers, shape: [num_fg, num_gt]
      is_in_boxes_and_centers = (
          is_in_gts[is_in_gts_or_centers, :]
          & is_in_cts[is_in_gts_or_centers, :]
      )
      return is_in_gts_or_centers, is_in_boxes_and_centers
  
file_path: mmdetection/mmdet/models/task_modules/assigners/sim_ota_assigner.py
imports: from typing import Optional, Tuple
  import torch
  import torch.nn.functional
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import TASK_UTILS
  from mmdet.utils import ConfigType
  from .assign_result import AssignResult
  from .base_assigner import BaseAssigner
label_desc: Use image node_id 3 for calling the SimOTAAssigner obj's underlying member method code with example usage: obj.get_in_gt_and_in_center_info(priors, gt_bboxes) and returns: is_in_gts_or_centers,  is_in_boxes_and_centers