class_docstr: Text recogntion packer. It is used to pack the parsed annotation info
  to:
  
  .. code-block:: python
  
      {
          "metainfo":
              {
                  "dataset_type": "TextRecogDataset",
                  "task_name": "textrecog",
              },
          "data_list":
              [
                  {
                      "img_path": "textrecog_imgs/train/test_img.jpg",
                      "instances":
                          [
                              {
                                  "text": "GRAND"
                              }
                          ]
                  }
              ]
      }
docstr: Pack the text info to a recognition instance.
  
  Args:
      samples (Tuple): A tuple of (img_name, text).
      split (str): The split of the instance.
  
  Returns:
      Dict: The packed instance.
docstr_tok: ["Pack","the","text","info","to","a","recognition","instance",".","Args",":","samples","(","Tuple",")",":","A","tuple","of","(","img_name",",","text",")",".","split","(","str",")",":","The","split","of","the","instance",".","Returns",":","Dict",":","The","packed","instance","."]
code: def pack_instance(self, sample: Tuple) -> Dict:
      """Pack the text info to a recognition instance.
  
      Args:
          samples (Tuple): A tuple of (img_name, text).
          split (str): The split of the instance.
  
      Returns:
          Dict: The packed instance.
      """
  
      img_name, text = sample
      img_name = osp.relpath(img_name, self.data_root)
      packed_instance = dict(
          instances=[dict(text=text)], img_path=img_name
      )
  
      return packed_instance
  
file_path: mmocr/mmocr/datasets/preparers/packers/textrecog_packer.py
imports: import os.path
  from typing import Dict, List, Tuple
  import mmcv
  from mmengine import mkdir_or_exist
  from mmocr.registry import DATA_PACKERS
  from mmocr.utils import bbox2poly, crop_img, poly2bbox, warp_img
  from .base import BasePacker
label_desc: Use image node_id 1 for calling the TextRecogPacker obj's underlying member method code with example usage: obj.pack_instance(sample) and returns: packed_instance