code: def load_xml_info(gt_file, img_info):
      """Collect the annotation information.
  
      The annotation format is as the following:
      <annotations>
      ...
          <object>
              <name>SMT</name>
              <pose>Unspecified</pose>
              <truncated>0</truncated>
              <difficult>0</difficult>
              <bndbox>
                  <xmin>157</xmin>
                  <ymin>294</ymin>
                  <xmax>237</xmax>
                  <ymax>357</ymax>
              </bndbox>
          <object>
  
      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 object in root.iter("object"):
          word = object.find("name").text
          iscrowd = 1 if len(word) == 0 else 0
          x1 = int(object.find("bndbox").find("xmin").text)
          y1 = int(object.find("bndbox").find("ymin").text)
          x2 = int(object.find("bndbox").find("xmax").text)
          y2 = int(object.find("bndbox").find("ymax").text)
  
          x = max(0, min(x1, x2))
          y = max(0, min(y1, y2))
          w, h = abs(x2 - x1), abs(y2 - y1)
          bbox = [x1, y1, w, h]
          segmentation = [x, y, x + w, y, x + w, y + h, x, y + h]
          anno = dict(
              iscrowd=iscrowd,
              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/ilst_converter.py
imports: import argparse
  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