code: def save_result_image(
      original_image,
      rec_results,
      output_dir="ocr_result",
      directory=None,
      lang="ch",
      det=True,
      rec=True,
      logger=None,
  ):
      image = Image.fromarray(
          cv2.cvtColor(original_image, cv2.COLOR_BGR2RGB)
      )
      if det and rec:
          boxes = [line[0] for line in rec_results]
          txts = [line[1][0] for line in rec_results]
          scores = [line[1][1] for line in rec_results]
          fonts_lang = "fonts/simfang.ttf"
          lang_fonts = {
              "korean": "korean",
              "fr": "french",
              "german": "german",
              "hi": "hindi",
              "ne": "nepali",
              "fa": "persian",
              "es": "spanish",
              "ta": "tamil",
              "te": "telugu",
              "ur": "urdu",
              "ug": "uyghur",
          }
          if lang in lang_fonts.keys():
              fonts_lang = "fonts/" + lang_fonts[lang] + ".ttf"
          font_file = os.path.join(directory, "assets", fonts_lang)
          im_show = draw_ocr(
              image, boxes, txts, scores, font_path=font_file
          )
      elif det and not rec:
          boxes = rec_results
          im_show = draw_boxes(image, boxes)
          im_show = np.array(im_show)
      else:
          logger.warning("only cls or rec not supported visualization.")
          return ""
  
      if not os.path.exists(output_dir):
          os.makedirs(output_dir)
  
      ext = get_image_ext(original_image)
      saved_name = "ndarray_{}{}".format(time.time(), ext)
      save_file_path = os.path.join(output_dir, saved_name)
      im_show = Image.fromarray(im_show)
      im_show.save(save_file_path)
      return save_file_path
  
file_path: PaddleHub/modules/image/text_recognition/multi_languages_ocr_db_crnn/utils.py
imports: import os
  import time
  import cv2
  import numpy
  from PIL import Image, ImageDraw
  from paddleocr import draw_ocr
label_desc: Use image node_id 1 for calling a global function with example usage: save_result_image(original_image, rec_results, output_dir, directory, lang, det, rec, logger) and returns: save_file_path, str