def METHOD_NAME():
    args = parse_args()
    root_path = args.root_path
    for split in ['training', 'test']:
        print(f'Processing {split} set...')
        with mmengine.Timer(print_tmpl='It takes {}s to convert annotation'):
            files = collect_files(
                osp.join(root_path, 'imgs', split),
                osp.join(root_path, 'annotations', split))
            image_infos = collect_annotations(files, nproc=args.nproc)
            dump_ocr_data(image_infos,
                          osp.join(root_path, 'instances_' + split + '.json'),
                          'textdet')