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","."]
code: def __init__(
      self,
      text_repr_type: str = "poly",
      rescale_fields: Optional[Sequence[str]] = None,
      train_cfg: Optional[Dict] = None,
      test_cfg: Optional[Dict] = None,
  ) -> None:
      assert text_repr_type in ["poly", "quad"]
      assert rescale_fields is None or isinstance(rescale_fields, list)
      assert train_cfg is None or isinstance(train_cfg, dict)
      assert test_cfg is None or isinstance(test_cfg, dict)
      self.text_repr_type = text_repr_type
      self.rescale_fields = rescale_fields
      self.train_cfg = train_cfg
      self.test_cfg = test_cfg
  
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 1 to create a new BaseTextDetPostProcessor object  with example: obj = BaseTextDetPostProcessor(text_repr_type, rescale_fields, train_cfg, test_cfg)