class_docstr: Convert transforms's data format from MMOCR to MMDet.
  
  Required Keys:
  
  - img_shape
  - gt_polygons (List[ndarray]) (optional)
  - gt_ignored (np.bool) (optional)
  
  Added Keys:
  
  - gt_masks (PolygonMasks | BitmapMasks) (optional)
  - gt_ignore_flags (np.bool) (optional)
  
  Args:
      poly2mask (bool): Whether to convert mask to bitmap. Default: True.
class_docstr_tok: ["Convert","transforms","'s","data","format","from","MMOCR","to","MMDet",".","Required","Keys",":","-","img_shape","-","gt_polygons","(","List","[","ndarray","]",")","(","optional",")","-","gt_ignored","(","np.bool",")","(","optional",")","Added","Keys",":","-","gt_masks","(","PolygonMasks","|","BitmapMasks",")","(","optional",")","-","gt_ignore_flags","(","np.bool",")","(","optional",")","Args",":","poly2mask","(","bool",")",":","Whether","to","convert","mask","to","bitmap",".","Default",":","True","."]
code: def __init__(self, poly2mask: bool = False) -> None:
      self.poly2mask = poly2mask
  
file_path: mmocr/mmocr/datasets/transforms/adapters.py
imports: from typing import Dict
  from mmcv.transforms.base import BaseTransform
  from mmdet.structures.mask import PolygonMasks, bitmap_to_polygon
  from mmocr.registry import TRANSFORMS
label_desc: Use image node_id 1 to create a new MMOCR2MMDet object from inherited base classes: BaseTransform with example: obj = MMOCR2MMDet(poly2mask)