File size: 1,263 Bytes
631b608
9548d4b
 
1a23695
9548d4b
 
 
 
 
 
 
 
1a23695
9548d4b
 
 
 
 
631b608
 
 
 
 
13801ad
 
9548d4b
0a8537f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# https://huggingface.co/spaces/gaunernst/layoutlm-docvqa-paddleocr/blob/main/Dockerfile
FROM python:3.10

ENV CUDA_VISIBLE_DEVICES=-1
ARG PIP_NO_CACHE_DIR=1

# libssl1.1 for PaddlePaddle
RUN wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb \
    && dpkg -i libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb \
    && rm libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb

RUN pip install torch==2.1.1 -i https://download.pytorch.org/whl/cpu
RUN pip install paddlepaddle==2.5.1 -i https://mirror.baidu.com/pypi/simple
RUN pip install transformers gradio Pillow
RUN pip install paddleocr==2.7.0.3 \
    && pip uninstall -y opencv-python opencv-contrib-python \
    && pip install opencv-python-headless

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user
WORKDIR $HOME/app
COPY --chown=user . $HOME/app
# RUN paddleocr --image_dir ./example_imgs/word_1.jpg --use_angle_cls true --use_gpu false  --lang ch --det_model_dir ./models/det/ch --cls_model_dir ./models/cls/ch --rec_model_dir ./models/rec/ch
# RUN paddleocr --image_dir ./example_imgs/example.jpg --use_angle_cls true --use_gpu false  --lang en --det_model_dir ./models/det/en --cls_model_dir ./models/cls/en --rec_model_dir ./models/rec/en

CMD ["python", "-u", "app.py"]