code: def test_quasi_dense_track_head_loss(self):
      packed_inputs = demo_track_inputs(
          batch_size=1,
          num_frames=2,
          key_frames_inds=[0],
          image_shapes=[(3, 256, 256)],
      )
      img_metas = [
          {
              "img_shape": (256, 256, 3),
              "scale_factor": 1,
          }
      ]
      proposal_list = _fake_proposals(img_metas, 10)
      feats = []
      for i in range(
          len(self.track_head.roi_extractor.featmap_strides)
      ):
          feats.append(
              torch.rand(
                  1, 256, 256 // (2 ** (i + 2)), 256 // (2 ** (i + 2))
              ).to(device="cpu")
          )
      key_feats = tuple(feats)
      ref_feats = key_feats
      loss_track = self.track_head.loss(
          key_feats,
          ref_feats,
          proposal_list,
          proposal_list,
          [packed_inputs["data_samples"][0]],
      )
      assert loss_track["loss_track"] >= 0, "track loss should be zero"
      assert (
          loss_track["loss_track_aux"] > 0
      ), "aux loss should be non-zero"
  
file_path: mmdetection/tests/test_models/test_tracking_heads/test_quasi_dense_track_head.py
imports: from unittest import TestCase
  import torch
  from mmengine import init_default_scope
  from mmengine.config import Config
  from mmengine.structures import InstanceData
  from mmdet.registry import MODELS
  from mmdet.testing import demo_track_inputs, random_boxes
label_desc: Use image node_id 2 for calling the TestQuasiDenseTrackHead obj's underlying member method code with example usage: obj.test_quasi_dense_track_head_loss() without return types