code: def __init__(self, args):
      self.args = args
      self.e2e_algorithm = args.e2e_algorithm
      self.use_onnx = args.use_onnx
      pre_process_list = [
          {"E2EResizeForTest": {}},
          {
              "NormalizeImage": {
                  "std": [0.229, 0.224, 0.225],
                  "mean": [0.485, 0.456, 0.406],
                  "scale": "1./255.",
                  "order": "hwc",
              }
          },
          {"ToCHWImage": None},
          {"KeepKeys": {"keep_keys": ["image", "shape"]}},
      ]
      postprocess_params = {}
      if self.e2e_algorithm == "PGNet":
          pre_process_list[0] = {
              "E2EResizeForTest": {
                  "max_side_len": args.e2e_limit_side_len,
                  "valid_set": "totaltext",
              }
          }
          postprocess_params["name"] = "PGPostProcess"
          postprocess_params[
              "score_thresh"
          ] = args.e2e_pgnet_score_thresh
          postprocess_params[
              "character_dict_path"
          ] = args.e2e_char_dict_path
          postprocess_params["valid_set"] = args.e2e_pgnet_valid_set
          postprocess_params["mode"] = args.e2e_pgnet_mode
      else:
          logger.info(
              "unknown e2e_algorithm:{}".format(self.e2e_algorithm)
          )
          sys.exit(0)
  
      self.preprocess_op = create_operators(pre_process_list)
      self.postprocess_op = build_post_process(postprocess_params)
      (
          self.predictor,
          self.input_tensor,
          self.output_tensors,
          _,
      ) = utility.create_predictor(args, "e2e", logger)
  
file_path: PaddleOCR/tools/infer/predict_e2e.py
imports: import os
  import sys
  import cv2
  import numpy
  import time
  import sys
  import tools.infer.utility
  from ppocr.utils.logging import get_logger
  from ppocr.utils.utility import get_image_file_list, check_and_read
  from ppocr.data import create_operators, transform
  from ppocr.postprocess import build_post_process
label_desc: Use image node_id 1 to create a new TextE2E object from inherited base classes: object with example: obj = TextE2E(args)