code: def test_track(self, cfg_file):
      _model = get_detector_cfg(cfg_file)
      # _scope_ will be popped after build
      model = MODELS.build(_model)
  
      packed_inputs = demo_track_inputs(
          batch_size=1, num_frames=2, with_mask=True
      )
      track_data_sample = packed_inputs["data_samples"][0]
      imgs = packed_inputs["inputs"][0]
      video_len = len(track_data_sample)
      for frame_id in range(video_len):
          img_data_sample = track_data_sample[frame_id]
          single_image = imgs[frame_id]
          img_data_sample.pred_instances = (
              img_data_sample.gt_instances.clone()
          )
          # add fake scores
          scores = torch.ones(
              len(img_data_sample.pred_instances.bboxes)
          )
          img_data_sample.pred_instances.scores = torch.FloatTensor(
              scores
          )
          feats = []
          for i in range(
              len(model.track_head.roi_extractor.featmap_strides)
          ):
              feats.append(
                  torch.rand(
                      1,
                      256,
                      256 // (2 ** (i + 2)),
                      256 // (2 ** (i + 2)),
                  ).to(device="cpu")
              )
          pred_track_instances = self.tracker.track(
              model=model,
              img=single_image,
              feats=tuple(feats),
              data_sample=img_data_sample,
          )
  
          bboxes = pred_track_instances.bboxes
          labels = pred_track_instances.labels
          ids = pred_track_instances.instances_id
  
          assert bboxes.shape[1] == 4
          assert bboxes.shape[0] == labels.shape[0]
          assert bboxes.shape[0] == ids.shape[0]
  
file_path: mmdetection/tests/test_models/test_trackers/test_masktrack_rcnn_tracker.py
imports: from unittest import TestCase
  import torch
  from mmengine.registry import init_default_scope
  from parameterized import parameterized
  from mmdet.registry import MODELS
  from mmdet.testing import demo_track_inputs, get_detector_cfg, random_boxes
label_desc: Use image node_id 3 for calling the TestMaskTrackRCNNTracker obj's underlying member method code with example usage: obj.test_track(cfg_file) without return types