code: def collect_level_info(annotation):
      """Collect information from any level in HierText.
  
      Args:
          annotation (dict): dict at each level
  
      Return:
          anno (dict): dict containing annotations
      """
      iscrowd = 0 if annotation["legible"] else 1
      vertices = np.array(annotation["vertices"])
      polygon = Polygon(vertices)
      area = polygon.area
      min_x, min_y, max_x, max_y = polygon.bounds
      bbox = [min_x, min_y, max_x - min_x, max_y - min_y]
      segmentation = [i for j in vertices for i in j]
      anno = dict(
          iscrowd=iscrowd,
          category_id=1,
          bbox=bbox,
          area=area,
          segmentation=[segmentation],
      )
      return anno
  
file_path: mmocr/tools/dataset_converters/textdet/hiertext_converter.py
imports: import argparse
  import json
  import os.path
  import numpy
  from shapely.geometry import Polygon
  from mmocr.utils import dump_ocr_data
label_desc: Use image node_id 1 for calling a global function with example usage: collect_level_info(annotation) and returns: anno