class_docstr: Decoding predictions of PSENet to instances. This is partially adapted
  from https://github.com/whai362/PSENet.
  
  Args:
      text_repr_type (str): The boundary encoding type 'poly' or 'quad'.
          Defaults to 'poly'.
      rescale_fields (list[str]): The bbox/polygon field names to
          be rescaled. If None, no rescaling will be performed. Defaults to
          ['polygons'].
      min_kernel_confidence (float): The minimal kernel confidence.
          Defaults to 0.5.
      score_threshold (float): The minimal text average confidence.
          Defaults to 0.3.
      min_kernel_area (int): The minimal text kernel area. Defaults to 0.
      min_text_area (int): The minimal text instance region area.
          Defaults to 16.
      downsample_ratio (float): Downsample ratio. Defaults to 0.25.
class_docstr_tok: ["Decoding","predictions","of","PSENet","to","instances",".","This","is","partially","adapted","from","https",":","\/\/github.com\/whai362\/PSENet",".","Args",":","text_repr_type","(","str",")",":","The","boundary","encoding","type","'poly","'","or","'quad","'",".","Defaults","to","'poly","'",".","rescale_fields","(","list","[","str","]",")",":","The","bbox\/polygon","field","names","to","be","rescaled",".","If","None",",","no","rescaling","will","be","performed",".","Defaults","to","[","'polygons","'","]",".","min_kernel_confidence","(","float",")",":","The","minimal","kernel","confidence",".","Defaults","to","0.5.","score_threshold","(","float",")",":","The","minimal","text","average","confidence",".","Defaults","to","0.3.","min_kernel_area","(","int",")",":","The","minimal","text","kernel","area",".","Defaults","to","0.","min_text_area","(","int",")",":","The","minimal","text","instance","region","area",".","Defaults","to","16.","downsample_ratio","(","float",")",":","Downsample","ratio",".","Defaults","to","0.25","."]
code: def __init__(
      self,
      text_repr_type: str = "poly",
      rescale_fields: List[str] = ["polygons"],
      min_kernel_confidence: float = 0.5,
      score_threshold: float = 0.3,
      min_kernel_area: int = 0,
      min_text_area: int = 16,
      downsample_ratio: float = 0.25,
  ) -> None:
      super().__init__(
          text_repr_type=text_repr_type,
          rescale_fields=rescale_fields,
          min_kernel_confidence=min_kernel_confidence,
          score_threshold=score_threshold,
          min_text_area=min_text_area,
          downsample_ratio=downsample_ratio,
      )
      self.min_kernel_area = min_kernel_area
  
file_path: mmocr/mmocr/models/textdet/postprocessors/pse_postprocessor.py
imports: from typing import List
  import cv2
  import numpy
  import torch
  from mmcv.ops import contour_expand
  from mmengine.structures import InstanceData
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from .pan_postprocessor import PANPostprocessor
label_desc: Use image node_id 1 to create a new PSEPostprocessor object from inherited base classes: PANPostprocessor with example: obj = PSEPostprocessor(text_repr_type, rescale_fields, min_kernel_confidence, score_threshold, min_kernel_area, min_text_area, downsample_ratio)