code: def pack_data(
      frame_resize: np.ndarray,
      batch_input_shape: Tuple[int, int],
      ori_shape: Tuple[int, int],
  ) -> dict:
      assert frame_resize.shape[:2] == batch_input_shape
      data_sample = DetDataSample()
      data_sample.set_metainfo(
          {
              "img_shape": batch_input_shape,
              "ori_shape": ori_shape,
              "scale_factor": (
                  batch_input_shape[0] / ori_shape[0],
                  batch_input_shape[1] / ori_shape[1],
              ),
          }
      )
      frame_resize = (
          torch.from_numpy(frame_resize).permute((2, 0, 1)).cuda()
      )
      data = {"inputs": [frame_resize], "data_samples": [data_sample]}
      return data
  
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 3 for calling a global function with example usage: pack_data(frame_resize, batch_input_shape, ori_shape) and returns: data