code: def load_icdar2015_gt(dataFolder, isTraing=False):
      if isTraing:
          img_folderName = "ch4_training_images"
          gt_folderName = "ch4_training_localization_transcription_gt"
      else:
          img_folderName = "ch4_test_images"
          gt_folderName = "ch4_test_localization_transcription_gt"
  
      gt_folder_path = os.listdir(
          os.path.join(dataFolder, gt_folderName)
      )
      total_imgs_bboxes = []
      total_img_path = []
      for gt_path in gt_folder_path:
          gt_path = os.path.join(
              os.path.join(dataFolder, gt_folderName), gt_path
          )
          img_path = (
              gt_path.replace(gt_folderName, img_folderName)
              .replace(".txt", ".jpg")
              .replace("gt_", "")
          )
          image = cv2.imread(img_path)
          lines = open(gt_path, encoding="utf-8").readlines()
          single_img_bboxes = []
          for line in lines:
              box_info_dict = {
                  "points": None,
                  "text": None,
                  "ignore": None,
              }
  
              box_info = (
                  line.strip()
                  .encode("utf-8")
                  .decode("utf-8-sig")
                  .split(",")
              )
              box_points = [int(box_info[j]) for j in range(8)]
              word = box_info[8:]
              word = ",".join(word)
              box_points = np.array(box_points, np.int32).reshape(4, 2)
              cv2.polylines(
                  image,
                  [np.array(box_points).astype(np.int)],
                  True,
                  (0, 0, 255),
                  1,
              )
              box_info_dict["points"] = box_points
              box_info_dict["text"] = word
              if word == "###":
                  box_info_dict["ignore"] = True
              else:
                  box_info_dict["ignore"] = False
  
              single_img_bboxes.append(box_info_dict)
          total_imgs_bboxes.append(single_img_bboxes)
          total_img_path.append(img_path)
      return total_imgs_bboxes, total_img_path
  
imports: import os
  import re
  import itertools
  import cv2
  import time
  import numpy
  import torch
  from torch.autograd import Variable
  from utils.craft_utils import getDetBoxes, adjustResultCoordinates
  from data import imgproc
  from data.dataset import SynthTextDataSet
  import math
  import xml.etree.ElementTree
label_desc: Use image node_id 7 for calling a global function with example usage: load_icdar2015_gt(dataFolder, isTraing) and returns: total_imgs_bboxes,  total_img_path