code: def test_track(self):
      with torch.no_grad():
          packed_inputs = demo_track_inputs(batch_size=1, num_frames=2)
          track_data_sample = packed_inputs["data_samples"][0]
          video_len = len(track_data_sample)
          for frame_id in range(video_len):
              img_data_sample = track_data_sample[frame_id]
              img_data_sample.pred_instances = (
                  img_data_sample.gt_instances.clone()
              )
              # add fake scores
              scores = torch.ones(
                  len(img_data_sample.gt_instances.bboxes)
              )
              img_data_sample.pred_instances.scores = torch.FloatTensor(
                  scores
              )
  
              pred_track_instances = self.tracker.track(
                  data_sample=img_data_sample
              )
  
              bboxes = pred_track_instances.bboxes
              labels = pred_track_instances.labels
  
              assert bboxes.shape[1] == 4
              assert bboxes.shape[0] == labels.shape[0]
  
file_path: mmdetection/tests/test_models/test_trackers/test_oc_sort_tracker.py
imports: from unittest import TestCase
  import torch
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.testing import demo_track_inputs
  from mmdet.utils import register_all_modules
label_desc: Use image node_id 2 for calling the TestByteTracker obj's underlying member method code with example usage: obj.test_track() without return types