code: def make_grid(imgs, infos):
      """Concat list of pictures into a single big picture, align height here."""
      visualizer = Visualizer.get_current_instance()
      names = [info["name"] for info in infos]
      ori_shapes = [
          info["dataset_sample"].metainfo["img_shape"] for info in infos
      ]
      max_height = int(max(img.shape[0] for img in imgs) * 1.1)
      min_width = min(img.shape[1] for img in imgs)
      horizontal_gap = min_width // 10
      img_scale = _get_adaptive_scale((max_height, min_width))
  
      texts = []
      text_positions = []
      start_x = 0
      for i, img in enumerate(imgs):
          pad_height = (max_height - img.shape[0]) // 2
          pad_width = horizontal_gap // 2
          # make border
          imgs[i] = cv2.copyMakeBorder(
              img,
              pad_height,
              max_height
              - img.shape[0]
              - pad_height
              + int(img_scale * 30 * 2),
              pad_width,
              pad_width,
              cv2.BORDER_CONSTANT,
              value=(255, 255, 255),
          )
          texts.append(
              f'{"execution: "}{i}\n{names[i]}\n{ori_shapes[i]}'
          )
          text_positions.append(
              [start_x + img.shape[1] // 2 + pad_width, max_height]
          )
          start_x += img.shape[1] + horizontal_gap
  
      display_img = np.concatenate(imgs, axis=1)
      visualizer.set_image(display_img)
      img_scale = _get_adaptive_scale(display_img.shape[:2])
      visualizer.draw_texts(
          texts,
          positions=np.array(text_positions),
          font_sizes=img_scale * 7,
          colors="black",
          horizontal_alignments="center",
          font_families="monospace",
      )
      return visualizer.get_image()
  
imports: import argparse
  import os.path
  import sys
  from typing import Optional, Tuple
  import cv2
  import mmcv
  import numpy
  from mmengine.config import Config, DictAction
  from mmengine.dataset import Compose
  from mmengine.registry import init_default_scope
  from mmengine.utils import ProgressBar
  from mmengine.visualization import Visualizer
  from mmocr.registry import DATASETS, VISUALIZERS
label_desc: Use image node_id 3 for calling a global function with example usage: make_grid(imgs, infos) and returns: visualizer