code: def main():
      args = parse_args()
      root_path = args.root_path
      ratio = args.val_ratio
  
      trn_files, val_files = collect_files(
          osp.join(root_path, "imgs"),
          osp.join(root_path, "annotations"),
          ratio,
      )
  
      # Train set
      trn_infos = collect_annotations(trn_files, nproc=args.nproc)
      with mmengine.Timer(
          print_tmpl="It takes {}s to convert ReCTS Training annotation"
      ):
          generate_ann(
              root_path, "training", trn_infos, args.preserve_vertical
          )
  
      # Val set
      if len(val_files) > 0:
          val_infos = collect_annotations(val_files, nproc=args.nproc)
          with mmengine.Timer(
              print_tmpl="It takes {}s to convert ReCTS Val annotation"
          ):
              generate_ann(
                  root_path, "val", val_infos, args.preserve_vertical
              )
  
file_path: mmocr/tools/dataset_converters/textrecog/rects_converter.py
imports: import argparse
  import math
  import os
  import os.path
  import mmcv
  import mmengine
  from mmocr.utils import crop_img, dump_ocr_data
label_desc: Use image node_id 7 for calling a global function with example usage: main() without return types