Replies: 7 comments 5 replies
-
好的,我尝试下感谢发自我的 iPhone在 2025年1月2日,12:05,Wang Xin ***@***.***> 写道:
是的,PaddleOCR 支持在 CentOS 服务器上离线部署和使用。根据提供的文档,您可以选择以下两种部署方式:
1. 基于 PaddleHub Serving 的部署
这种方式相对简单,适合快速搭建服务。您可以参考 ./deploy/hubserving 路径下的相关代码和文档。
2. 基于 PaddleServing 的部署
PaddleServing 提供了更高效的部署能力,适合工业级应用。以下是离线部署的具体步骤:
(1)环境准备
需要在 CentOS 上安装 PaddleOCR 和 PaddleServing 的运行环境:
# 克隆 PaddleOCR 项目
git clone https://github.com/PaddlePaddle/PaddleOCR
cd PaddleOCR/deploy/pdserving/
# 安装 PaddleServing 服务端和客户端
wget https://paddle-serving.bj.bcebos.com/test-dev/whl/paddle_serving_server_gpu-0.8.3.post102-py3-none-any.whl
pip3 install paddle_serving_server_gpu-0.8.3.post102-py3-none-any.whl
wget https://paddle-serving.bj.bcebos.com/test-dev/whl/paddle_serving_client-0.8.3-cp37-none-any.whl
pip3 install paddle_serving_client-0.8.3-cp37-none-any.whl
wget https://paddle-serving.bj.bcebos.com/test-dev/whl/paddle_serving_app-0.8.3-py3-none-any.whl
pip3 install paddle_serving_app-0.8.3-py3-none-any.whl
(2)模型转换
将下载的 inference 模型转换为易于部署的 Serving 格式:
# 转换文本检测模型
python3 -m paddle_serving_client.convert --dirname ./ch_PP-OCRv3_det_infer/ \
--model_filename inference.pdmodel \
--params_filename inference.pdiparams \
--serving_server ./ppocr_det_v3_serving/ \
--serving_client ./ppocr_det_v3_client/
# 转换文本识别模型
python3 -m paddle_serving_client.convert --dirname ./ch_PP-OCRv3_rec_infer/ \
--model_filename inference.pdmodel \
--params_filename inference.pdiparams \
--serving_server ./ppocr_rec_v3_serving/ \
--serving_client ./ppocr_rec_v3_client/
(3)启动服务
在服务器上运行以下命令启动服务:
# 启动服务
python3 web_service.py --config=config.yml &>log.txt &
(4)发送预测请求
通过客户端脚本发送预测请求:
python3 pipeline_http_client.py
(5)优化性能
可以通过调整 config.yml 文件中的并发数来优化性能。
其他注意事项
离线环境支持:所有依赖包和模型文件可以提前下载并打包到离线环境中。
性能优势:PaddleServing 提供了高效的 C++ 部署选项,适合对性能要求更高的场景。
如果需要更详细的步骤,您可以参考文档中的 PaddleServing 部署教程。
Response generated by feifei-bot | chatgpt-4o-latest
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
构建docker镜像时第三步报错
Step 3/15 : RUN pip3.7 install paddlehub --upgrade -i https://mirror.baidu.com/pypi/simple
---> Running in 270b55336eeb
Looking in indexes: https://mirror.baidu.com/pypi/simple
Collecting paddlehub
Could not find a version that satisfies the requirement paddlehub (from versions: )
No matching distribution found for paddlehub
The command '/bin/sh -c pip3.7 install paddlehub --upgrade -i https://mirror.baidu.com/pypi/simple' returned a non-zero code: 1
麻烦问下知道是什么问题导致的吗,是需要替换pypi源吗
… 2025年1月2日 12:07,Wang Xin ***@***.***> 写道:
可以
—
Reply to this email directly, view it on GitHub <#14478 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AVM3XMKWCU3WFUHCVGANX332IS3OTAVCNFSM6AAAAABUPJGG4OVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNZRGM4DCNA>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
最好不要用paddlehub、PaddleServing ,刚是机器人回复的。 |
Beta Was this translation helpful? Give feedback.
-
你的离线部署和使用指的是?最简单的方法是使用python api,下载好对应的权重,就能本地使用了。具体请参考 https://paddlepaddle.github.io/PaddleOCR/latest/quick_start.html |
Beta Was this translation helpful? Give feedback.
-
那就是目前离线部署仅支持‘基于 PaddleServing 的部署’ 是吗
… 2025年1月2日 14:11,Wang Xin ***@***.***> 写道:
最好不要用paddlehub,刚是机器人回复的。
—
Reply to this email directly, view it on GitHub <#14478 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AVM3XMPA2QLB6JWKUTNXGVT2ITKCFAVCNFSM6AAAAABUPJGG4OVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNZRGQYTONQ>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
paddleocr --image_dir /root/test.png --det false --lang en
[2025/01/02 17:10:52] ppocr INFO: for usage help, please use `paddleocr --help`
[2025/01/02 17:10:52] ppocr DEBUG: Namespace(help='==SUPPRESS==', use_gpu=False, use_xpu=False, use_npu=False, use_mlu=False, ir_optim=True, use_tensorrt=False, min_subgraph_size=15, precision='fp32', gpu_mem=500, gpu_id=0, image_dir='/root/test.png', page_num=0, det_algorithm='DB', det_model_dir='/root/.paddleocr/whl/det/en/en_PP-OCRv3_det_infer', det_limit_side_len=960, det_limit_type='max', det_box_type='quad', det_db_thresh=0.3, det_db_box_thresh=0.6, det_db_unclip_ratio=1.5, max_batch_size=10, use_dilation=False, det_db_score_mode='fast', det_east_score_thresh=0.8, det_east_cover_thresh=0.1, det_east_nms_thresh=0.2, det_sast_score_thresh=0.5, det_sast_nms_thresh=0.2, det_pse_thresh=0, det_pse_box_thresh=0.85, det_pse_min_area=16, det_pse_scale=1, scales=[8, 16, 32], alpha=1.0, beta=1.0, fourier_degree=5, rec_algorithm='SVTR_LCNet', rec_model_dir='/root/.paddleocr/whl/rec/en/en_PP-OCRv4_rec_infer', rec_image_inverse=True, rec_image_shape='3, 48, 320', rec_batch_num=6, max_text_length=25, rec_char_dict_path='/usr/local/python/lib/python3.10/site-packages/paddleocr/ppocr/utils/en_dict.txt', use_space_char=True, vis_font_path='./doc/fonts/simfang.ttf', drop_score=0.5, e2e_algorithm='PGNet', e2e_model_dir=None, e2e_limit_side_len=768, e2e_limit_type='max', e2e_pgnet_score_thresh=0.5, e2e_char_dict_path='./ppocr/utils/ic15_dict.txt', e2e_pgnet_valid_set='totaltext', e2e_pgnet_mode='fast', use_angle_cls=False, cls_model_dir='/root/.paddleocr/whl/cls/ch_ppocr_mobile_v2.0_cls_infer', cls_image_shape='3, 48, 192', label_list=['0', '180'], cls_batch_num=6, cls_thresh=0.9, enable_mkldnn=False, cpu_threads=10, use_pdserving=False, warmup=False, sr_model_dir=None, sr_image_shape='3, 32, 128', sr_batch_num=1, draw_img_save_dir='./inference_results', save_crop_res=False, crop_res_save_dir='./output', use_mp=False, total_process_num=1, process_id=0, benchmark=False, save_log_path='./log_output/', show_log=True, use_onnx=False, return_word_box=False, output='./output', table_max_len=488, table_algorithm='TableAttn', table_model_dir=None, merge_no_span_structure=True, table_char_dict_path=None, formula_algorithm='LaTeXOCR', formula_model_dir=None, formula_char_dict_path=None, formula_batch_num=1, layout_model_dir=None, layout_dict_path=None, layout_score_threshold=0.5, layout_nms_threshold=0.5, kie_algorithm='LayoutXLM', ser_model_dir=None, re_model_dir=None, use_visual_backbone=True, ser_dict_path='../train_data/XFUND/class_list_xfun.txt', ocr_order_method=None, mode='structure', image_orientation=False, layout=True, table=True, formula=False, ocr=True, recovery=False, recovery_to_markdown=False, use_pdf2docx_api=False, invert=False, binarize=False, alphacolor=(255, 255, 255), lang='en', det=False, rec=True, type='ocr', savefile=False, ocr_version='PP-OCRv4', structure_version='PP-StructureV2')
[2025/01/02 17:10:54] ppocr INFO: **********/root/test.png**********
[2025/01/02 17:10:54] ppocr INFO: ('', 0.0)
***@***.*** ~]# echo $?
0
只是文本识别的这个看着是成功了,但是这个识别结果是在哪里看,我看快速开始示例中是直接返回的识别结果
… 2025年1月2日 17:13,Wang Xin ***@***.***> 写道:
内存不足吧
—
Reply to this email directly, view it on GitHub <#14478 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AVM3XMI3LKLHFNYGICPZVUT2IT7K7AVCNFSM6AAAAABUPJGG4OVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNZRGUZDIMY>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
请问此服务能用在centos服务器上离线部署和使用
Beta Was this translation helpful? Give feedback.
All reactions