class_docstr: Decoding predictions of DbNet to instances. This is partially adapted
  from https://github.com/MhLiao/DB.
  
  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'].
      mask_thr (float): The mask threshold value for binarization. Defaults
          to 0.3.
      min_text_score (float): The threshold value for converting binary map
          to shrink text regions. Defaults to 0.3.
      min_text_width (int): The minimum width of boundary polygon/box
          predicted. Defaults to 5.
      unclip_ratio (float): The unclip ratio for text regions dilation.
          Defaults to 1.5.
      epsilon_ratio (float): The epsilon ratio for approximation accuracy.
          Defaults to 0.01.
      max_candidates (int): The maximum candidate number. Defaults to 3000.
class_docstr_tok: ["Decoding","predictions","of","DbNet","to","instances",".","This","is","partially","adapted","from","https",":","\/\/github.com\/MhLiao\/DB",".","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","'","]",".","mask_thr","(","float",")",":","The","mask","threshold","value","for","binarization",".","Defaults","to","0.3.","min_text_score","(","float",")",":","The","threshold","value","for","converting","binary","map","to","shrink","text","regions",".","Defaults","to","0.3.","min_text_width","(","int",")",":","The","minimum","width","of","boundary","polygon\/box","predicted",".","Defaults","to","5.","unclip_ratio","(","float",")",":","The","unclip","ratio","for","text","regions","dilation",".","Defaults","to","1.5.","epsilon_ratio","(","float",")",":","The","epsilon","ratio","for","approximation","accuracy",".","Defaults","to","0.01.","max_candidates","(","int",")",":","The","maximum","candidate","number",".","Defaults","to","3000","."]
docstr: Unclip a polygon.
  
  Args:
      poly_pts (np.ndarray): The polygon points.
  
  Returns:
      np.ndarray: The expanded polygon points.
docstr_tok: ["Unclip","a","polygon",".","Args",":","poly_pts","(","np.ndarray",")",":","The","polygon","points",".","Returns",":","np.ndarray",":","The","expanded","polygon","points","."]
code: def _unclip(self, poly_pts: np.ndarray) -> np.ndarray:
      """Unclip a polygon.
  
      Args:
          poly_pts (np.ndarray): The polygon points.
  
      Returns:
          np.ndarray: The expanded polygon points.
      """
      poly = Polygon(poly_pts)
      distance = poly.area * self.unclip_ratio / poly.length
      return offset_polygon(poly_pts, distance)
  
file_path: mmocr/mmocr/models/textdet/postprocessors/db_postprocessor.py
imports: from typing import Sequence
  import cv2
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from shapely.geometry import Polygon
  from torch import Tensor
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from mmocr.utils import offset_polygon
  from .base import BaseTextDetPostProcessor
label_desc: Use image node_id 4 for calling the DBPostprocessor obj's underlying member method code with example usage: obj._unclip(poly_pts) and returns: offset_polygon