code: def main():
      args = parse_args()
      root_path = args.root_path
      print("Processing training set...")
      training_infos = collect_cocotext_info(root_path, "train")
      dump_ocr_data(
          training_infos,
          osp.join(root_path, "instances_training.json"),
          "textdet",
      )
      print("Processing validation set...")
      val_infos = collect_cocotext_info(root_path, "val")
      dump_ocr_data(
          val_infos,
          osp.join(root_path, "instances_val.json"),
          "textdet",
      )
      print("Finish")
  
imports: import argparse
  import math
  import os.path
  import mmengine
  from mmocr.utils import dump_ocr_data
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types