bla commited on
Commit
61cfb19
·
verified ·
1 Parent(s): 9a62805

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -24
Dockerfile CHANGED
@@ -29,35 +29,24 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
29
  && rm -rf /var/lib/apt/lists/*
30
 
31
  RUN pip install huggingface_hub huggingface
32
- # Expose port
33
  # Download PaddleOCR models manually
34
- RUN mkdir -p /app/paddle_models/det /app/paddle_models/rec /app/paddle_models/cls
35
-
36
- # Download detection model
37
- RUN wget -O /app/paddle_models/det/en_PP-OCRv3_det_infer.tar \
38
- "https://paddleocr.bj.bcebos.com/PP-OCRv3/english/en_PP-OCRv3_det_infer.tar" && \
39
- cd /app/paddle_models/det && \
40
- tar -xf en_PP-OCRv3_det_infer.tar && \
41
- rm en_PP-OCRv3_det_infer.tar
42
-
43
- # Download recognition model
44
- RUN wget -O /app/paddle_models/rec/en_PP-OCRv4_rec_infer.tar \
45
- "https://paddleocr.bj.bcebos.com/PP-OCRv4/english/en_PP-OCRv4_rec_infer.tar" && \
46
- cd /app/paddle_models/rec && \
47
- tar -xf en_PP-OCRv4_rec_infer.tar && \
48
- rm en_PP-OCRv4_rec_infer.tar
49
-
50
- # Download classification model
51
- RUN wget -O /app/paddle_models/cls/ch_ppocr_mobile_v2.0_cls_infer.tar \
52
- "https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar" && \
53
- cd /app/paddle_models/cls && \
54
- tar -xf ch_ppocr_mobile_v2.0_cls_infer.tar && \
55
- rm ch_ppocr_mobile_v2.0_cls_infer.tar
56
 
57
  # Copy application files
58
  COPY app.py .
59
 
60
-
61
  # Create Python startup script
62
  RUN cat > /app/startup.py << 'EOF'
63
  import os
 
29
  && rm -rf /var/lib/apt/lists/*
30
 
31
  RUN pip install huggingface_hub huggingface
 
32
  # Download PaddleOCR models manually
33
+ RUN mkdir -p /models/det /models/rec /models/cls
34
+
35
+ # Download and extract detection model
36
+ RUN wget -O /models/det.tar "https://paddleocr.bj.bcebos.com/PP-OCRv3/english/en_PP-OCRv3_det_infer.tar" && \
37
+ tar -xf /models/det.tar -C /models/det && rm /models/det.tar
38
+
39
+ # Download and extract recognition model
40
+ RUN wget -O /models/rec.tar "https://paddleocr.bj.bcebos.com/PP-OCRv4/english/en_PP-OCRv4_rec_infer.tar" && \
41
+ tar -xf /models/rec.tar -C /models/rec && rm /models/rec.tar
42
+
43
+ # Download and extract classification model
44
+ RUN wget -O /models/cls.tar "https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar" && \
45
+ tar -xf /models/cls.tar -C /models/cls && rm /models/cls.tar
 
 
 
 
 
 
 
 
 
46
 
47
  # Copy application files
48
  COPY app.py .
49
 
 
50
  # Create Python startup script
51
  RUN cat > /app/startup.py << 'EOF'
52
  import os