code: def collect_annotations(files, nproc=1):
      """Collect the annotation information.
  
      Args:
          files (list): The list of tuples (image_file, groundtruth_file)
          nproc (int): The number of process to collect annotations
  
      Returns:
          images (list): The list of image information dicts
      """
      assert isinstance(files, list)
      assert isinstance(nproc, int)
  
      if nproc > 1:
          images = mmengine.track_parallel_progress(
              load_img_info, files, nproc=nproc
          )
      else:
          images = mmengine.track_progress(load_img_info, files)
  
      return images
  
file_path: mmocr/tools/dataset_converters/textdet/kaist_converter.py
imports: import argparse
  import math
  import os
  import os.path
  import xml.etree.ElementTree
  import mmcv
  import mmengine
  from mmocr.utils import dump_ocr_data
label_desc: Use image node_id 2 for calling a global function with example usage: collect_annotations(files, nproc) and returns: images