feat(ocr): add PaddleOCR GPU Docker image and FastAPI OCR server with entrypoint; implement OCR endpoints and consensus extraction testing
This commit is contained in:
25
image_support_files/paddleocr-entrypoint.sh
Normal file
25
image_support_files/paddleocr-entrypoint.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Configuration from environment
|
||||
OCR_LANGUAGE="${OCR_LANGUAGE:-en}"
|
||||
SERVER_PORT="${SERVER_PORT:-5000}"
|
||||
SERVER_HOST="${SERVER_HOST:-0.0.0.0}"
|
||||
|
||||
echo "Starting PaddleOCR Server..."
|
||||
echo " Language: ${OCR_LANGUAGE}"
|
||||
echo " Host: ${SERVER_HOST}"
|
||||
echo " Port: ${SERVER_PORT}"
|
||||
|
||||
# Check GPU availability
|
||||
if [ "${CUDA_VISIBLE_DEVICES}" = "-1" ]; then
|
||||
echo " GPU: Disabled (CPU mode)"
|
||||
else
|
||||
echo " GPU: Enabled"
|
||||
fi
|
||||
|
||||
# Start the FastAPI server with uvicorn
|
||||
exec python -m uvicorn paddleocr-server:app \
|
||||
--host "${SERVER_HOST}" \
|
||||
--port "${SERVER_PORT}" \
|
||||
--workers 1
|
||||
Reference in New Issue
Block a user