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: Process prediction results from one image.
  
  Args:
      pred_result (Union[Tensor, List[Tensor]]): Prediction results of an
          image.
      data_sample (TextDetDataSample): Datasample of an image.
docstr_tok: ["Process","prediction","results","from","one","image",".","Args",":","pred_result","(","Union","[","Tensor",",","List","[","Tensor","]","]",")",":","Prediction","results","of","an","image",".","data_sample","(","TextDetDataSample",")",":","Datasample","of","an","image","."]
code: def _process_single(
      self,
      pred_result: Union[Tensor, List[Tensor]],
      data_sample: TextDetDataSample,
      **kwargs,
  ) -> TextDetDataSample:
      """Process prediction results from one image.
  
      Args:
          pred_result (Union[Tensor, List[Tensor]]): Prediction results of an
              image.
          data_sample (TextDetDataSample): Datasample of an image.
      """
  
      results = self.get_text_instances(
          pred_result, data_sample, **kwargs
      )
  
      if self.rescale_fields and len(self.rescale_fields) > 0:
          assert isinstance(self.rescale_fields, list)
          assert set(self.rescale_fields).issubset(
              set(results.pred_instances.keys())
          )
          results = self.rescale(results, data_sample.scale_factor)
      return results
  
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 3 for calling the BaseTextDetPostProcessor obj's underlying member method code with example usage: obj._process_single(pred_result, data_sample) and returns: results