class_docstr: WildReceipt Dataset for key information extraction. There are two files
  to be loaded: metainfo and annotation. The metainfo file contains the
  mapping between classes and labels. The annotation file contains the all
  necessary information about the image, such as bounding boxes, texts, and
  labels etc.
  
  The metainfo file is a text file with the following format:
  
  .. code-block:: none
  
      0 Ignore
      1 Store_name_value
      2 Store_name_key
  
  The annotation format is shown as follows.
  
  .. code-block:: json
  
      {
          "file_name": "a.jpeg",
          "height": 348,
          "width": 348,
          "annotations": [
              {
                  "box": [
                      114.0,
                      19.0,
                      230.0,
                      19.0,
                      230.0,
                      1.0,
                      114.0,
                      1.0
                  ],
                  "text": "CHOEUN",
                  "label": 1
              },
              {
                  "box": [
                      97.0,
                      35.0,
                      236.0,
                      35.0,
                      236.0,
                      19.0,
                      97.0,
                      19.0
                  ],
                  "text": "KOREANRESTAURANT",
                  "label": 2
              }
          ]
      }
  
  Args:
      directed (bool): Whether to use directed graph. Defaults to False.
      ann_file (str): Annotation file path. Defaults to ''.
      metainfo (str or dict, optional): Meta information for dataset, such as
          class information. If it's a string, it will be treated as a path
          to the class file from which the class information will be loaded.
          Defaults to None.
      data_root (str, optional): The root directory for ``data_prefix`` and
          ``ann_file``. Defaults to ''.
      data_prefix (dict, optional): 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. ``Basedataset`` can skip load annotations to
          save time by set ``lazy_init=False``. Defaults to False.
      max_refetch (int, optional): If ``Basedataset.prepare_data`` get a
          None img. The maximum extra number of cycles to get a valid
          image. Defaults to 1000.
code: def __init__(
      self,
      directed: bool = False,
      ann_file: str = "",
      metainfo: Optional[Union[dict, str]] = None,
      data_root: str = "",
      data_prefix: dict = dict(img_path=""),
      filter_cfg: Optional[dict] = None,
      indices: Optional[Union[int, Sequence[int]]] = None,
      serialize_data: bool = True,
      pipeline: List[Union[dict, Callable]] = ...,
      test_mode: bool = False,
      lazy_init: bool = False,
      max_refetch: int = 1000,
  ):
      self.directed = directed
      super().__init__(
          ann_file,
          metainfo,
          data_root,
          data_prefix,
          filter_cfg,
          indices,
          serialize_data,
          pipeline,
          test_mode,
          lazy_init,
          max_refetch,
      )
      self._metainfo["dataset_type"] = "WildReceiptDataset"
      self._metainfo["task_name"] = "KIE"
  
file_path: mmocr/mmocr/datasets/wildreceipt_dataset.py
imports: import copy
  from typing import Callable, List, Optional, Sequence, Union
  import numpy
  from mmengine.dataset import BaseDataset
  from mmengine.fileio import list_from_file
  from mmocr.registry import DATASETS
  from mmocr.utils.parsers import LineJsonParser
  from mmocr.utils.polygon_utils import sort_vertex8
label_desc: Use image node_id 1 to create a new WildReceiptDataset object from inherited base classes: BaseDataset with example: obj = WildReceiptDataset(directed, ann_file, metainfo, data_root, data_prefix, filter_cfg, indices, serialize_data, pipeline, test_mode, lazy_init, max_refetch)