class_docstr: Tracker for SORT/DeepSORT.
  
  Args:
      obj_score_thr (float, optional): Threshold to filter the objects.
          Defaults to 0.3.
      motion (dict): Configuration of motion. Defaults to None.
      reid (dict, optional): Configuration for the ReID model.
          - num_samples (int, optional): Number of samples to calculate the
              feature embeddings of a track. Default to 10.
          - image_scale (tuple, optional): Input scale of the ReID model.
              Default to (256, 128).
          - img_norm_cfg (dict, optional): Configuration to normalize the
              input. Default to None.
          - match_score_thr (float, optional): Similarity threshold for the
              matching process. Default to 2.0.
      match_iou_thr (float, optional): Threshold of the IoU matching process.
          Defaults to 0.7.
      num_tentatives (int, optional): Number of continuous frames to confirm
          a track. Defaults to 3.
class_docstr_tok: ["Tracker","for","SORT\/DeepSORT",".","Args",":","obj_score_thr","(","float",",","optional",")",":","Threshold","to","filter","the","objects",".","Defaults","to","0.3.","motion","(","dict",")",":","Configuration","of","motion",".","Defaults","to","None",".","reid","(","dict",",","optional",")",":","Configuration","for","the","ReID","model",".","-","num_samples","(","int",",","optional",")",":","Number","of","samples","to","calculate","the","feature","embeddings","of","a","track",".","Default","to","10",".","-","image_scale","(","tuple",",","optional",")",":","Input","scale","of","the","ReID","model",".","Default","to","(","256",",","128",")",".","-","img_norm_cfg","(","dict",",","optional",")",":","Configuration","to","normalize","the","input",".","Default","to","None",".","-","match_score_thr","(","float",",","optional",")",":","Similarity","threshold","for","the","matching","process",".","Default","to","2.0.","match_iou_thr","(","float",",","optional",")",":","Threshold","of","the","IoU","matching","process",".","Defaults","to","0.7.","num_tentatives","(","int",",","optional",")",":","Number","of","continuous","frames","to","confirm","a","track",".","Defaults","to","3","."]
docstr: Pop out invalid tracks.
docstr_tok: ["Pop","out","invalid","tracks","."]
code: def pop_invalid_tracks(self, frame_id: int) -> None:
      """Pop out invalid tracks."""
      invalid_ids = []
      for k, v in self.tracks.items():
          # case1: disappeared frames >= self.num_frames_retrain
          case1 = (
              frame_id - v["frame_ids"][-1] >= self.num_frames_retain
          )
          # case2: tentative tracks but not matched in this frame
          case2 = v.tentative and v["frame_ids"][-1] != frame_id
          if case1 or case2:
              invalid_ids.append(k)
      for invalid_id in invalid_ids:
          self.tracks.pop(invalid_id)
  
file_path: mmdetection/mmdet/models/trackers/sort_tracker.py
imports: from typing import List, Optional, Tuple
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.structures import DetDataSample
  from mmdet.structures.bbox import bbox_overlaps, bbox_xyxy_to_cxcyah
  from mmdet.utils import OptConfigType
  from ..utils import imrenormalize
  from .base_tracker import BaseTracker
label_desc: Use image node_id 5 for calling the SORTTracker obj's underlying member method code with example usage: obj.pop_invalid_tracks(frame_id) without return types