File size: 1,210 Bytes
59f9119
 
 
 
 
 
 
fba28a1
 
 
59f9119
 
736dd80
59f9119
6d65bed
11c58ff
 
7d7a455
58675de
dff6f32
59f9119
 
 
 
 
 
 
 
 
 
 
50f93a8
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
29
30
31
32
# 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.23_amd64.deb \
    && dpkg -i libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb \
    && rm libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb

RUN pip install torch==2.1.1 -i https://download.pytorch.org/whl/cpu
RUN python -m pip install paddlepaddle==2.5.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install transformers gradio Pillow fastapi
RUN pip install numpy==1.23.5
RUN pip install opencv-python==4.6.0.66
RUN pip install paddleocr==2.7.0.3
RUN apt-get update
RUN apt-get install libgl1-mesa-glx -y

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user
WORKDIR $HOME/app
RUN mkdir output
COPY --chown=user app.py $HOME/app
COPY --chown=user table.jpg $HOME/app 
COPY --chown=user word_1.jpg $HOME/app
RUN paddleocr --image_dir ./word_1.jpg --use_angle_cls true --use_gpu false  --lang ch
RUN paddleocr --image_dir ./table.jpg --type=structure --table=true  --lang ch

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]