code: def main(gt_path, img_root, args):
      os.makedirs(args.output, exist_ok=True)
      # init TableSystem
      text_sys = TableSystem(args)
      # load gt and preds html result
      gt_html_dict = load_txt(gt_path)
  
      ocr_result = load_result(os.path.join(args.output, "ocr.pickle"))
      structure_result = load_result(
          os.path.join(args.output, "structure.pickle")
      )
  
      pred_htmls = []
      gt_htmls = []
      for img_name, gt_html in tqdm(gt_html_dict.items()):
          img = cv2.imread(os.path.join(img_root, img_name))
          # run ocr and save result
          if img_name not in ocr_result:
              dt_boxes, rec_res, _, _ = text_sys._ocr(img)
              ocr_result[img_name] = [dt_boxes, rec_res]
              save_result(
                  os.path.join(args.output, "ocr.pickle"), ocr_result
              )
          # run structure and save result
          if img_name not in structure_result:
              structure_res, _ = text_sys._structure(img)
              structure_result[img_name] = structure_res
              save_result(
                  os.path.join(args.output, "structure.pickle"),
                  structure_result,
              )
          dt_boxes, rec_res = ocr_result[img_name]
          structure_res = structure_result[img_name]
          # match ocr and structure
          pred_html = text_sys.match(structure_res, dt_boxes, rec_res)
  
          pred_htmls.append(pred_html)
          gt_htmls.append(gt_html)
  
      # compute teds
      teds = TEDS(n_jobs=16)
      scores = teds.batch_evaluate_html(gt_htmls, pred_htmls)
      logger.info("teds: {}".format(sum(scores) / len(scores)))
  
file_path: PaddleOCR/ppstructure/table/eval_table.py
imports: import os
  import sys
  import cv2
  import pickle
  import paddle
  from tqdm import tqdm
  from ppstructure.table.table_metric import TEDS
  from ppstructure.table.predict_table import TableSystem
  from ppstructure.utility import init_args
  from ppocr.utils.logging import get_logger
label_desc: Use image node_id 5 for calling a global function with example usage: main(gt_path, img_root, args) without return types