## paddleocr_convert
<p>
<a href="https://huggingface.co/spaces/SWHL/PaddleOCRModelConverter" target="_blank"><img src="https://img.shields.io/badge/%F0%9F%A4%97-Online Convert-blue"></a>
<a href="https://www.modelscope.cn/studios/liekkas/PaddleOCRModelConverter/summary" target="_blank"><img src="https://img.shields.io/badge/ModelScope-Online Convert -blue"></a>
<a href=""><img src="https://img.shields.io/badge/Python->=3.7,<=3.10-aff.svg"></a>
<a href=""><img src="https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg"></a>
<a href="https://pypi.org/project/paddleocr_convert/"><img alt="PyPI" src="https://img.shields.io/pypi/v/paddleocr_convert"></a>
<a href="https://pepy.tech/project/paddleocr_convert"><img src="https://static.pepy.tech/personalized-badge/paddleocr_convert?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=Downloads"></a>
<a href="http://rapidai-team.com/PaddleOCRModelConverter/paddleocr_convert.html"><img height="20" alt="paddleocr_convert documentation" src="https://shields.mitmproxy.org/badge/API Docs-paddocr_convert-brightgreen.svg"></a>
</p>
### 1. Install package by pypi.
```bash
pip install paddleocr_convert
```
### 2. Run by command line.
- Usage:
```bash
$ 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:
```bash
# 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
```python
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
```python
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](https://github.com/RapidAI/PaddleOCRModelConvert).
Raw data
{
"_id": null,
"home_page": "https://github.com/RapidAI/PaddleOCRModelConvert",
"name": "paddleocr-convert",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.6",
"maintainer_email": null,
"keywords": "ocr, text_detection, text_recognition, db, onnxruntime, paddleocr, openvino, rapidocr",
"author": "SWHL",
"author_email": "liekkaskono@163.com",
"download_url": "https://github.com/RapidAI/PaddleOCRModelConvert.git",
"platform": "Any",
"description": "## paddleocr_convert\n<p>\n <a href=\"https://huggingface.co/spaces/SWHL/PaddleOCRModelConverter\" target=\"_blank\"><img src=\"https://img.shields.io/badge/%F0%9F%A4%97-Online Convert-blue\"></a>\n <a href=\"https://www.modelscope.cn/studios/liekkas/PaddleOCRModelConverter/summary\" target=\"_blank\"><img src=\"https://img.shields.io/badge/ModelScope-Online Convert -blue\"></a>\n <a href=\"\"><img src=\"https://img.shields.io/badge/Python->=3.7,<=3.10-aff.svg\"></a>\n <a href=\"\"><img src=\"https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg\"></a>\n <a href=\"https://pypi.org/project/paddleocr_convert/\"><img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/paddleocr_convert\"></a>\n <a href=\"https://pepy.tech/project/paddleocr_convert\"><img src=\"https://static.pepy.tech/personalized-badge/paddleocr_convert?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=Downloads\"></a>\n <a href=\"http://rapidai-team.com/PaddleOCRModelConverter/paddleocr_convert.html\"><img height=\"20\" alt=\"paddleocr_convert documentation\" src=\"https://shields.mitmproxy.org/badge/API Docs-paddocr_convert-brightgreen.svg\"></a>\n</p>\n\n### 1. Install package by pypi.\n```bash\npip install paddleocr_convert\n```\n\n### 2. Run by command line.\n- Usage:\n ```bash\n $ paddleocr_convert -h\n usage: paddleocr_convert [-h] [-p MODEL_PATH] [-o SAVE_DIR]\n [-txt_path TXT_PATH]\n\n optional arguments:\n -h, --help show this help message and exit\n -p MODEL_PATH, --model_path MODEL_PATH\n The inference model url or local path of paddleocr.\n e.g. https://paddleocr.bj.bcebos.com/PP-\n OCRv3/chinese/ch_PP-OCRv3_det_infer.tar or\n models/ch_PP-OCRv3_det_infer.tar\n -o SAVE_DIR, --save_dir SAVE_DIR\n The directory of saving the model.\n -txt_path TXT_PATH, --txt_path TXT_PATH\n The raw txt url or local txt path, if the model is\n recognition model.\n ```\n- Example:\n ```bash\n # online\n $ paddleocr_convert -p https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar \\\n -o models\n\n $ paddleocr_convert -p https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar \\\n -o models \\\n -txt_path https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.6/ppocr/utils/ppocr_keys_v1.txt\n\n # offline\n $ paddleocr_convert -p models/ch_PP-OCRv3_det_infer.tar \\\n -o models\n\n $ paddleocr_convert -p models/ch_PP-OCRv3_rec_infer.tar \\\n -o models \\\n -txt_path models/ppocr_keys_v1.txt\n ```\n\n### 3. Run by script.\n- online mode\n ```python\n from paddleocr_convert import PaddleOCRModelConvert\n\n converter = PaddleOCRModelConvert()\n\n save_dir = 'models'\n url = 'https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar'\n txt_url = 'https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.6/ppocr/utils/ppocr_keys_v1.txt'\n\n converter(url, save_dir, txt_path=txt_url)\n ```\n- offline mode\n ```python\n from paddleocr_convert import PaddleOCRModelConvert\n\n converter = PaddleOCRModelConvert()\n\n save_dir = 'models'\n model_path = 'models/ch_PP-OCRv3_rec_infer.tar'\n txt_path = 'models/ppocr_keys_v1.txt'\n converter(model_path, save_dir, txt_path=txt_path)\n ```\n\n### See more details for [PaddleOCRModelConvert](https://github.com/RapidAI/PaddleOCRModelConvert).\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Tool for converting the PaddleOCR model to onnx format.",
"version": "0.0.19",
"project_urls": {
"Download": "https://github.com/RapidAI/PaddleOCRModelConvert.git",
"Homepage": "https://github.com/RapidAI/PaddleOCRModelConvert"
},
"split_keywords": [
"ocr",
" text_detection",
" text_recognition",
" db",
" onnxruntime",
" paddleocr",
" openvino",
" rapidocr"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2cc5568d1f1f86446e1b19a2139cf64daacf866b0d4bec689ddf6dfb845f43e5",
"md5": "1f453a00f0494388fd3d12d96f8f5a40",
"sha256": "79b16b99c4a85c0ed6dd7937f93a99f36dba0c46235601e79ba6b9c57ef97095"
},
"downloads": -1,
"filename": "paddleocr_convert-0.0.19-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1f453a00f0494388fd3d12d96f8f5a40",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.6",
"size": 11223,
"upload_time": "2024-08-28T14:12:26",
"upload_time_iso_8601": "2024-08-28T14:12:26.062944Z",
"url": "https://files.pythonhosted.org/packages/2c/c5/568d1f1f86446e1b19a2139cf64daacf866b0d4bec689ddf6dfb845f43e5/paddleocr_convert-0.0.19-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-28 14:12:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "RapidAI",
"github_project": "PaddleOCRModelConvert",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "paddleocr-convert"
}