docstr: paddleocr package
  args:
      **kwargs: other params show in paddleocr --help
docstr_tok: ["paddleocr","package","args",":","*","*","kwargs",":","other","params","show","in","paddleocr","--","help"]
code: def __init__(self, **kwargs):
      """
      paddleocr package
      args:
          **kwargs: other params show in paddleocr --help
      """
      params = parse_args(mMain=False)
      params.__dict__.update(**kwargs)
      assert (
          params.ocr_version in SUPPORT_OCR_MODEL_VERSION
      ), "ocr_version must in {}, but get {}".format(
          SUPPORT_OCR_MODEL_VERSION, params.ocr_version
      )
      params.use_gpu = check_gpu(params.use_gpu)
  
      if not params.show_log:
          logger.setLevel(logging.INFO)
      self.use_angle_cls = params.use_angle_cls
      lang, det_lang = parse_lang(params.lang)
  
      # init model dir
      det_model_config = get_model_config(
          "OCR", params.ocr_version, "det", det_lang
      )
      params.det_model_dir, det_url = confirm_model_dir_url(
          params.det_model_dir,
          os.path.join(BASE_DIR, "whl", "det", det_lang),
          det_model_config["url"],
      )
      rec_model_config = get_model_config(
          "OCR", params.ocr_version, "rec", lang
      )
      params.rec_model_dir, rec_url = confirm_model_dir_url(
          params.rec_model_dir,
          os.path.join(BASE_DIR, "whl", "rec", lang),
          rec_model_config["url"],
      )
      cls_model_config = get_model_config(
          "OCR", params.ocr_version, "cls", "ch"
      )
      params.cls_model_dir, cls_url = confirm_model_dir_url(
          params.cls_model_dir,
          os.path.join(BASE_DIR, "whl", "cls"),
          cls_model_config["url"],
      )
      if params.ocr_version in ["PP-OCRv3", "PP-OCRv4"]:
          params.rec_image_shape = "3, 48, 320"
      else:
          params.rec_image_shape = "3, 32, 320"
      # download model if using paddle infer
      if not params.use_onnx:
          maybe_download(params.det_model_dir, det_url)
          maybe_download(params.rec_model_dir, rec_url)
          maybe_download(params.cls_model_dir, cls_url)
  
      if params.det_algorithm not in SUPPORT_DET_MODEL:
          logger.error(
              "det_algorithm must in {}".format(SUPPORT_DET_MODEL)
          )
          sys.exit(0)
      if params.rec_algorithm not in SUPPORT_REC_MODEL:
          logger.error(
              "rec_algorithm must in {}".format(SUPPORT_REC_MODEL)
          )
          sys.exit(0)
  
      if params.rec_char_dict_path is None:
          params.rec_char_dict_path = str(
              Path(__file__).parent / rec_model_config["dict_path"]
          )
  
      logger.debug(params)
      # init det_model and rec_model
      super().__init__(params)
      self.page_num = params.page_num
  
imports: import os
  import sys
  import importlib
  import paddle
  import cv2
  import logging
  import numpy
  from pathlib import Path
  import base64
  from io import BytesIO
  from PIL import Image
  from ppocr.utils.logging import get_logger
  from tools.infer import predict_system
  from ppocr.utils.utility import check_and_read, get_image_file_list, alpha_to_color, binarize_img
  from ppocr.utils.network import maybe_download, download_with_progressbar, is_link, confirm_model_dir_url
  from tools.infer.utility import draw_ocr, str2bool, check_gpu
  from ppstructure.utility import init_args, draw_structure_result
  from ppstructure.predict_system import StructureSystem, save_structure_res, to_excel
label_desc: Use image node_id 1 to create a new PaddleOCR object from inherited base classes: predict_system with example: obj = PaddleOCR()