class_docstr: The post process for Differentiable Binarization (DB).
class_docstr_tok: ["The","post","process","for","Differentiable","Binarization","(","DB",")","."]
code: def get_mini_boxes(self, contour):
      bounding_box = cv2.minAreaRect(contour)
      points = sorted(
          list(cv2.boxPoints(bounding_box)), key=lambda x: x[0]
      )
  
      index_1, index_2, index_3, index_4 = 0, 1, 2, 3
      if points[1][1] > points[0][1]:
          index_1 = 0
          index_4 = 1
      else:
          index_1 = 1
          index_4 = 0
      if points[3][1] > points[2][1]:
          index_2 = 2
          index_3 = 3
      else:
          index_2 = 3
          index_3 = 2
  
      box = [
          points[index_1],
          points[index_2],
          points[index_3],
          points[index_4],
      ]
      return box, min(bounding_box[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 4 for calling the DBPostProcess obj's underlying member method code with example usage: obj.get_mini_boxes(contour) and returns: box,  min