code: def parse_coco_json(in_path):
      json_obj = mmengine.load(in_path)
      image_infos = json_obj["images"]
      annotations = json_obj["annotations"]
      imgid2imgname = {}
      img_ids = []
      for image_info in image_infos:
          imgid2imgname[image_info["id"]] = image_info
          img_ids.append(image_info["id"])
      imgid2anno = {}
      for img_id in img_ids:
          imgid2anno[img_id] = []
      for anno in annotations:
          img_id = anno["image_id"]
          new_anno = {}
          new_anno["iscrowd"] = anno["iscrowd"]
          new_anno["category_id"] = anno["category_id"]
          new_anno["bbox"] = anno["bbox"]
          new_anno["segmentation"] = anno["segmentation"]
          if img_id in imgid2anno.keys():
              imgid2anno[img_id].append(new_anno)
  
      return imgid2imgname, imgid2anno
  
imports: import argparse
  import json
  import mmengine
  from mmocr.utils import list_to_file
label_desc: Use image node_id 1 for calling a global function with example usage: parse_coco_json(in_path) and returns: imgid2imgname,  imgid2anno