This service connects the two required stages of the project into one end-to-end pipeline:
- Stage 1 OCR microservice receives a noisy scanned document image and extracts text using a CNN-based OCR model.
- Stage 2 compression microservice compresses that OCR output using a custom Adaptive Huffman algorithm and can then decompress it back to the original OCR text.
This pipeline service acts as the coordinator between the two microservices.
The main pipeline service does not run OCR or compression itself.
Instead, it sends requests to the existing Stage 1 and Stage 2 services and combines their outputs into a single response.
Image
↓
Stage 1 OCR microservice
↓
Extracted text
↓
Stage 2 compression microservice
↓
Compressed bitstring
↓
Stage 2 decompression microservice
↓
Recovered text
CHECKPOINT_DIR=./runs/run_005 uvicorn server:app --host 0.0.0.0 --port 8000
uvicorn service:app --host 0.0.0.0 --port 8002
uvicorn pipeline_server:app --host 0.0.0.0 --port 9000