def METHOD_NAME():
    args = parse_args()
    root_path = args.root_path
    with mmengine.Timer(print_tmpl='It takes {}s to convert BID annotation'):
        files = collect_files(
            osp.join(root_path, 'imgs'), osp.join(root_path, 'annotations'))
        image_infos = collect_annotations(files, nproc=args.nproc)
        if args.val_ratio:
            image_infos = split_train_val_list(image_infos, args.val_ratio)
            splits = ['training', 'val']
        else:
            image_infos = [image_infos]
            splits = ['training']
        for i, split in enumerate(splits):
            dump_ocr_data(image_infos[i],
                          osp.join(root_path, 'instances_' + split + '.json'),
                          'textdet')