code: def main():
      args = parse_args()
      root_path = args.root_path
      out_dir = args.out_dir if args.out_dir else root_path
      mmengine.mkdir_or_exist(out_dir)
  
      anns = mmengine.load(osp.join(root_path, "train1.json"))
      data1 = convert_annotations(
          anns, "syntext_word_eng", args.num_sample, args.nproc
      )
  
      # Get the maximum image id from data1
      start_img_id = (
          max(data1["images"], key=lambda x: x["id"])["id"] + 1
      )
      start_ann_id = (
          max(data1["annotations"], key=lambda x: x["id"])["id"] + 1
      )
      anns = mmengine.load(osp.join(root_path, "train2.json"))
      data2 = convert_annotations(
          anns,
          "emcs_imgs",
          args.num_sample,
          args.nproc,
          start_img_id=start_img_id,
          start_ann_id=start_ann_id,
      )
  
      data1["images"] += data2["images"]
      data1["annotations"] += data2["annotations"]
      mmengine.dump(data1, osp.join(out_dir, "instances_training.json"))
  
file_path: mmocr/tools/dataset_converters/common/curvedsyntext_converter.py
imports: import argparse
  import os.path
  from functools import partial
  import mmengine
  import numpy
  from mmocr.utils import bezier2polygon, sort_points
label_desc: Use image node_id 6 for calling a global function with example usage: main() without return types