class_docstr: Tracker for ByteTrack.
  
  Args:
      motion (dict): Configuration of motion. Defaults to None.
      obj_score_thrs (dict): Detection score threshold for matching objects.
          - high (float): Threshold of the first matching. Defaults to 0.6.
          - low (float): Threshold of the second matching. Defaults to 0.1.
      init_track_thr (float): Detection score threshold for initializing a
          new tracklet. Defaults to 0.7.
      weight_iou_with_det_scores (bool): Whether using detection scores to
          weight IOU which is used for matching. Defaults to True.
      match_iou_thrs (dict): IOU distance threshold for matching between two
          frames.
          - high (float): Threshold of the first matching. Defaults to 0.1.
          - low (float): Threshold of the second matching. Defaults to 0.5.
          - tentative (float): Threshold of the matching for tentative
              tracklets. Defaults to 0.3.
      num_tentatives (int, optional): Number of continuous frames to confirm
          a track. Defaults to 3.
class_docstr_tok: ["Tracker","for","ByteTrack",".","Args",":","motion","(","dict",")",":","Configuration","of","motion",".","Defaults","to","None",".","obj_score_thrs","(","dict",")",":","Detection","score","threshold","for","matching","objects",".","-","high","(","float",")",":","Threshold","of","the","first","matching",".","Defaults","to","0.6",".","-","low","(","float",")",":","Threshold","of","the","second","matching",".","Defaults","to","0.1.","init_track_thr","(","float",")",":","Detection","score","threshold","for","initializing","a","new","tracklet",".","Defaults","to","0.7.","weight_iou_with_det_scores","(","bool",")",":","Whether","using","detection","scores","to","weight","IOU","which","is","used","for","matching",".","Defaults","to","True",".","match_iou_thrs","(","dict",")",":","IOU","distance","threshold","for","matching","between","two","frames",".","-","high","(","float",")",":","Threshold","of","the","first","matching",".","Defaults","to","0.1",".","-","low","(","float",")",":","Threshold","of","the","second","matching",".","Defaults","to","0.5",".","-","tentative","(","float",")",":","Threshold","of","the","matching","for","tentative","tracklets",".","Defaults","to","0.3.","num_tentatives","(","int",",","optional",")",":","Number","of","continuous","frames","to","confirm","a","track",".","Defaults","to","3","."]
docstr: Assign ids.
  
  Args:
      ids (list[int]): Tracking ids.
      det_bboxes (Tensor): of shape (N, 4)
      det_labels (Tensor): of shape (N,)
      det_scores (Tensor): of shape (N,)
      weight_iou_with_det_scores (bool, optional): Whether using
          detection scores to weight IOU which is used for matching.
          Defaults to False.
      match_iou_thr (float, optional): Matching threshold.
          Defaults to 0.5.
  
  Returns:
      tuple(np.ndarray, np.ndarray): The assigning ids.
docstr_tok: ["Assign","ids",".","Args",":","ids","(","list","[","int","]",")",":","Tracking","ids",".","det_bboxes","(","Tensor",")",":","of","shape","(","N",",","4",")","det_labels","(","Tensor",")",":","of","shape","(","N",",",")","det_scores","(","Tensor",")",":","of","shape","(","N",",",")","weight_iou_with_det_scores","(","bool",",","optional",")",":","Whether","using","detection","scores","to","weight","IOU","which","is","used","for","matching",".","Defaults","to","False",".","match_iou_thr","(","float",",","optional",")",":","Matching","threshold",".","Defaults","to","0.5",".","Returns",":","tuple","(","np.ndarray",",","np.ndarray",")",":","The","assigning","ids","."]
code: def assign_ids(
      self,
      ids: List[int],
      det_bboxes: torch.Tensor,
      det_labels: torch.Tensor,
      det_scores: torch.Tensor,
      weight_iou_with_det_scores: Optional[bool] = False,
      match_iou_thr: Optional[float] = 0.5,
  ) -> Tuple[np.ndarray, np.ndarray]:
      """Assign ids.
  
      Args:
          ids (list[int]): Tracking ids.
          det_bboxes (Tensor): of shape (N, 4)
          det_labels (Tensor): of shape (N,)
          det_scores (Tensor): of shape (N,)
          weight_iou_with_det_scores (bool, optional): Whether using
              detection scores to weight IOU which is used for matching.
              Defaults to False.
          match_iou_thr (float, optional): Matching threshold.
              Defaults to 0.5.
  
      Returns:
          tuple(np.ndarray, np.ndarray): The assigning ids.
      """
      # get track_bboxes
      track_bboxes = np.zeros((0, 4))
      for id in ids:
          track_bboxes = np.concatenate(
              (track_bboxes, self.tracks[id].mean[:4][None]), axis=0
          )
      track_bboxes = torch.from_numpy(track_bboxes).to(det_bboxes)
      track_bboxes = bbox_cxcyah_to_xyxy(track_bboxes)
  
      # compute distance
      ious = bbox_overlaps(track_bboxes, det_bboxes)
      if weight_iou_with_det_scores:
          ious *= det_scores
      # support multi-class association
      track_labels = torch.tensor(
          [self.tracks[id]["labels"][-1] for id in ids]
      ).to(det_bboxes.device)
  
      cate_match = det_labels[None, :] == track_labels[:, None]
      # to avoid det and track of different categories are matched
      cate_cost = (1 - cate_match.int()) * 1e6
  
      dists = (1 - ious + cate_cost).cpu().numpy()
  
      # bipartite match
      if dists.size > 0:
          cost, row, col = lap.lapjv(
              dists, extend_cost=True, cost_limit=1 - match_iou_thr
          )
      else:
          row = np.zeros(len(ids)).astype(np.int32) - 1
          col = np.zeros(len(det_bboxes)).astype(np.int32) - 1
      return row, col
  
file_path: mmdetection/mmdet/models/trackers/byte_tracker.py
imports: from typing import List, Optional, Tuple
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.structures import DetDataSample
  from mmdet.structures.bbox import bbox_cxcyah_to_xyxy, bbox_overlaps, bbox_xyxy_to_cxcyah
  from .base_tracker import BaseTracker
label_desc: Use image node_id 7 for calling the ByteTracker obj's underlying member method code with example usage: obj.assign_ids(ids, det_bboxes, det_labels, det_scores, weight_iou_with_det_scores, match_iou_thr) and returns: row,  col