1.安裝Python 3.9 直接執(zhí)行python-3.9.0-amd64 文件。 2.安裝PaddlePaddle v2.0 2.1.安裝步驟 python -m pip install --upgrade pip python -m pip install paddlepaddle==2.0.0b0 -i https://mirror.baidu.com/pypi/simple 2.2.遇到問題 2.2.1.Traceback (most recent call last):
解決方案:管理員打開cmd 執(zhí)行 2.2.2. Could not find a version that satisfies the requirement paddlepaddle==2.0.0b0 (from versions: 2.1.0, 2.1.1, 2.1.2)
解決方案:修改命令為 python -m pip install paddlepaddle==2.3.0 -i https://mirror.baidu.com/pypi/simple 3.克隆PaddleOCR repo代碼 git clone https:///paddlepaddle/PaddleOCR 4.安裝第三方庫 cd PaddleOCR 進(jìn)入OCR目錄調(diào)用Python命令安裝requirements.txt python -m pip install -r requirements.txt 4.1.遇到問題 4.1.1.Running setup.py install for scikit-image … error 解決方案: 1.pip install cython 最新版本0.29,,所需版本0.23 2.下載本地whl scikit_image-0.18.2-cp39-cp39-win_amd64 并安裝 3.修改 requirement.txt
4.繼續(xù)下一步安裝 4.1.2. Running setup.py install for python-Levenshtein … error 解決方案:安裝本地的whl,,python_Levenshtein-0.12.2-cp39-cp39-win_amd64.whl whl 下載地址 https://www.lfd./~gohlke/pythonlibs/#numpy ,選擇對(duì)應(yīng)python 版本 5.使用 教程:https://www./read/PaddleOCR/README.md 5.1.服務(wù)化部署 5.1.1.安裝 paddlehub pip install paddlehub --upgrade -i https://pypi.tuna./simple 5.1.2.安裝檢測識(shí)別串聯(lián)服務(wù)模塊 hub install deploy/hubserving/ocr_system/ 5.1.3.啟動(dòng) ocr_system 服務(wù) 這里配置參數(shù)使用配置文件,,首先修改"D:\itsvse\PaddleOCR-release-2.0\deploy\hubserving\ocr_system\config.json"配置,,如下: { “modules_info”: { “ocr_system”: { “init_args”: { “version”: “1.0.0”, “use_gpu”: false }, “predict_args”: { } } }, “port”: 8866, “use_multiprocess”: true, “workers”: 2 } 使用如下命令啟動(dòng)服務(wù): hub serving start -c “D:\itsvse\PaddleOCR-release-2.0\deploy\hubserving\ocr_system\config.json” 5.2.Java 調(diào)用服務(wù)
測試代碼文件下載地址 * https://ai.baidu.com/file/658A35ABAB2D404FBF903F64D47C1F72 * https://ai.baidu.com/file/C8D81F3301E24D2892968F09AE1AD6E2 * https://ai.baidu.com/file/544D677F5D4E4F17B4122FBD60DB82B3 * https://ai.baidu.com/file/470B3ACCA3FE43788B5A963BF0B625F3 5.2.1.調(diào)用代碼
5.2.2.返回內(nèi)容
5.3.遇到問題 5.3.1.ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject 解決方案:升級(jí)numpy pip3 install --upgrade numpy 5.3.2.ValueError: not find model file path ./inference/ch_ppocr_mobile_v2.0_det_infer//inference.pdmodel 解決方案: 下載模型 ,模型下載地址 https:///paddlepaddle/PaddleOCR/blob/v2.1.1/doc/doc_ch/models_list.md 修改參數(shù)文件params.py中的模型路徑,,改為自己的路徑
5.3.3.Server returned HTTP response code: 400 for URL: http://127.0.0.1:8868/predict/ocr_system 解決方案:參數(shù)不對(duì),,修改參數(shù) |
|