class_docstr: Convert scores to quadrangles via post processing in PANet. This is
  partially adapted from https://github.com/WenmuZhou/PAN.pytorch.
  
  Args:
      text_repr_type (str): The boundary encoding type 'poly' or 'quad'.
          Defaults to 'poly'.
      score_threshold (float): The minimal text score.
          Defaults to 0.3.
      rescale_fields (list[str]): The bbox/polygon field names to
          be rescaled. If None, no rescaling will be performed. Defaults to
          ['polygons'].
      min_text_confidence (float): The minimal text confidence.
          Defaults to 0.5.
      min_kernel_confidence (float): The minimal kernel confidence.
          Defaults to 0.5.
      distance_threshold (float): The minimal distance between the point to
          mean of text kernel. Defaults to 3.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",
      score_threshold: float = 0.3,
      rescale_fields: Sequence[str] = ["polygons"],
      min_text_confidence: float = 0.5,
      min_kernel_confidence: float = 0.5,
      distance_threshold: float = 3.0,
      min_text_area: int = 16,
      downsample_ratio: float = 0.25,
  ) -> None:
      super().__init__(text_repr_type, rescale_fields)
  
      self.min_text_confidence = min_text_confidence
      self.min_kernel_confidence = min_kernel_confidence
      self.score_threshold = score_threshold
      self.min_text_area = min_text_area
      self.distance_threshold = distance_threshold
      self.downsample_ratio = downsample_ratio
  
file_path: mmocr/mmocr/models/textdet/postprocessors/pan_postprocessor.py
imports: from typing import List, Sequence
  import cv2
  import numpy
  import torch
  from mmcv.ops import pixel_group
  from mmengine.structures import InstanceData
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from .base import BaseTextDetPostProcessor
label_desc: Use image node_id 1 to create a new PANPostprocessor object from inherited base classes: BaseTextDetPostProcessor with example: obj = PANPostprocessor(text_repr_type, score_threshold, rescale_fields, min_text_confidence, min_kernel_confidence, distance_threshold, min_text_area, downsample_ratio)