Docker——基于HubServing部署全套PaddleOCR Restful API服务(CPU版本)
生活随笔
收集整理的這篇文章主要介紹了
Docker——基于HubServing部署全套PaddleOCR Restful API服务(CPU版本)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
說明
1、同時部署ocr_det、ocr_cls、ocr_rec、ocr_system
2、基于https://gitee.com/paddlepaddle/PaddleOCR/blob/v2.0.0/deploy/docker/hubserving/cpu/Dockerfile
3、所有服務(wù)位于同一端口下
Dockerfile
# Version: 2.0.0 FROM registry.baidubce.com/paddlepaddle/paddle:2.0.0# PaddleOCR base on Python3.7 RUN pip3.7 install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simpleRUN pip3.7 install paddlehub --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simpleRUN git clone https://gitee.com/PaddlePaddle/PaddleOCR.git /PaddleOCRWORKDIR /PaddleOCRRUN pip3.7 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simpleRUN mkdir -p /PaddleOCR/inference/ # Download ocr detect model(light version). if you want to change normal version, you can change ch_ppocr_mobile_v1.1_det_infer to ch_ppocr_server_v1.1_det_infer, also remember change det_model_dir in deploy/hubserving/ocr_system/params.py) ADD https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar /PaddleOCR/inference/ RUN tar xf /PaddleOCR/inference/ch_ppocr_mobile_v2.0_det_infer.tar -C /PaddleOCR/inference/# Download direction classifier(light version). If you want to change normal version, you can change ch_ppocr_mobile_v1.1_cls_infer to ch_ppocr_mobile_v1.1_cls_infer, also remember change cls_model_dir in deploy/hubserving/ocr_system/params.py) ADD https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar /PaddleOCR/inference/ RUN tar xf /PaddleOCR/inference/ch_ppocr_mobile_v2.0_cls_infer.tar -C /PaddleOCR/inference/# Download ocr recognition model(light version). If you want to change normal version, you can change ch_ppocr_mobile_v1.1_rec_infer to ch_ppocr_server_v1.1_rec_infer, also remember change rec_model_dir in deploy/hubserving/ocr_system/params.py) ADD https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar /PaddleOCR/inference/ RUN tar xf /PaddleOCR/inference/ch_ppocr_mobile_v2.0_rec_infer.tar -C /PaddleOCR/inference/ RUN hub install deploy/hubserving/ocr_system/ RUN hub install deploy/hubserving/ocr_cls/ RUN hub install deploy/hubserving/ocr_det/ RUN hub install deploy/hubserving/ocr_rec/EXPOSE 8866CMD ["/bin/bash","-c","hub serving start --modules ocr_system ocr_cls ocr_det ocr_rec -p 8866 "]?
參考文章
PaddleOCR——Docker環(huán)境下基于HubServing模式部署Restful API服務(wù)(CPU版本)
Docker化部署服務(wù)
PaddleOCR Docker化部署服務(wù)
總結(jié)
以上是生活随笔為你收集整理的Docker——基于HubServing部署全套PaddleOCR Restful API服务(CPU版本)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux——SSH连接错误【No su
- 下一篇: MobaXterm——Portable