docstr: Get the text box in the predicted images.
  Args:
      images (list(numpy.ndarray)): images data, shape of each is [H, W, C]. If images not paths
      paths (list[str]): The paths of images. If paths not images
      use_gpu (bool): Whether to use gpu. Default false.
      output_dir (str): The directory to store output images.
      visualization (bool): Whether to save image or not.
      box_thresh(float): the threshold of the detected text box's confidence
  Returns:
      res (list): The result of text detection box and save path of images.
docstr_tok: ["Get","the","text","box","in","the","predicted","images",".","Args",":","images","(","list","(","numpy.ndarray",")",")",":","images","data",",","shape","of","each","is","[","H",",","W",",","C","]",".","If","images","not","paths","paths","(","list","[","str","]",")",":","The","paths","of","images",".","If","paths","not","images","use_gpu","(","bool",")",":","Whether","to","use","gpu",".","Default","false",".","output_dir","(","str",")",":","The","directory","to","store","output","images",".","visualization","(","bool",")",":","Whether","to","save","image","or","not",".","box_thresh","(","float",")",":","the","threshold","of","the","detected","text","box","'s","confidence","Returns",":","res","(","list",")",":","The","result","of","text","detection","box","and","save","path","of","images","."]
code: def detect_text(
      self,
      images=[],
      paths=[],
      use_gpu=False,
      output_dir="detection_result",
      visualization=False,
      box_thresh=0.5,
  ):
      """
      Get the text box in the predicted images.
      Args:
          images (list(numpy.ndarray)): images data, shape of each is [H, W, C]. If images not paths
          paths (list[str]): The paths of images. If paths not images
          use_gpu (bool): Whether to use gpu. Default false.
          output_dir (str): The directory to store output images.
          visualization (bool): Whether to save image or not.
          box_thresh(float): the threshold of the detected text box's confidence
      Returns:
          res (list): The result of text detection box and save path of images.
      """
      self.check_requirements()
  
      from chinese_text_detection_db_server.processor import (
          DBPreProcess,
          DBPostProcess,
          draw_boxes,
          get_image_ext,
      )
  
      if use_gpu:
          try:
              _places = os.environ["CUDA_VISIBLE_DEVICES"]
              int(_places[0])
          except:
              raise RuntimeError(
                  "Environment Variable CUDA_VISIBLE_DEVICES is not set correctly. If you wanna use gpu, please set CUDA_VISIBLE_DEVICES via export CUDA_VISIBLE_DEVICES=cuda_device_id."
              )
  
      if images != [] and isinstance(images, list) and paths == []:
          predicted_data = images
      elif images == [] and isinstance(paths, list) and paths != []:
          predicted_data = self.read_images(paths)
      else:
          raise TypeError(
              "The input data is inconsistent with expectations."
          )
  
      assert (
          predicted_data != []
      ), "There is not any image to be predicted. Please check the input data."
  
      preprocessor = DBPreProcess()
      postprocessor = DBPostProcess(box_thresh)
  
      all_imgs = []
      all_ratios = []
      all_results = []
      for original_image in predicted_data:
          im, ratio_list = preprocessor(original_image)
          res = {"save_path": ""}
          if im is None:
              res["data"] = []
  
          else:
              im = im.copy()
              starttime = time.time()
              self.input_tensor.copy_from_cpu(im)
              self.predictor.run()
              data_out = self.output_tensors[0].copy_to_cpu()
              dt_boxes_list = postprocessor(data_out, [ratio_list])
              boxes = self.filter_tag_det_res(
                  dt_boxes_list[0], original_image.shape
              )
              res["data"] = boxes.astype(np.int64).tolist()
  
              all_imgs.append(im)
              all_ratios.append(ratio_list)
              if visualization:
                  img = Image.fromarray(
                      cv2.cvtColor(original_image, cv2.COLOR_BGR2RGB)
                  )
                  draw_img = draw_boxes(img, boxes)
                  draw_img = np.array(draw_img)
                  if not os.path.exists(output_dir):
                      os.makedirs(output_dir)
                  ext = get_image_ext(original_image)
                  saved_name = "ndarray_{}{}".format(time.time(), ext)
                  cv2.imwrite(
                      os.path.join(output_dir, saved_name),
                      draw_img[:, :, ::-1],
                  )
                  res["save_path"] = os.path.join(
                      output_dir, saved_name
                  )
  
          all_results.append(res)
  
      return all_results
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import ast
  import base64
  import math
  import os
  import time
  from io import BytesIO
  import cv2
  import numpy
  from paddle.inference import Config
  from paddle.inference import create_predictor
  from PIL import Image
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.module import runnable
  from paddlehub.module.module import serving
  from paddlehub.utils.log import logger
label_desc: Use image node_id 7 for calling the ChineseTextDetectionDBServer obj's underlying member method code with example usage: obj.detect_text(images, paths, use_gpu, output_dir, visualization, box_thresh) and returns: all_results