Commit History
-
fix(card-ocr): force-reinstall opencv-python-headless after uninstall
paddleocr pulls in opencv-python and opencv-contrib-python alongside the opencv-python-headless we declare in requirements.txt. All three write to the same cv2/ directory with overlapping file lists. Our `pip uninstall -y opencv-python opencv-contrib-python` then deletes files that opencv-python-headless's RECORD also references, leaving cv2 importable but missing constants: AttributeError: module 'cv2' has no attribute 'INTER_LINEAR' (thrown inside paddleocr/tools/infer/predict_rec.py at class body evaluation -- so the failure shows up the first time PaddleOCR is lazy-imported, which is the first /extract call.) Force-reinstall the headless variant after the uninstall to restore every file it owns. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>de8b168 -
fix(card-ocr): bind 0.0.0.0 instead of :: for HF edge proxy
HF Spaces' edge proxy connects to containers over IPv4 only. We were binding uvicorn to '::' (IPv6 wildcard with IPv4-mapped clients implicit on Linux when net.ipv6.bindv6only=0). HF's container runtime evidently does NOT set bindv6only=0, so HF's edge couldn't reach the container at all: - container ran fine internally (uvicorn happy on [::]:7860) - HF showed Space as Running - external curl: TLS succeeds, then HTTP times out at 15s Switching to 0.0.0.0 matches HF's own example Dockerfile in their Docker Spaces docs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>5f100b4
-
chore(card-ocr): migrate sidecar deployment from Railway to Hugging Face Space
Sagar Deswal +1: Claude Opus 4.7 (1M context)Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>72de53b
-
feat(card-ocr): PaddleOCR sidecar with Railway-ready config
- Dockerfile: pin python:3.11-slim (paddlepaddle 2.6.2 wheel needs 3.11), drop opencv-python + opencv-contrib-python so headless variant is the only libcv on the path (prevents double-free on first OCR), bake the English model weights into the image so the first request after a deploy isn't a ~10s download. - main.py: emit per-line `blocks` with text + confidence so the Django side can attribute Haiku-extracted fields back to a specific OCR line (per-field confidence aggregation). - railway.json: explicit Dockerfile builder + dual-stack `--host ::` + healthcheck-friendly `--port \${PORT:-8001}` start command so Railway's private network can route to the container. - .dockerignore: belt-and-suspenders so build scratch / test files don't leak into the production image. - docker-compose.yml: card-ocr service block with healthcheck + service_started dep on backend (relaxed from service_healthy so local stub-mode dev doesn't block on the heavy sidecar build). - .env.ex…6f32872
-
chore: consolidate plans, add explicit permissions, and update onboarding flow
Sun7065d8d