Dockerfile 1.8 KB

12345678910111213141516171819202122232425262728293031323334
  1. # Version: 2.0.0
  2. FROM registry.baidubce.com/paddlepaddle/paddle:2.0.0-gpu-cuda10.1-cudnn7
  3. # PaddleOCR base on Python3.7
  4. RUN pip3.7 install --upgrade pip -i https://mirror.baidu.com/pypi/simple
  5. RUN pip3.7 install paddlehub --upgrade -i https://mirror.baidu.com/pypi/simple
  6. # If you want to use PP-OCRv4. You need to modify the `model_dir` fields in the file of `deploy/hubserving/ocr_system/params.py`
  7. RUN git clone https://github.com/PaddlePaddle/PaddleOCR.git /PaddleOCR
  8. WORKDIR /PaddleOCR
  9. RUN pip3.7 install -r requirements.txt -i https://mirror.baidu.com/pypi/simple
  10. RUN mkdir -p /PaddleOCR/inference/
  11. # Tip: You can download models from https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.7/doc/doc_ch/models_list.md
  12. # 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)
  13. ADD {link} /PaddleOCR/inference/
  14. RUN tar xf /PaddleOCR/inference/{file}.tar -C /PaddleOCR/inference/
  15. # 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)
  16. ADD {link} /PaddleOCR/inference/
  17. RUN tar xf /PaddleOCR/inference/{file}.tar -C /PaddleOCR/inference/
  18. # 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)
  19. ADD {link} /PaddleOCR/inference/
  20. RUN tar xf /PaddleOCR/inference/{file}.tar -C /PaddleOCR/inference/
  21. EXPOSE 8868
  22. CMD ["/bin/bash","-c","hub install deploy/hubserving/ocr_system/ && hub serving start -m ocr_system"]