class_docstr: The post process for Differentiable Binarization (DB).
class_docstr_tok: ["The","post","process","for","Differentiable","Binarization","(","DB",")","."]
code: def __init__(
      self,
      thresh=0.3,
      box_thresh=0.7,
      max_candidates=1000,
      unclip_ratio=2.0,
      use_dilation=False,
      score_mode="fast",
      **kwargs,
  ):
      self.thresh = thresh
      self.box_thresh = box_thresh
      self.max_candidates = max_candidates
      self.unclip_ratio = unclip_ratio
      self.min_size = 3
      self.score_mode = score_mode
      assert score_mode in [
          "slow",
          "fast",
      ], "Score mode must be in [slow, fast] but got: {}".format(
          score_mode
      )
  
      self.dilation_kernel = (
          None if not use_dilation else np.array([[1, 1], [1, 1]])
      )
  
imports: import numpy
  import paddle
  from paddle.nn import functional
  import re
  from shapely.geometry import Polygon
  import cv2
  import copy
label_desc: Use image node_id 1 to create a new DBPostProcess object from inherited base classes: object with example: obj = DBPostProcess(thresh, box_thresh, max_candidates, unclip_ratio, use_dilation, score_mode)