class_docstr: Base postprocessor for text detection models.
  
  Args:
      text_repr_type (str): The boundary encoding type, 'poly' or 'quad'.
          Defaults to 'poly'.
      rescale_fields (list[str], optional): The bbox/polygon field names to
          be rescaled. If None, no rescaling will be performed.
      train_cfg (dict, optional): The parameters to be passed to
          ``self.get_text_instances`` in training. Defaults to None.
      test_cfg (dict, optional): The parameters to be passed to
          ``self.get_text_instances`` in testing. Defaults to None.
class_docstr_tok: ["Base","postprocessor","for","text","detection","models",".","Args",":","text_repr_type","(","str",")",":","The","boundary","encoding","type",",","'poly","'","or","'quad","'",".","Defaults","to","'poly","'",".","rescale_fields","(","list","[","str","]",",","optional",")",":","The","bbox\/polygon","field","names","to","be","rescaled",".","If","None",",","no","rescaling","will","be","performed",".","train_cfg","(","dict",",","optional",")",":","The","parameters","to","be","passed","to","``","self.get_text_instances","``","in","training",".","Defaults","to","None",".","test_cfg","(","dict",",","optional",")",":","The","parameters","to","be","passed","to","``","self.get_text_instances","``","in","testing",".","Defaults","to","None","."]
docstr: Get text instance predictions of one image.
  
  Args:
      pred_result (tuple(Tensor)): Prediction results of an image.
      data_sample (TextDetDataSample): Datasample of an image.
      **kwargs: Other parameters. Configurable via ``__init__.train_cfg``
          and ``__init__.test_cfg``.
  
  Returns:
      TextDetDataSample: A new DataSample with predictions filled in.
      The polygon/bbox results are usually saved in
      ``TextDetDataSample.pred_instances.polygons`` or
      ``TextDetDataSample.pred_instances.bboxes``. The confidence scores
      are saved in ``TextDetDataSample.pred_instances.scores``.
docstr_tok: ["Get","text","instance","predictions","of","one","image",".","Args",":","pred_result","(","tuple","(","Tensor",")",")",":","Prediction","results","of","an","image",".","data_sample","(","TextDetDataSample",")",":","Datasample","of","an","image",".","*","*","kwargs",":","Other","parameters",".","Configurable","via","``","__init__.train_cfg","``","and","``","__init__.test_cfg","``",".","Returns",":","TextDetDataSample",":","A","new","DataSample","with","predictions","filled","in",".","The","polygon\/bbox","results","are","usually","saved","in","``","TextDetDataSample.pred_instances.polygons","``","or","``","TextDetDataSample.pred_instances.bboxes","``",".","The","confidence","scores","are","saved","in","``","TextDetDataSample.pred_instances.scores","``","."]
code: def get_text_instances(
      self,
      pred_results: Union[Tensor, List[Tensor]],
      data_sample: TextDetDataSample,
      **kwargs,
  ) -> TextDetDataSample:
      """Get text instance predictions of one image.
  
      Args:
          pred_result (tuple(Tensor)): Prediction results of an image.
          data_sample (TextDetDataSample): Datasample of an image.
          **kwargs: Other parameters. Configurable via ``__init__.train_cfg``
              and ``__init__.test_cfg``.
  
      Returns:
          TextDetDataSample: A new DataSample with predictions filled in.
          The polygon/bbox results are usually saved in
          ``TextDetDataSample.pred_instances.polygons`` or
          ``TextDetDataSample.pred_instances.bboxes``. The confidence scores
          are saved in ``TextDetDataSample.pred_instances.scores``.
      """
      raise NotImplementedError
  
file_path: mmocr/mmocr/models/textdet/postprocessors/base.py
imports: from functools import partial
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  import mmengine
  import numpy
  from torch import Tensor
  from mmocr.structures import TextDetDataSample
  from mmocr.utils import boundary_iou, rescale_polygons
label_desc: Use image node_id 5 for calling the BaseTextDetPostProcessor obj's underlying member method code with example usage: obj.get_text_instances(pred_results, data_sample) without return types