code: def main():
      args = parse_args()
      root_path = args.root_path
      split_info = mmengine.load(
          osp.join(
              root_path, "annotations", "train_valid_test_split.json"
          )
      )
      split_info["training"] = split_info.pop("train")
      split_info["val"] = split_info.pop("valid")
      for split in ["training", "val", "test"]:
          print(f"Processing {split} set...")
          with mmengine.Timer(
              print_tmpl="It takes {}s to convert NAF annotation"
          ):
              files = collect_files(
                  osp.join(root_path, "imgs"),
                  osp.join(root_path, "annotations"),
                  split_info[split],
              )
              image_infos = collect_annotations(files, nproc=args.nproc)
              generate_ann(
                  root_path, split, image_infos, args.preserve_vertical
              )
  
file_path: mmocr/tools/dataset_converters/textrecog/naf_converter.py
imports: import argparse
  import os.path
  import mmcv
  import mmengine
  import numpy
  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