強烈建議您在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 報錯