class_docstr: Convert bezier curves to polygon.
  
  Required Keys:
  
  - gt_beziers
  
  Modified Keys:
  
  - gt_polygons
class_docstr_tok: ["Convert","bezier","curves","to","polygon",".","Required","Keys",":","-","gt_beziers","Modified","Keys",":","-","gt_polygons"]
docstr: Args:
      results (dict): Result dict containing the data to transform.
  
  Returns:
      Optional[dict]: The transformed data. If all the polygons are
      unfixable, return None.
docstr_tok: ["Args",":","results","(","dict",")",":","Result","dict","containing","the","data","to","transform",".","Returns",":","Optional","[","dict","]",":","The","transformed","data",".","If","all","the","polygons","are","unfixable",",","return","None","."]
code: def transform(self, results: Dict) -> Dict:
      """
  
      Args:
          results (dict): Result dict containing the data to transform.
  
      Returns:
          Optional[dict]: The transformed data. If all the polygons are
          unfixable, return None.
      """
      if results.get("gt_beziers", None) is not None:
          results["gt_polygons"] = [
              np.array(bezier2poly(poly), dtype=np.float32)
              for poly in results["gt_beziers"]
          ]
      return results
  
imports: import random
  from typing import Dict
  import numpy
  from mmcv.transforms.base import BaseTransform
  from mmocr.datasets.transforms import LoadOCRAnnotations
  from mmocr.registry import TASK_UTILS, TRANSFORMS
  from mmocr.utils import bezier2poly, poly2bezier
label_desc: Use image node_id 1 for calling the Bezier2Polygon obj's underlying member method code with example usage: obj.transform(results) and returns: results