code: def load_xml_info(gt_file, img_info):
      """Collect the annotation information.
  
      Annotation Format
      <image>
          <imageName>DSC02306.JPG</imageName>
          <resolution x="640" y="480" />
          <words>
              <word x="61" y="140" width="566" height="107">
                  <character x="61" y="147" width="75" height="94" char="C" />
                  <character x="173" y="147" width="77" height="93" char="L" />
                  <character x="251" y="146" width="83" height="96" char="A" />
                  <character x="335" y="146" width="75" height="97" char="V" />
                  <character x="409" y="140" width="52" height="105" char="I" />
                  <character x="464" y="147" width="76" height="96" char="T" />
                  <character x="538" y="154" width="89" height="93" char="A" />
              </word>
          </words>
          <illumination>no</illumination>
          <difficulty>2</difficulty>
          <tag>
          </tag>
      </image>
  
      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
      """
  
      obj = ET.parse(gt_file)
      root = obj.getroot()
      anno_info = []
      for word in root.iter("word"):
          x, y = max(0, int(word.attrib["x"])), max(
              0, int(word.attrib["y"])
          )
          w, h = int(word.attrib["width"]), int(word.attrib["height"])
          bbox = [x, y, w, h]
          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/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 4 for calling a global function with example usage: load_xml_info(gt_file, img_info) and returns: img_info