class_docstr: RecogLMDBDataset for text recognition.
  
  The annotation format should be in lmdb format. The lmdb file should
  contain three keys: 'num-samples', 'label-xxxxxxxxx' and 'image-xxxxxxxxx',
  where 'xxxxxxxxx' is the index of the image. The value of 'num-samples' is
  the total number of images. The value of 'label-xxxxxxx' is the text label
  of the image, and the value of 'image-xxxxxxx' is the image data.
  
  following keys:
  Each item fetched from this dataset will be a dict containing the
  following keys:
  
      - img (ndarray): The loaded image.
      - img_path (str): The image key.
      - instances (list[dict]): The list of annotations for the image.
  
  Args:
      ann_file (str): Annotation file path. Defaults to ''.
      img_color_type (str): The flag argument for :func:``mmcv.imfrombytes``,
          which determines how the image bytes will be parsed. Defaults to
          'color'.
      metainfo (dict, optional): Meta information for dataset, such as class
          information. Defaults to None.
      data_root (str): The root directory for ``data_prefix`` and
          ``ann_file``. Defaults to ''.
      data_prefix (dict): Prefix for training data. Defaults to
          ``dict(img_path='')``.
      filter_cfg (dict, optional): Config for filter data. Defaults to None.
      indices (int or Sequence[int], optional): Support using first few
          data in annotation file to facilitate training/testing on a smaller
          dataset. Defaults to None which means using all ``data_infos``.
      serialize_data (bool, optional): Whether to hold memory using
          serialized objects, when enabled, data loader workers can use
          shared RAM from master process instead of making a copy. Defaults
          to True.
      pipeline (list, optional): Processing pipeline. Defaults to [].
      test_mode (bool, optional): ``test_mode=True`` means in test phase.
          Defaults to False.
      lazy_init (bool, optional): Whether to load annotation during
          instantiation. In some cases, such as visualization, only the meta
          information of the dataset is needed, which is not necessary to
          load annotation file. ``RecogLMDBDataset`` can skip load
          annotations to save time by set ``lazy_init=False``.
          Defaults to False.
      max_refetch (int, optional): If ``RecogLMDBdataset.prepare_data`` get a
          None img. The maximum extra number of cycles to get a valid
          image. Defaults to 1000.
class_docstr_tok: ["RecogLMDBDataset","for","text","recognition",".","The","annotation","format","should","be","in","lmdb","format",".","The","lmdb","file","should","contain","three","keys",":","'num-samples","'",",","'label-xxxxxxxxx","'","and","'image-xxxxxxxxx","'",",","where","'xxxxxxxxx","'","is","the","index","of","the","image",".","The","value","of","'num-samples","'","is","the","total","number","of","images",".","The","value","of","'label-xxxxxxx","'","is","the","text","label","of","the","image",",","and","the","value","of","'image-xxxxxxx","'","is","the","image","data",".","following","keys",":","Each","item","fetched","from","this","dataset","will","be","a","dict","containing","the","following","keys",":","-","img","(","ndarray",")",":","The","loaded","image",".","-","img_path","(","str",")",":","The","image","key",".","-","instances","(","list","[","dict","]",")",":","The","list","of","annotations","for","the","image",".","Args",":","ann_file","(","str",")",":","Annotation","file","path",".","Defaults","to","``",".","img_color_type","(","str",")",":","The","flag","argument","for",":","func",":","``","mmcv.imfrombytes","``",",","which","determines","how","the","image","bytes","will","be","parsed",".","Defaults","to","'color","'",".","metainfo","(","dict",",","optional",")",":","Meta","information","for","dataset",",","such","as","class","information",".","Defaults","to","None",".","data_root","(","str",")",":","The","root","directory","for","``","data_prefix","``","and","``","ann_file","``",".","Defaults","to","``",".","data_prefix","(","dict",")",":","Prefix","for","training","data",".","Defaults","to","``","dict","(","img_path=","''",")","``",".","filter_cfg","(","dict",",","optional",")",":","Config","for","filter","data",".","Defaults","to","None",".","indices","(","int","or","Sequence","[","int","]",",","optional",")",":","Support","using","first","few","data","in","annotation","file","to","facilitate","training\/testing","on","a","smaller","dataset",".","Defaults","to","None","which","means","using","all","``","data_infos","``",".","serialize_data","(","bool",",","optional",")",":","Whether","to","hold","memory","using","serialized","objects",",","when","enabled",",","data","loader","workers","can","use","shared","RAM","from","master","process","instead","of","making","a","copy",".","Defaults","to","True",".","pipeline","(","list",",","optional",")",":","Processing","pipeline",".","Defaults","to","[","]",".","test_mode","(","bool",",","optional",")",":","``","test_mode=True","``","means","in","test","phase",".","Defaults","to","False",".","lazy_init","(","bool",",","optional",")",":","Whether","to","load","annotation","during","instantiation",".","In","some","cases",",","such","as","visualization",",","only","the","meta","information","of","the","dataset","is","needed",",","which","is","not","necessary","to","load","annotation","file",".","``","RecogLMDBDataset","``","can","skip","load","annotations","to","save","time","by","set","``","lazy_init=False","``",".","Defaults","to","False",".","max_refetch","(","int",",","optional",")",":","If","``","RecogLMDBdataset.prepare_data","``","get","a","None","img",".","The","maximum","extra","number","of","cycles","to","get","a","valid","image",".","Defaults","to","1000","."]
docstr: Parse raw annotation to target format.
  
  Args:
      raw_anno_info (str): One raw data information loaded
          from ``ann_file``.
  
  Returns:
      (dict): Parsed annotation.
docstr_tok: ["Parse","raw","annotation","to","target","format",".","Args",":","raw_anno_info","(","str",")",":","One","raw","data","information","loaded","from","``","ann_file","``",".","Returns",":","(","dict",")",":","Parsed","annotation","."]
code: def parse_data_info(
      self, raw_anno_info: Tuple[Optional[str], str]
  ) -> Union[dict, List[dict]]:
      """Parse raw annotation to target format.
  
      Args:
          raw_anno_info (str): One raw data information loaded
              from ``ann_file``.
  
      Returns:
          (dict): Parsed annotation.
      """
      data_info = {}
      img_key, text = raw_anno_info
      data_info["img_key"] = img_key
      data_info["instances"] = [dict(text=text)]
      return data_info
  
file_path: mmocr/mmocr/datasets/recog_lmdb_dataset.py
imports: from typing import Any, Callable, List, Optional, Sequence, Tuple, Union
  import mmcv
  from mmengine.dataset import BaseDataset
  from mmocr.registry import DATASETS
label_desc: Use image node_id 3 for calling the RecogLMDBDataset obj's underlying member method code with example usage: obj.parse_data_info(raw_anno_info) and returns: data_info