code: def modify_annotation(
      ann, num_sample, start_img_id=0, start_ann_id=0
  ):
      ann["text"] = digit2text(ann.pop("rec"))
      # Get hide egmentation points
      polygon_pts = bezier2polygon(
          ann["bezier_pts"], num_sample=num_sample
      )
      ann["segmentation"] = (
          np.asarray(sort_points(polygon_pts)).reshape(1, -1).tolist()
      )
      ann["image_id"] += start_img_id
      ann["id"] += start_ann_id
      return ann
  
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 2 for calling a global function with example usage: modify_annotation(ann, num_sample, start_img_id, start_ann_id) and returns: ann