Skip to main content

Tool for converting the PaddleOCR model to onnx format.

Project description

paddleocr_convert

PyPI

1. Install package by pypi.

pip install paddleocr_convert

2. Run by command line.

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

3. Run by script.

from paddleocr_convert import PaddleOCRModelConvert

converter = PaddleOCRModelConvert()

url = 'https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar'

save_dir = 'models'
txt_url = 'https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.6/ppocr/utils/ppocr_keys_v1.txt'

converter(url, save_dir, txt_url=txt_url)

See more details for README.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

paddleocr_convert-0.0.4-py3-none-any.whl (10.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page