code: def get_coco_annotation_from_obj(obj, label2id):
      label = obj.findtext("name")
      assert label in label2id, f"Error: {label} is not in label2id !"
      category_id = label2id[label]
      bndbox = obj.find("bndbox")
      xmin = int(float(bndbox.findtext("xmin")))
      ymin = int(float(bndbox.findtext("ymin")))
      xmax = int(float(bndbox.findtext("xmax")))
      ymax = int(float(bndbox.findtext("ymax")))
      if xmin >= xmax or ymin >= ymax:
          return {}
      o_width = xmax - xmin
      o_height = ymax - ymin
      area = o_width * o_height
      if area <= MIN_AREA:
          return {}
      ann = {
          "area": o_width * o_height,
          "iscrowd": 0,
          "bbox": [xmin, ymin, o_width, o_height],
          "category_id": category_id,
          "ignore": 0,
          "segmentation": [],  # This script is not for segmentation
      }
      return ann
  
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 4 for calling a global function with example usage: get_coco_annotation_from_obj(obj, label2id) and returns: ann, dict, dict