code: def get_image_info(annotation_root, extract_num_from_imgid=True):
      path = annotation_root.findtext("path")
      if path is None:
          filename = annotation_root.findtext("filename")
      else:
          filename = os.path.basename(path)
      img_name = os.path.basename(filename)
      if not img_name[-4:] in [".jpg", ".png"]:
          img_name = img_name + DEFAULT_EXT
      img_id = os.path.splitext(img_name)[0]
      if extract_num_from_imgid and isinstance(img_id, str):
          img_id = int("".join(re.findall(r"\d+", img_id)))
  
      size = annotation_root.find("size")
      width = int(size.findtext("width"))
      height = int(size.findtext("height"))
  
      image_info = {
          "file_name": os.path.join("JPEGImages", img_name),
          "height": height,
          "width": width,
          "id": img_id,
      }
      return image_info
  
file_path: autogluon/multimodal/src/autogluon/multimodal/cli/voc2coco.py
imports: import argparse
  import json
  import os
  import random
  import re
  import subprocess
  from typing import Dict, List
  import defusedxml.ElementTree
  from tqdm import tqdm
  from autogluon.multimodal.utils.object_detection import dump_voc_classes, dump_voc_xml_files, process_voc_annotations
label_desc: Use image node_id 3 for calling a global function with example usage: get_image_info(annotation_root, extract_num_from_imgid) and returns: image_info