class_docstr: The post process for Differentiable Binarization (DB).
class_docstr_tok: ["The","post","process","for","Differentiable","Binarization","(","DB",")","."]
code: def __call__(self, outs_dict, ratio_list):
      pred = outs_dict["maps"]
  
      pred = pred[:, 0, :, :]
      segmentation = pred > self.thresh
  
      boxes_batch = []
      for batch_index in range(pred.shape[0]):
          height, width = pred.shape[-2:]
  
          mask = cv2.dilate(
              np.array(segmentation[batch_index]).astype(np.uint8),
              self.dilation_kernel,
          )
          tmp_boxes, tmp_scores = self.boxes_from_bitmap(
              pred[batch_index], mask, width, height
          )
  
          boxes = []
          for k in range(len(tmp_boxes)):
              if tmp_scores[k] > self.box_thresh:
                  boxes.append(tmp_boxes[k])
          if len(boxes) > 0:
              boxes = np.array(boxes)
  
              ratio_h, ratio_w = ratio_list[batch_index]
              boxes[:, :, 0] = boxes[:, :, 0] / ratio_w
              boxes[:, :, 1] = boxes[:, :, 1] / ratio_h
  
          boxes_batch.append(boxes)
      return boxes_batch
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
  import cv2
  import numpy
  import pyclipper
  from PIL import ImageDraw
  from shapely.geometry import Polygon
label_desc: Use image node_id 6 for calling the DBPostProcess obj's underlying member method code with example usage: obj.__call__(outs_dict, ratio_list) and returns: boxes_batch