class_docstr: Decoding predictions of TextSnake to instances. This was partially
  adapted from https://github.com/princewang1994/TextSnake.pytorch.
  
  Args:
      text_repr_type (str): The boundary encoding type 'poly' or 'quad'.
      min_text_region_confidence (float): The confidence threshold of text
          region in TextSnake.
      min_center_region_confidence (float): The confidence threshold of text
          center region in TextSnake.
      min_center_area (int): The minimal text center region area.
      disk_overlap_thr (float): The radius overlap threshold for merging
          disks.
      radius_shrink_ratio (float): The shrink ratio of ordered disks radii.
      rescale_fields (list[str], optional): The bbox/polygon field names to
          be rescaled. If None, no rescaling will be performed.
class_docstr_tok: ["Decoding","predictions","of","TextSnake","to","instances",".","This","was","partially","adapted","from","https",":","\/\/github.com\/princewang1994\/TextSnake.pytorch",".","Args",":","text_repr_type","(","str",")",":","The","boundary","encoding","type","'poly","'","or","'quad","'",".","min_text_region_confidence","(","float",")",":","The","confidence","threshold","of","text","region","in","TextSnake",".","min_center_region_confidence","(","float",")",":","The","confidence","threshold","of","text","center","region","in","TextSnake",".","min_center_area","(","int",")",":","The","minimal","text","center","region","area",".","disk_overlap_thr","(","float",")",":","The","radius","overlap","threshold","for","merging","disks",".","radius_shrink_ratio","(","float",")",":","The","shrink","ratio","of","ordered","disks","radii",".","rescale_fields","(","list","[","str","]",",","optional",")",":","The","bbox\/polygon","field","names","to","be","rescaled",".","If","None",",","no","rescaling","will","be","performed","."]
code: def __init__(
      self,
      text_repr_type: str = "poly",
      min_text_region_confidence: float = 0.6,
      min_center_region_confidence: float = 0.2,
      min_center_area: int = 30,
      disk_overlap_thr: float = 0.03,
      radius_shrink_ratio: float = 1.03,
      rescale_fields: Sequence[str] = ["polygons"],
      **kwargs,
  ) -> None:
      super().__init__(
          text_repr_type=text_repr_type,
          rescale_fields=rescale_fields,
          **kwargs,
      )
      assert text_repr_type == "poly"
      self.min_text_region_confidence = min_text_region_confidence
      self.min_center_region_confidence = min_center_region_confidence
      self.min_center_area = min_center_area
      self.disk_overlap_thr = disk_overlap_thr
      self.radius_shrink_ratio = radius_shrink_ratio
  
file_path: mmocr/mmocr/models/textdet/postprocessors/textsnake_postprocessor.py
imports: from typing import List, Sequence
  import cv2
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from numpy.linalg import norm
  from skimage.morphology import skeletonize
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from mmocr.utils import fill_hole
  from .base import BaseTextDetPostProcessor
label_desc: Use image node_id 1 to create a new TextSnakePostprocessor object from inherited base classes: BaseTextDetPostProcessor with example: obj = TextSnakePostprocessor(text_repr_type, min_text_region_confidence, min_center_region_confidence, min_center_area, disk_overlap_thr, radius_shrink_ratio, rescale_fields)