code: def prefetch_batch_input_shape(
      model: nn.Module, ori_wh: Tuple[int, int]
  ) -> dict:
      cfg = model.cfg
      w, h = ori_wh
      cfg.test_dataloader.dataset.pipeline[
          0
      ].type = "LoadImageFromNDArray"
      test_pipeline = Compose(cfg.test_dataloader.dataset.pipeline)
      data = {"img": np.zeros((h, w, 3), dtype=np.uint8), "img_id": 0}
      data = test_pipeline(data)
      data["inputs"] = [data["inputs"]]
      data["data_samples"] = [data["data_samples"]]
      data_sample = model.data_preprocessor(data, False)["data_samples"]
      batch_input_shape = data_sample[0].batch_input_shape
      return batch_input_shape
  
file_path: mmdetection/demo/video_gpuaccel_demo.py
imports: import argparse
  from typing import Tuple
  import cv2
  import mmcv
  import numpy
  import torch
  import torch.nn
  from mmcv.transforms import Compose
  from mmengine.utils import track_iter_progress
  from mmdet.apis import init_detector
  from mmdet.registry import VISUALIZERS
  from mmdet.structures import DetDataSample
label_desc: Use image node_id 2 for calling a global function with example usage: prefetch_batch_input_shape(model, ori_wh) and returns: batch_input_shape