Add containerized OCR pipeline for fuel receipts
Self-hosted, verifiable pipeline for extracting structured data (station, date/time, price per litre, litres, discount, total) from German fuel receipt photos: grayscale + mild bilateral filter + contrast stretch, Tesseract OCR, then LLM structuring via a small local model (Qwen 2.5, served by Ollama). Each step is independently runnable and inspectable through numbered scripts against a shared tooling container. Ollama runs as its own long-lived container (0_run_ollama.sh), separate from the stateless per-receipt pipeline steps, so the model stays loaded in memory between runs. Includes a containerized ground-truth batch test (test_batch.sh) that reproduces the full pipeline over the test receipts and reports per-field accuracy. Targets eventual deployment on a Raspberry Pi 4 k3s cluster.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
tesseract-ocr \
|
||||
tesseract-ocr-deu \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip install --no-cache-dir \
|
||||
opencv-python-headless==4.10.0.84 \
|
||||
numpy==2.1.3 \
|
||||
pillow==11.0.0 \
|
||||
pytesseract==0.3.13 \
|
||||
requests==2.32.3 \
|
||||
odfpy==1.4.1
|
||||
|
||||
COPY src/ /opt/app/src/
|
||||
RUN chmod -R a+rX /opt/app/src
|
||||
|
||||
WORKDIR /data
|
||||
ENTRYPOINT []
|
||||
Reference in New Issue
Block a user