class_docstr: The post process for EAST.
class_docstr_tok: ["The","post","process","for","EAST","."]
docstr: restore text boxes from score map and geo map
docstr_tok: ["restore","text","boxes","from","score","map","and","geo","map"]
code: def detect(
      self,
      score_map,
      geo_map,
      score_thresh=0.8,
      cover_thresh=0.1,
      nms_thresh=0.2,
  ):
      """
      restore text boxes from score map and geo map
      """
  
      score_map = score_map[0]
      geo_map = np.swapaxes(geo_map, 1, 0)
      geo_map = np.swapaxes(geo_map, 1, 2)
      # filter the score map
      xy_text = np.argwhere(score_map > score_thresh)
      if len(xy_text) == 0:
          return []
      # sort the text boxes via the y axis
      xy_text = xy_text[np.argsort(xy_text[:, 0])]
      # restore quad proposals
      text_box_restored = self.restore_rectangle_quad(
          xy_text[:, ::-1] * 4, geo_map[xy_text[:, 0], xy_text[:, 1], :]
      )
      boxes = np.zeros(
          (text_box_restored.shape[0], 9), dtype=np.float32
      )
      boxes[:, :8] = text_box_restored.reshape((-1, 8))
      boxes[:, 8] = score_map[xy_text[:, 0], xy_text[:, 1]]
  
      try:
          check_install("lanms", "lanms-nova")
          import lanms
  
          boxes = lanms.merge_quadrangle_n9(boxes, nms_thresh)
      except:
          print(
              "You should install lanms by pip3 install lanms-nova to speed up nms_locality"
          )
          boxes = nms_locality(boxes.astype(np.float64), nms_thresh)
      if boxes.shape[0] == 0:
          return []
      # Here we filter some low score boxes by the average score map,
      #   this is different from the orginal paper.
      for i, box in enumerate(boxes):
          mask = np.zeros_like(score_map, dtype=np.uint8)
          cv2.fillPoly(
              mask, box[:8].reshape((-1, 4, 2)).astype(np.int32) // 4, 1
          )
          boxes[i, 8] = cv2.mean(score_map, mask)[0]
      boxes = boxes[boxes[:, 8] > cover_thresh]
      return boxes
  
file_path: PaddleOCR/ppocr/postprocess/east_postprocess.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from .locality_aware_nms import nms_locality
  import cv2
  import paddle
  import os
  from ppocr.utils.utility import check_install
  import sys
label_desc: Use image node_id 3 for calling the EASTPostProcess obj's underlying member method code with example usage: obj.detect(score_map, geo_map, score_thresh, cover_thresh, nms_thresh) and returns: boxes, list, list