Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

paddleocr-convert

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paddleocr-convert

Tool for converting the PaddleOCR model to onnx format.

  • 0.0.19
  • PyPI
  • Socket score

Maintainers
1

paddleocr_convert

PyPI paddleocr_convert documentation

1. Install package by pypi.

pip install paddleocr_convert

2. Run by command line.

  • Usage:
    $ paddleocr_convert -h
    usage: paddleocr_convert [-h] [-p MODEL_PATH] [-o SAVE_DIR]
                            [-txt_path TXT_PATH]
    
    optional arguments:
    -h, --help            show this help message and exit
    -p MODEL_PATH, --model_path MODEL_PATH
                            The inference model url or local path of paddleocr.
                            e.g. https://paddleocr.bj.bcebos.com/PP-
                            OCRv3/chinese/ch_PP-OCRv3_det_infer.tar or
                            models/ch_PP-OCRv3_det_infer.tar
    -o SAVE_DIR, --save_dir SAVE_DIR
                            The directory of saving the model.
    -txt_path TXT_PATH, --txt_path TXT_PATH
                            The raw txt url or local txt path, if the model is
                            recognition model.
    
  • Example:
    # online
    $ paddleocr_convert -p https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar \
                        -o models
    
    $ paddleocr_convert -p https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar \
                        -o models \
                        -txt_path https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.6/ppocr/utils/ppocr_keys_v1.txt
    
    # offline
    $ paddleocr_convert -p models/ch_PP-OCRv3_det_infer.tar \
                        -o models
    
    $ paddleocr_convert -p models/ch_PP-OCRv3_rec_infer.tar \
                        -o models \
                        -txt_path models/ppocr_keys_v1.txt
    

3. Run by script.

  • online mode
    from paddleocr_convert import PaddleOCRModelConvert
    
    converter = PaddleOCRModelConvert()
    
    save_dir = 'models'
    url = 'https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar'
    txt_url = 'https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.6/ppocr/utils/ppocr_keys_v1.txt'
    
    converter(url, save_dir, txt_path=txt_url)
    
  • offline mode
    from paddleocr_convert import PaddleOCRModelConvert
    
    converter = PaddleOCRModelConvert()
    
    save_dir = 'models'
    model_path = 'models/ch_PP-OCRv3_rec_infer.tar'
    txt_path = 'models/ppocr_keys_v1.txt'
    converter(model_path, save_dir, txt_path=txt_path)
    

See more details for PaddleOCRModelConvert.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc