Dockerfile 1.7 KB
Newer Older
W
WenmuZhou 已提交
1
# Version: 2.0.0
S
Skay 已提交
2
FROM registry.baidubce.com/paddlepaddle/paddle:2.1.2
文幕地方's avatar
文幕地方 已提交
3 4 5 6 7 8 9 10

# PaddleOCR base on Python3.7
RUN pip3.7 install --upgrade pip -i https://mirror.baidu.com/pypi/simple

RUN pip3.7 install paddlehub --upgrade -i https://mirror.baidu.com/pypi/simple

RUN git clone https://github.com/PaddlePaddle/PaddleOCR.git /PaddleOCR

S
Skay 已提交
11 12
ADD https://raw.githubusercontent.com/python/cpython/3.7/Lib/typing.py /usr/local/lib/python3.7

文幕地方's avatar
文幕地方 已提交
13 14 15 16 17
WORKDIR /PaddleOCR

RUN pip3.7 install -r requirements.txt -i https://mirror.baidu.com/pypi/simple

RUN mkdir -p /PaddleOCR/inference/
W
WenmuZhou 已提交
18
# Download orc detect model(light version). if you want to change normal version, you can change ch_ppocr_mobile_v2.0_det_infer to ch_ppocr_server_v2.0_det_infer, also remember change det_model_dir in deploy/hubserving/ocr_system/params.py)
文幕地方's avatar
文幕地方 已提交
19 20 21
ADD {link} /PaddleOCR/inference/
RUN tar xf /PaddleOCR/inference/{file} -C /PaddleOCR/inference/

W
WenmuZhou 已提交
22
# Download direction classifier(light version). If you want to change normal version, you can change ch_ppocr_mobile_v2.0_cls_infer to ch_ppocr_mobile_v2.0_cls_infer, also remember change cls_model_dir in deploy/hubserving/ocr_system/params.py)
文幕地方's avatar
文幕地方 已提交
23 24 25
ADD {link} /PaddleOCR/inference/
RUN tar xf /PaddleOCR/inference/{file}.tar -C /PaddleOCR/inference/

W
WenmuZhou 已提交
26
# Download orc recognition model(light version). If you want to change normal version, you can change ch_ppocr_mobile_v2.0_rec_infer to ch_ppocr_server_v2.0_rec_infer, also remember change rec_model_dir in deploy/hubserving/ocr_system/params.py)
文幕地方's avatar
文幕地方 已提交
27 28 29 30 31
ADD {link} /PaddleOCR/inference/
RUN tar xf /PaddleOCR/inference/{file}.tar -C /PaddleOCR/inference/

EXPOSE 8868

S
Skay 已提交
32
CMD ["/bin/bash","-c","hub install deploy/hubserving/ocr_system/ && hub serving start -m ocr_system"]