class_docstr: Computes 1-to-k matching between ground truth and predictions.
  
  This class computes an assignment between the targets and the predictions
  based on the costs. The costs are weighted sum of some components.
  For DETR the costs are weighted sum of classification cost, regression L1
  cost and regression iou cost. The targets don't include the no_object, so
  generally there are more predictions than targets. After the 1-to-k
  gt-pred matching, the un-matched are treated as backgrounds. Thus each
  query prediction will be assigned with `0` or a positive integer
  indicating the ground truth index:
  
  - 0: negative sample, no assigned gt
  - positive integer: positive sample, index (1-based) of assigned gt
  
  Args:
      cls_cost (dict): Classification cost configuration.
      reg_cost (dict): Regression L1  cost configuration.
      iou_cost (dict): Regression iou cost configuration.
code: def __init__(
      self,
      *args,
      cls_cost=dict(type="FocalLossCost", weight=2.0),
      reg_cost=dict(type="BBoxL1Cost", weight=5.0),
      iou_cost=dict(type="IoUCost", iou_mode="giou", weight=2.0),
      **kwargs,
  ):
      super(TopkHungarianAssigner, self).__init__(*args, **kwargs)
  
      self.cls_cost = TASK_UTILS.build(cls_cost)
      self.reg_cost = TASK_UTILS.build(reg_cost)
      self.iou_cost = TASK_UTILS.build(iou_cost)
  
file_path: mmdetection/mmdet/models/task_modules/assigners/topk_hungarian_assigner.py
imports: import torch
  from mmengine.structures import BaseDataElement
  from scipy.optimize import linear_sum_assignment
  from mmdet.registry import TASK_UTILS
  from .assign_result import AssignResult
  from .task_aligned_assigner import TaskAlignedAssigner
label_desc: Use image node_id 1 to create a new TopkHungarianAssigner object from inherited base classes: TaskAlignedAssigner with example: obj = TopkHungarianAssigner()