code: def batch_synth_images():
      image_synthesiser = ImageSynthesiser()
  
      corpus_file = (
          "../StyleTextRec_data/test_20201208/test_text_list.txt"
      )
      style_data_dir = (
          "../StyleTextRec_data/test_20201208/style_images/"
      )
      save_path = "./output_data/"
      corpus_list = []
      with open(corpus_file, "rb") as fin:
          lines = fin.readlines()
          for line in lines:
              substr = line.decode("utf-8").strip("\n").split("\t")
              corpus_list.append(substr)
      style_img_list = glob.glob("{}/*.jpg".format(style_data_dir))
      corpus_num = len(corpus_list)
      style_img_num = len(style_img_list)
      for cno in range(corpus_num):
          for sno in range(style_img_num):
              corpus, lang = corpus_list[cno]
              style_img_path = style_img_list[sno]
              img = cv2.imread(style_img_path)
              synth_result = image_synthesiser.synth_image(
                  corpus, img, lang
              )
              fake_fusion = synth_result["fake_fusion"]
              fake_text = synth_result["fake_text"]
              fake_bg = synth_result["fake_bg"]
              for tp in range(2):
                  if tp == 0:
                      prefix = "%s/c%d_s%d_" % (save_path, cno, sno)
                  else:
                      prefix = "%s/s%d_c%d_" % (save_path, sno, cno)
                  cv2.imwrite(
                      "%s_fake_fusion.jpg" % prefix, fake_fusion
                  )
                  cv2.imwrite("%s_fake_text.jpg" % prefix, fake_text)
                  cv2.imwrite("%s_fake_bg.jpg" % prefix, fake_bg)
                  cv2.imwrite("%s_input_style.jpg" % prefix, img)
              print(cno, corpus_num, sno, style_img_num)
  
file_path: PaddleOCR/StyleText/tools/synth_image.py
imports: import os
  import cv2
  import sys
  import glob
  from utils.config import ArgsParser
  from engine.synthesisers import ImageSynthesiser
label_desc: Use image node_id 2 for calling a global function with example usage: batch_synth_images() without return types