PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
43.01k stars 7.72k forks source link

Android PP-OCRv3 #12662

Open Alexng2024 opened 4 months ago

Alexng2024 commented 4 months ago

问题描述 / Problem Description

我用 paddle-lite 转了 3 个 .nb 档 想转用 pp-OCRv3 load model 可以 但一执行辨识时就会死机 想请问是否未能支援 我想在 Android 上跑

运行环境 / Runtime Environment

复现代码 / Reproduction Code

完整报错 / Complete Error Message

可能解决方案 / Possible solutions

附件 / Appendix

xiaoshanlin000 commented 4 months ago

下载和paddle lite 库一致的opt工具, 然后使用opt工具优化推理模型, 生成.nb文件. 这是我用的参数 --optimize_out_type=naive_buffer --valid_targets=arm -quant_type=QUANT_INT8

Alexng2024 commented 4 months ago

import paddlelite.lite as lite

a=lite.Opt() a.set_model_dir("D:\ch_ppocr_mobile_v2.0_cls_infer\")

conmbined 形式,具体模型和参数名称,请根据实际修改

a.set_model_file("D:\inference.pdmodel") a.set_param_file("D:\inference.pdiparams")

a.set_valid_places("arm") a.set_model_type("naive_buffer")

a.set_optimize_out("ch_PP-OCRv3_cls_out")

a.set_valid_places("x86")

a.run()

我这样用 python 产生的 可 load model 就是辨识时 死app