no model download on imaeg build
All checks were successful
All checks were successful
This commit is contained in:
@@ -34,15 +34,9 @@ ARG REC_MODEL=PP-OCRv5_server_rec
|
||||
ENV PADDLE_DET_MODEL=${DET_MODEL}
|
||||
ENV PADDLE_REC_MODEL=${REC_MODEL}
|
||||
|
||||
# Download models during build (not at runtime)
|
||||
RUN python -c "\
|
||||
import os; \
|
||||
from paddleocr import PaddleOCR; \
|
||||
det = os.environ.get('PADDLE_DET_MODEL', 'PP-OCRv5_server_det'); \
|
||||
rec = os.environ.get('PADDLE_REC_MODEL', 'PP-OCRv5_server_rec'); \
|
||||
print(f'Downloading models: det={det}, rec={rec}'); \
|
||||
ocr = PaddleOCR(text_detection_model_name=det, text_recognition_model_name=rec); \
|
||||
print('Models downloaded successfully!')"
|
||||
# Note: Models download at first runtime
|
||||
# First container start will take ~30s longer as models are fetched
|
||||
# Use paddlex-cache volume to persist models across container restarts
|
||||
|
||||
# Volume for dataset and optional additional model cache
|
||||
VOLUME ["/app/dataset", "/root/.paddlex"]
|
||||
|
||||
@@ -77,15 +77,9 @@ ARG REC_MODEL=PP-OCRv5_server_rec
|
||||
ENV PADDLE_DET_MODEL=${DET_MODEL}
|
||||
ENV PADDLE_REC_MODEL=${REC_MODEL}
|
||||
|
||||
# Download models during build (not at runtime)
|
||||
RUN python -c "\
|
||||
import os; \
|
||||
from paddleocr import PaddleOCR; \
|
||||
det = os.environ.get('PADDLE_DET_MODEL', 'PP-OCRv5_server_det'); \
|
||||
rec = os.environ.get('PADDLE_REC_MODEL', 'PP-OCRv5_server_rec'); \
|
||||
print(f'Downloading models: det={det}, rec={rec}'); \
|
||||
ocr = PaddleOCR(text_detection_model_name=det, text_recognition_model_name=rec); \
|
||||
print('Models downloaded successfully!')"
|
||||
# Note: Models download at first runtime (CI runner has no GPU for build-time download)
|
||||
# First container start will take ~30s longer as models are fetched
|
||||
# Use paddlex-cache volume to persist models across container restarts
|
||||
|
||||
# Volume for dataset and optional additional model cache
|
||||
VOLUME ["/app/dataset", "/root/.paddlex"]
|
||||
|
||||
Reference in New Issue
Block a user