Linux 部署以paddle Serving 的方式部署 PaddleOCR CPU版本
强烈建议您在Docker内构建Paddle Serving,更多镜像请查看Docker镜像列表。
提示-1:Paddle Serving项目仅支持Python3.6/3.7/3.8/3.9,接下来所有的与Python/Pip相关的操作都需要选择正确的Python版本。
提示-2:以下示例中GPU环境均为cuda11.2-cudnn8,如果您使用Python Pipeline来部署,并需要Nvidia TensorRT来优化预测性能,请参考以下说明来选择其他版本。
一、docker镜像下载及容器启动
开发镜像有两种, 分别为:
Serving 镜像: registry.baidubce.com/paddlepaddle/serving:{Tag}
Paddle 镜像: registry.baidubce.com/paddlepaddle/paddle:{Tag}
两种镜像都支持安装Serving, 但是:在Paddle docker镜像上部署 Servin g服务需要安装额外依赖库,因此,我们直接使用 Serving 开发镜像。
下载 CPU最新版镜像, 并启动容器:
# 启动 CPU Docker
docker pull registry.baidubce.com/paddlepaddle/serving:0.9.0-devel
docker run -p 9292:9292 --name test_cpu -dit registry.baidubce.com/paddlepaddle/serving:0.9.0-devel bash
docker exec -it test_cpu bash
git clone https://github.com/PaddlePaddle/Serving
二、在镜像中安装相关依赖
2.1 安装requirements
cd Serving
pip3 install -r python/requirements.txt
这里可能会报错:
Building wheels for collected packages: av
Building wheel for av (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-33ucddr6/av_a8ed30cb6adf4834b63b8b918a77b42a/setup.py'"'"'; file='"'"'/tmp/pip-install-33ucddr6/av_a8ed30cb6adf4834b63b8b918a77b42a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-2di0ikr3
cwd: /tmp/pip-install-33ucddr6/av_a8ed30cb6adf4834b63b8b918a77b42a/
Complete output (48 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/av
copying av/main.py -> build/lib.linux-x86_64-3.6/av
copying av/init.py -> build/lib.linux-x86_64-3.6/av
copying av/datasets.py -> build/lib.linux-x86_64-3.6/av
copying av/deprecation.py -> build/lib.linux-x86_64-3.6/av
creating build/lib.linux-x86_64-3.6/av/container
copying av/container/init.py -> build/lib.linux-x86_64-3.6/av/container
creating build/lib.linux-x86_64-3.6/av/subtitles
copying av/subtitles/init.py -> build/lib.linux-x86_64-3.6/av/subtitles
creating build/lib.linux-x86_64-3.6/av/codec
copying av/codec/init.py -> build/lib.linux-x86_64-3.6/av/codec
creating build/lib.linux-x86_64-3.6/av/filter
copying av/filter/init.py -> build/lib.linux-x86_64-3.6/av/filter
creating build/lib.linux-x86_64-3.6/av/audio
copying av/audio/init.py -> build/lib.linux-x86_64-3.6/av/audio
creating build/lib.linux-x86_64-3.6/av/data
copying av/data/init.py -> build/lib.linux-x86_64-3.6/av/data
creating build/lib.linux-x86_64-3.6/av/video
copying av/video/init.py -> build/lib.linux-x86_64-3.6/av/video
creating build/lib.linux-x86_64-3.6/av/sidedata
copying av/sidedata/init.py -> build/lib.linux-x86_64-3.6/av/sidedata
running build_ext
running config
PyAV: 8.0.3 (unknown commit)
Python: 3.6.0 (default, Mar 4 2022, 05:45:55) \n[GCC 8.2.0]
platform: Linux-5.4.0-150-generic-x86_64-with-debian-stretch-sid
extension_extra:
include_dirs: [b'include']
libraries: []
library_dirs: []
define_macros: []
runtime_library_dirs: []
config_macros:
PYAV_COMMIT_STR="unknown-commit"
PYAV_VERSION=8.0.3
PYAV_VERSION_STR="8.0.3"
Could not find libavformat with pkg-config.
Could not find libavcodec with pkg-config.
Could not find libavdevice with pkg-config.
Could not find libavutil with pkg-config.
Could not find libavfilter with pkg-config.
Could not find libswscale with pkg-config.
Could not find libswresample with pkg-config.
ERROR: Failed building wheel for av
Running setup.py clean for av
Failed to build av
Installing collected packages: av
Running setup.py install for av ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-33ucddr6/av_a8ed30cb6adf4834b63b8b918a77b42a/setup.py'"'"'; file='"'"'/tmp/pip-install-33ucddr6/av_a8ed30cb6adf4834b63b8b918a77b42a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-8oce82tt/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6m/av
cwd: /tmp/pip-install-33ucddr6/av_a8ed30cb6adf4834b63b8b918a77b42a/
Complete output (50 lines):
running install
/usr/local/lib/python3.6/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/av
copying av/main.py -> build/lib.linux-x86_64-3.6/av
copying av/init.py -> build/lib.linux-x86_64-3.6/av
copying av/datasets.py -> build/lib.linux-x86_64-3.6/av
copying av/deprecation.py -> build/lib.linux-x86_64-3.6/av
creating build/lib.linux-x86_64-3.6/av/container
copying av/container/init.py -> build/lib.linux-x86_64-3.6/av/container
creating build/lib.linux-x86_64-3.6/av/subtitles
copying av/subtitles/init.py -> build/lib.linux-x86_64-3.6/av/subtitles
creating build/lib.linux-x86_64-3.6/av/codec
copying av/codec/init.py -> build/lib.linux-x86_64-3.6/av/codec
creating build/lib.linux-x86_64-3.6/av/filter
copying av/filter/init.py -> build/lib.linux-x86_64-3.6/av/filter
creating build/lib.linux-x86_64-3.6/av/audio
copying av/audio/init.py -> build/lib.linux-x86_64-3.6/av/audio
creating build/lib.linux-x86_64-3.6/av/data
copying av/data/init.py -> build/lib.linux-x86_64-3.6/av/data
creating build/lib.linux-x86_64-3.6/av/video
copying av/video/init.py -> build/lib.linux-x86_64-3.6/av/video
creating build/lib.linux-x86_64-3.6/av/sidedata
copying av/sidedata/init.py -> build/lib.linux-x86_64-3.6/av/sidedata
running build_ext
running config
PyAV: 8.0.3 (unknown commit)
Python: 3.6.0 (default, Mar 4 2022, 05:45:55) \n[GCC 8.2.0]
platform: Linux-5.4.0-150-generic-x86_64-with-debian-stretch-sid
extension_extra:
include_dirs: [b'include']
libraries: []
library_dirs: []
define_macros: []
runtime_library_dirs: []
config_macros:
PYAV_COMMIT_STR="unknown-commit"
PYAV_VERSION=8.0.3
PYAV_VERSION_STR="8.0.3"
Could not find libavformat with pkg-config.
Could not find libavcodec with pkg-config.
Could not find libavdevice with pkg-config.
Could not find libavutil with pkg-config.
Could not find libavfilter with pkg-config.
Could not find libswscale with pkg-config.
Could not find libswresample with pkg-config.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-33ucddr6/av_a8ed30cb6adf4834b63b8b918a77b42a/setup.py'"'"'; file='"'"'/tmp/pip-install-33ucddr6/av_a8ed30cb6adf4834b63b8b918a77b42a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-8oce82tt/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6m/av Check the logs for full command output.
这是在pip安装 av包时报错。
到 官方项目中搜索开放的问题:
执行 pip3 install -r python/requirements.txt 报错
虽然问题还是open的, 但提供的一个解决方案,我这里试了,可以解决 上面的问题。
这里遇到这个问题是因为: av 包版本与 FFmpeg 不兼容,可以试试:重新编译 FFmpeg
wget https://ffmpeg.org/releases/ffmpeg-4.4.tar.gz
tar -xzf ffmpeg-4.4.tar.gz
cd ffmpeg-4.4apt-get install -y build-essential yasm pkg-config./configure --enable-shared --prefix=/usr/local
make -j$(nproc)
make installldconfig/usr/local/bin/ffmpeg -version
之后重新安装 av
pip3 cache purge
pip3 install av==8.0.3 --no-cache-dir
2.2 安装服务所需whl包,共有3种: client、app、server,安装命令如下
pip3 install paddle-serving-client==0.9.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install paddle-serving-app==0.9.0 -i https://pypi.tuna.tsinghua.edu.cn/simple# server 需要区分 CPU和GPU版本
CPU Serverpip3 install paddle-serving-server==0.9.0 -i https://pypi.tuna.tsinghua.edu.cn/simpleGpu Serverpip3 install paddle-serving-server-gpu==0.9.0.post112 -i https://pypi.tuna.tsinghua.edu.cn/simple
后续需要进行模型转换, 所以这里还需要额外安装paddle包:
# CPU环境请执行
pip3 install paddlepaddle==2.3.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
检查已经安装的包:
λ 3cf905f11bfc /home pip list | grep paddle
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
paddle-bfloat 0.1.7
paddle-serving-app 0.9.0
paddle-serving-client 0.9.0
paddle-serving-server 0.9.0
paddlepaddle 2.4.2
三、下载模型及模型转换
3.1 下载代码及模型
import osos.chdir("/home/aistudio")
# 下载代码
!git clone https://gitee.com/paddlepaddle/PaddleOCR.git
os.chdir("/home/aistudio/PaddleOCR")os.chdir("/home/aistudio/PaddleOCR/deploy/pdserving/")# 下载并解压 OCR 文本检测模型 paddleocr v2
!wget https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar -O ch_PP-OCRv2_det_infer.tar && tar -xf ch_PP-OCRv2_det_infer.tar && rm ch_PP-OCRv2_det_infer.tar
# 下载并解压 OCR 文本识别模型
!wget https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_infer.tar -O ch_PP-OCRv2_rec_infer.tar && tar -xf ch_PP-OCRv2_rec_infer.tar && rm ch_PP-OCRv2_rec_infer.tar# paddleocr v3
wget https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar -O ch_PP-OCRv3_det_infer.tar && tar -xf ch_PP-OCRv3_det_infer.tar && rm ch_PP-OCRv3_det_infer.tarwget https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar -O ch_PP-OCRv3_rec_infer.tar && tar -xf ch_PP-OCRv3_rec_infer.tar && rm ch_PP-OCRv3_rec_infer.tar
3.2 模型转换
python3 -m paddle_serving_client.convert --dirname ./ch_PP-OCRv3_det_infer/ \--model_filename inference.pdmodel \--params_filename inference.pdiparams \--serving_server ./ppocrv3_det_serving/ \--serving_client ./ppocrv3_det_client/python3 -m paddle_serving_client.convert --dirname ./ch_PP-OCRv3_rec_infer/ \--model_filename inference.pdmodel \--params_filename inference.pdiparams \--serving_server ./ppocrv3_rec_serving/ \--serving_client ./ppocrv3_rec_client/
执行完后, 检查文件夹
tree -h *_client *_serving# 服务端用到的
|- ppocrv2_det_serving/|- __model__ |- __params__|- serving_server_conf.prototxt |- serving_server_conf.stream.prototxt# 客户端用到的
|- ppocrv2_det_client|- serving_client_conf.prototxt |- serving_client_conf.stream.prototxt
没问题,如果有v3,还有存在ppocrv3_det_client和ppocrv3_det_serving 文件夹
四、启动PaddleOCR 服务
启动OCR服务, PaddleOCR 的 pdserving目录包含启动pipeline服务和发送预测请求的代码,包括:
__init__.pyconfig.yml # 启动服务的配置文件ocr_reader.py # OCR模型预处理和后处理的代码实现pipeline_http_client.py # 发送预测请求的脚本web_service.py # 启动服务端的脚本
一行命令即可启动服务:
开启新的终端运行下列启动服务的命令
#python3 web_service.py --config=config.yml# 后台启动
nohup python3 web_service.py --config=config.yml &>web_serving_log.txt &
成功启动服务后,web_serving_log.txt中会打印类似如下日志
五、发送客户端请求
import os
os.chdir("/home/aistudio/PaddleOCR/deploy/pdserving/")
!python pipeline_http_client.py{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['3504811', '属瑞金医院', '标本号:OA', '支吉单(临床内分泌', '标本种类:血清', '标志提示:', '门诊号:E05535540', '门诊科别:门诊内分泌', '条码号:10080603139 临床诊断:', '申请医生:孙首悦', '检测日期:2010', '产', '龄:31', '检验备注:', '结果', '参考范围', '项目', '3.12', 'FT3', '2.62--6.49pmol/L', '15.40', 'FT4', '9.01--19.04pmol/L', '1.31', '0.35--4.94uIU/ml', 'STSH', '0.15', '<4.1110/ml', 'TGAB', '0.1', '25.0U/L', 'TRAb', '0.17', '<5.611U/ml', 'TPOAb', '0.1', '0.1--10.0pg/ml', '降钙素', '报告时间:10-08-0711:28', '打印时间:1', '采样时间:10-08-0611:23', '收到时间:10-08-0611:44', '核', '检验:李纪平', '对:保', '以上7项检验结果仅供临床医师参考']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['Mairiedu|er|农', '*|Palais du LOUVRE', '公 LES ARTS DECORATIFS', '* Musée du LOUVRE', 'Theatre', 'du PALAIS-ROYAL L&']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['小学数学第八册第三单元测试题', '(小数乘法)', '姓名:', '班别:', '分数:', '计算题.(共38分)', '1.直接写出得数。(10分)', '0.8X25=', '0X4.23=', '0.57+0.43=', '2.4X0.2=', '0.02', 'X500=', '2.8X10=', '8.29X100=', '2.5X0.4=', '4.87-1.7=', '8.07', 'X1000=', '2.用坚式计算。(12分)', '2.97X3.8=', '7.05X0.84=']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['Paddle.jit.saveO', ': best accuracy.pdopt', ': inference.pdmodel', 'ich det mv3', '模型训练', 'i best accuracy.pdparams', '模型转换', 'opt优化模型', 'i inference.pdiparams', 'idb opt.nb', ': best accuracy.states']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['2', '证#', '', '##', '孔叫叫E2号动']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['股股东的持股情况', '单位:股', '股东总数(户)', '75.103', '前十名股东持股情况', '持有有限售条', '质押或冻结情况', '股东名称', '期末持股数量', '比例', '件股份数量', '股东性质', '股份状态', '数量', '国有法人', 'HONG Leong Bank', '境外法人', '浩海产业投资基金管理', '240000000', '境内非国有法人', '0', '国有法人', '公司', '16000000', '16000000', '公司', '国有法人', '成都欣天颐投资有限责', '0', '国有法人', '上海东昌投资发展有限', '3.3220%', '冻结', '公司', '50.000.00境内非国有法人', '新华文轩出版传媒股份', '0', '80000.000', '国有法人', '四川新华发行集团有限', '71243800', '1.9723%', '公司', '国有法人', '71.154.900', '限责任公司', '国有法人']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['右', '天然の', '#', '味の占', '濃厚衣', '梦少久', '本勇5办', '味\\\\深', '燒', '深办の苏石', '苏扣子布', '5味の', '3-9', '警', '鲍の己品', '匕辛', '节办', '永书', '香', '梦之', '二の两石', '脂の秉龙', '力力', 'N', '乙龙の揚', '', '出来龙了', ':', '新鲜', '少手', '炊吉大了', '風味豊', '熟成L力', '二人办', '美味', '芳醇', '口の.', 'C', '二の石', '史方办套', '旬', '産地直送', '久七', '食人二', '秘の', '<<', '淹机个一卜', '>1一>一', '本場の', '朝探', '俊味吉', '七3寸子']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['1', 'EPPING', 'Twinned with', 'Eppingen,']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['代号', '项目', '结果', '参考值', '单位', '谷丙转氨酶', '25.6', '0--40', 'ALT', 'U/L', 'TBIL', '总胆红素', '11.2', '<20', 'UMO1/L', '直接胆红素', '3.3', '0--7', 'DBIL', 'UMOL/L', '间接胆红素', '7.9', 'IBIL', '1.5--15', 'UMOL/L', '总蛋白', '58.9V', '60--80', 'TP', 'S/L', '白蛋白', '35.1', '33--55', 'ALB', ':/L', '球蛋白', '23.8', '20--30', 'GLO', '8/L', '白球比', 'A/G', '1.5', '1.5--2.5', 'ALP', '可性磷酉酯', '93', '15--112', 'IU/L', '谷氨酰转肽酸', '<50', '14.3', 'GGT', 'U/L', '谷草转氨酶', 'AST', '16.3', '8--40', 'U/L', '乳酸脱氢酶', 'LDH', '167', '114--240', 'U/L', '腺甘脱氨酶', '12.6', '4--24', 'ADA', 'U/L']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['Halten', 'Sie', 'Sie', 'was', 'versprechen', 'Und', 'geben', 'Sie noch', 'was dazu']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['CreditCord', '中国工商银行', 'INDUSTRIL AD COMMERCIA BAHKSLUHIN', '持卡人存根', '商户名称&编号(MERCHANT NAME&CODE)', '工行浣纱支行积分兑换', '120214020408', '检索参考号(SYSTEMINOJ)', '终端号(TERMINAL)', '60128018', '001', '卡号(CARD NUMBER):', '622210512', 'S', '卡别(CARDTYPE)', '有效期(EXPIRY', '牡丹准货记卡', '交易日期DATE)', '交易时间(TIMEE)', '2012-10-23', '12:43:15', '批次号(BATCHNO.)', '流水号(TRACEHOJ', '000016', '积分兑奖', '信用卡积分:50000', '持卡人姓名(CARDHOLDERNAME)', 'MR.1', '持卡人签名', '(CARDHOLDER S', 'SIGNATURE:']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['上海斯格威铂尔受大酒店', '一打浦路15号', '绿洲仕格维花园公寓', '打浦路252935号']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['订007778', 'PASS', '登机牌', 'BOARDING', '座位号', '序号', 'SERIALNO.', '舱位 CLASS', 'SEAT NO.', '航班 FLIGHT', '日期 DATE', 'W', '03DEC', '035', 'MU2379', 'GATE', '登机口', '始发地', 'FROM', '登机时间BDT', '自的地 TO', '福州', 'TAIYUAN', 'G11', 'FUZHOU', '身份识别ID NO.', '姓名NAME', 'ZHANGQIWET', '票号TKT NO', '张祺伟', '票价 FARE', 'ETKT7813699238489/1', '登机口于起飞前10分钟关闭 GATES CLOSE 10 MINUTES BEFORE DEPARTURE TIME']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['7788.com', 'Z57A001950', '杭州东售', '2013年07月07日13:39开', '06车12B号', '二等座', '杭州东', 'G7512次', '上海虹桥', 'HangZhouDong', 'Shang HaiHongQiao', '¥73.00元', '限乘当日当次车', '余友红', '检票口16', '3623301993****0941', '9004-1300-5707-08A0-0195-0', '和谐号', 'C0400']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['中国农业银行', 'AGRICULTURAL BANK OF CHINA', '美太网点办', '理务贵全融华务']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['土地整治与土壤修复研究中心', '华南农业大学|东图']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['合格证', '品名:纯棉单面背心套', '执行标准:FZ/T73025-2006', '安全类别:GB18401-2010', 'A类婴幼儿用品', '货号:B2390', 'DREA', '等级:一等品检验员:08', 'WOTHERAL', '成份:面料:100%棉', '小晶晶母婴', '品名:纯棉单面背心套', '上装:66/48', '零售价:47.50元', '下装:66/47']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['Meters/bonwe', '洗涤说明', '淘X口Ne', '最高洗涤温度30°C', '常规程序', '不可漂白', '悬挂晾干', '熨斗底板最高温度110°C', '常规干洗', '注童事项:']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['纯臻营养护发素', '产品信息/参数', '(45元/每公斤,100公斤起订', '每瓶22元,1000瓶起订)', '【品牌】:代加工方式/OEMODM', '【品名】:纯臻营养护发素', '【产品编号】:YM-X-3011', 'ODMOEM', '(净含量】:220ml', '【适用人群):适合所有肤质', '[主要成分】:鲸蜡硬脂醇、燕麦B-葡聚', '糖、椰油酰胺内基甜菜碱、泛醒', '(成品包材)', '主要功能】:可紧致头发磷层,从而达到', '即时持久改善头发光泽的效果,给干燥的头', '发足够的滋养']"], 'tensors': []}
{'err_no': 0, 'err_msg': '', 'key': ['res'], 'value': ["['栏L。未来味元氨']"], 'tensors': []}
==> total number of test imgs: 20
文档中,后续还有服务优化的一些配置, 接下来的文章中继续补充。。。
六、参考
Paddle Serving官方安装文档
基于 Paddle Serving 的 OCR 服务化部署实战
执行 pip3 install -r python/requirements.txt 报错