code: def build_test_pipeline(cfg: ConfigType) -> ConfigType:
      """Build test_pipeline for mot/vis demo. In mot/vis infer, original
      test_pipeline should remove the "LoadImageFromFile" and
      "LoadTrackAnnotations".
  
      Args:
           cfg (ConfigDict): The loaded config.
      Returns:
           ConfigType: new test_pipeline
      """
      # remove the "LoadImageFromFile" and "LoadTrackAnnotations" in pipeline
      transform_broadcaster = cfg.test_dataloader.dataset.pipeline[
          0
      ].copy()
      for transform in transform_broadcaster["transforms"]:
          if transform["type"] == "Resize":
              transform_broadcaster["transforms"] = transform
      pack_track_inputs = cfg.test_dataloader.dataset.pipeline[
          -1
      ].copy()
      test_pipeline = Compose(
          [transform_broadcaster, pack_track_inputs]
      )
  
      return test_pipeline
  
imports: import copy
  import warnings
  from pathlib import Path
  from typing import Optional, Sequence, Union
  import numpy
  import torch
  import torch.nn
  from mmcv.ops import RoIPool
  from mmcv.transforms import Compose
  from mmengine.config import Config
  from mmengine.dataset import default_collate
  from mmengine.model.utils import revert_sync_batchnorm
  from mmengine.registry import init_default_scope
  from mmengine.runner import load_checkpoint
  from mmdet.registry import DATASETS
  from mmdet.utils import ConfigType
  from ..evaluation import get_classes
  from ..registry import MODELS
  from ..structures import DetDataSample, SampleList
  from ..utils import get_test_pipeline_cfg
label_desc: Use image node_id 3 for calling a global function with example usage: build_test_pipeline(cfg) and returns: test_pipeline