code: def load_txt_info(gt_file, img_info):
      """Collect the annotation information.
  
      The annotation format is as the following:
      x, y, w, h, text
      977, 152, 16, 49, NOME
      962, 143, 12, 323, APPINHANESI BLAZEK PASSOTTO
      906, 446, 12, 94, 206940361
      905, 641, 12, 44, SPTC
  
      Args:
          gt_file (str): The path to ground-truth
          img_info (dict): The dict of the img and annotation information
  
      Returns:
          img_info (dict): The dict of the img and annotation information
      """
      with open(gt_file, encoding="latin1") as f:
          anno_info = []
          for line in f:
              line = line.strip("\n")
              if line[0] == "[" or line[0] == "x":
                  continue
              ann = line.split(",")
              bbox = ann[0:4]
              bbox = [int(coord) for coord in bbox]
              x, y, w, h = bbox
              segmentation = [x, y, x + w, y, x + w, y + h, x, y + h]
              anno = dict(
                  iscrowd=0,
                  category_id=1,
                  bbox=bbox,
                  area=w * h,
                  segmentation=[segmentation],
              )
              anno_info.append(anno)
  
      img_info.update(anno_info=anno_info)
  
      return img_info
  
file_path: mmocr/tools/dataset_converters/textdet/bid_converter.py
imports: import argparse
  import os
  import os.path
  import mmcv
  import mmengine
  from mmocr.utils import dump_ocr_data
label_desc: Use image node_id 4 for calling a global function with example usage: load_txt_info(gt_file, img_info) and returns: img_info