code: def draw_det_res(dt_boxes, config, img, img_name, save_path):
      import cv2
  
      src_im = img
      for box in dt_boxes:
          box = np.array(box).astype(np.int32).reshape((-1, 1, 2))
          cv2.polylines(
              src_im, [box], True, color=(255, 255, 0), thickness=2
          )
      if not os.path.exists(save_path):
          os.makedirs(save_path)
      save_path = os.path.join(save_path, os.path.basename(img_name))
      cv2.imwrite(save_path, src_im)
      logger.info("The detected Image saved in {}".format(save_path))
  
file_path: PaddleOCR/tools/infer_det.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import os
  import sys
  import cv2
  import json
  import paddle
  from ppocr.data import create_operators, transform
  from ppocr.modeling.architectures import build_model
  from ppocr.postprocess import build_post_process
  from ppocr.utils.save_load import load_model
  from ppocr.utils.utility import get_image_file_list
  import tools.program
label_desc: Use image node_id 1 for calling a global function with example usage: draw_det_res(dt_boxes, config, img, img_name, save_path) without return types