|
--- |
|
license: mit |
|
language: |
|
- en |
|
base_model: |
|
- PP-OCRv5_mobile_det |
|
- PP-OCRv5_mobile_rec |
|
- PP-LCNet_x0_25_textline_ori |
|
pipeline_tag: text-classification |
|
tags: |
|
- OCR |
|
- paddle |
|
- PPOCRv5 |
|
--- |
|
|
|
# PPOCR_v5 |
|
|
|
This version of PPOCR_v5 has been converted to run on the Axera NPU using **w8a16** quantization. |
|
|
|
This model has been optimized with the following LoRA: |
|
|
|
Compatible with Pulsar2 version: 4.1-patch1 |
|
|
|
## Convert tools links: |
|
|
|
For those who are interested in model conversion, you can try to export axmodel through |
|
|
|
- [The repo of AXera Platform](https://github.com/AXERA-TECH/ax-samples), which you can get the detail of guide |
|
|
|
- [Pulsar2 Link, How to Convert ONNX to axmodel](https://pulsar2-docs.readthedocs.io/en/latest/pulsar2/introduction.html) |
|
|
|
|
|
## Support Platform |
|
|
|
- AX650 |
|
- [M4N-Dock(爱芯派Pro)](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html) |
|
- [M.2 Accelerator card](https://axcl-docs.readthedocs.io/zh-cn/latest/doc_guide_hardware.html) |
|
- AX630C |
|
- [爱芯派2](https://axera-pi-2-docs-cn.readthedocs.io/zh-cn/latest/index.html) |
|
- [Module-LLM](https://docs.m5stack.com/zh_CN/module/Module-LLM) |
|
- [LLM630 Compute Kit](https://docs.m5stack.com/zh_CN/core/LLM630%20Compute%20Kit) |
|
|
|
|Chips|model|cost| |
|
|--|--|--| |
|
||PP-OCRv5_mobile_det|28.6ms| |
|
|AX650|PP-OCRv5_mobile_rec|3.6ms| |
|
||PP-LCNet_x0_25_textline_ori|0.3ms| |
|
||PP-OCRv5_mobile_det|123.6ms| |
|
|AX630C|PP-OCRv5_mobile_rec|26.9ms| |
|
||PP-LCNet_x0_25_textline_ori|0.9ms| |
|
|
|
## How to use |
|
|
|
Download all files from this repository to the device |
|
|
|
``` |
|
|
|
root@ax650:~/PPOCR_v5# tree |
|
. |
|
|-- ax650 |
|
| `-- det.axmodel |
|
| `-- rec.axmodel |
|
| `-- cls.axmodel |
|
|-- infer_onnx.py |
|
|-- infer_axmodel.py |
|
|-- 11.jpg |
|
`-- res_onnx.jpg |
|
`-- res_ax.jpg |
|
``` |
|
|
|
### Inference |
|
|
|
Input image: |
|
 |
|
|
|
#### Inference with AX650 Host, such as M4N-Dock(爱芯派Pro) |
|
|
|
``` |
|
root@ax650:~/PPOCR_v5# python3 infer_axmodel.py |
|
[INFO] Available providers: ['AxEngineExecutionProvider'] |
|
[INFO] Using provider: AxEngineExecutionProvider |
|
[INFO] Chip type: ChipType.MC20E |
|
[INFO] VNPU type: VNPUType.DISABLED |
|
[INFO] Engine version: 2.7.2a |
|
[INFO] Model type: 0 (half core) |
|
[INFO] Compiler version: 4.1-patch1 da06dcf2 |
|
[INFO] Using provider: AxEngineExecutionProvider |
|
[INFO] Model type: 0 (half core) |
|
[INFO] Compiler version: 4.1-patch1 da06dcf2 |
|
[INFO] Using provider: AxEngineExecutionProvider |
|
[INFO] Model type: 0 (half core) |
|
[INFO] Compiler version: 4.1-patch1 da06dcf2 |
|
[[[22.0, 32.0], [307.0, 32.0], [307.0, 77.0], [22.0, 77.0]], ('纯臻营养护发素', 0.9575538635253906)] |
|
[[[24.0, 80.0], [174.0, 80.0], [174.0, 105.0], [24.0, 105.0]], ('产品信息/参数', 0.9784890413284302)] |
|
[[[24.0, 110.0], [333.0, 110.0], [333.0, 135.0], [24.0, 135.0]], ('(45元/每公斤,10公斤起订', 0.8767529129981995)] |
|
[[[24.0, 140.0], [284.0, 142.0], [284.0, 167.0], [24.0, 165.0]], ('每瓶2元,100瓶起订)', 0.7741350531578064)] |
|
[[[23.0, 175.0], [301.0, 174.0], [302.0, 197.0], [24.0, 198.0]], ('品牌:代加工方式/OEMDM', 0.8872110247612)] |
|
[[[24.0, 207.0], [235.0, 207.0], [235.0, 228.0], [24.0, 228.0]], ('品名:纯臻营养护发素', 0.930849552154541)] |
|
[[[26.0, 238.0], [242.0, 238.0], [242.0, 259.0], [26.0, 259.0]], ('产品编号:YM-×-301', 0.8895746469497681)] |
|
[[[412.0, 233.0], [430.0, 233.0], [430.0, 304.0], [412.0, 304.0]], ('DMEM', 0.9372888207435608)] |
|
[[[24.0, 268.0], [181.0, 267.0], [181.0, 290.0], [25.0, 291.0]], ('【净含量:220ml', 0.7948297262191772)] |
|
[[[24.0, 301.0], [253.0, 301.0], [253.0, 322.0], [24.0, 322.0]], ('适用人群:适合所有肤质', 0.946412980556488)] |
|
[[[24.0, 331.0], [345.0, 332.0], [345.0, 354.0], [24.0, 353.0]], ('主要成分:鲸蜡硬脂醇、燕麦β-葡聚', 0.9448550939559937)] |
|
[[[26.0, 364.0], [283.0, 364.0], [283.0, 385.0], [26.0, 385.0]], ('糖、椰油酰胺丙菜碱、泛', 0.9831148386001587)] |
|
[[[367.0, 367.0], [476.0, 367.0], [476.0, 389.0], [367.0, 389.0]], ('((成品包材)', 0.6778985261917114)] |
|
[[[26.0, 394.0], [362.0, 394.0], [362.0, 416.0], [26.0, 416.0]], ('【主要功能:可紧致头发磷层,从而达到', 0.9124352931976318)] |
|
[[[26.0, 426.0], [373.0, 425.0], [373.0, 446.0], [26.0, 447.0]], ('即时持久改善头发光泽的效果,给干燥的头', 0.9655891060829163)] |
|
[[[25.0, 457.0], [137.0, 456.0], [137.0, 478.0], [26.0, 479.0]], ('发足够的滋养', 0.9937723278999329)] |
|
|
|
``` |
|
|
|
Output image: |
|
 |