code: def load_txt_info(gt_file, img_info):
      """Collect the annotation information.
  
      # Annotation Format
      # x1, y1, x2, y2, x3, y3, x4, y4, transcript
  
      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) as f:
          anno_info = []
          annotations = f.readlines()
          for ann in annotations:
              try:
                  ann_box = (
                      np.array(ann.split(",")[0:8]).astype(int).tolist()
                  )
              except ValueError:
                  # skip invalid annotation line
                  continue
              x = max(0, min(ann_box[0::2]))
              y = max(0, min(ann_box[1::2]))
              w, h = max(ann_box[0::2]) - x, max(ann_box[1::2]) - y
              bbox = [x, y, w, h]
              segmentation = ann_box
              word = ann.split(",")[-1].replace("\n", "").strip()
  
              anno = dict(
                  iscrowd=0 if word != "###" else 1,
                  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/detext_converter.py
imports: import argparse
  import os
  import os.path
  import mmcv
  import mmengine
  import numpy
  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