How crzyc0d3r/ocr-eval-playground works
Open-Source OCR Playground lets an engineer compare local OCR engines against a document’s ground truth. The workflow starts in the Streamlit UI or headless CLI: load a bundled sample or supply an image and transcription, select available engines (with offline mocks as fallback), then evaluate each output with text metrics and an optional G-Eval judge. Results are combined into a composite score, ranked, and rendered as a leaderboard. The graph preserves the five documented real-engine adapters and both judge paths; adapter-to-registry wiring is documented in the registry excerpt, while UI/CLI behavior is excerpted directly.
Main entry points: __init__.py Engine registry · evaluator.py Evaluation orchestrator · app.py Streamlit UI · run_eval.py Headless CLI
Components 21
User entry
- Streamlit UI
app.py - Headless CLI
run_eval.py - Sample loader
ocreval/samples.py - Document model
ocreval/config.py
OCR engines
- Engine registry
ocreval/engines/__init__.py - Engine runtime
ocreval/engines/base.py - Mock OCR tiers
ocreval/engines/mock.py - Chandra adapter
ocreval/engines/chandra.py - DeepSeek adapter
ocreval/engines/deepseek_ocr.py - Qwen3-VL adapter
ocreval/engines/qwen3_vl.py - dots.ocr adapter
ocreval/engines/dots_ocr.py - Granite adapter
ocreval/engines/granite_docling.py
Evaluation
- Evaluation orchestrator
ocreval/evaluator.py - Text metrics
ocreval/metrics/text_metrics.py - Judge selection
ocreval/metrics/geval.py - G-Eval judge
ocreval/metrics/geval.py - Mock judge
ocreval/metrics/geval.py - Score and composite
ocreval/config.py
Results
- Leaderboard formatter
ocreval/report.py - Ranked results
ocreval/evaluator.py
Other components
- User
Connections 33
- User → Streamlit UI: uses
app.py - User → Headless CLI: runs
run_eval.py - Streamlit UI → Sample loader: loads samples
app.py - Sample loader → Document model: creates
ocreval/samples.py - Streamlit UI → Document model: creates uploads
app.py - Headless CLI → Sample loader: loads document
run_eval.py - Headless CLI → Document model: creates input
run_eval.py - Streamlit UI → Engine registry: selects engines
app.py - Headless CLI → Engine registry: resolves engines
run_eval.py - Engine registry → Mock OCR tiers: falls back to
ocreval/engines/__init__.py - Engine registry → Chandra adapter: registers
ocreval/engines/__init__.py - Engine registry → DeepSeek adapter: registers
ocreval/engines/__init__.py - Engine registry → Qwen3-VL adapter: registers
ocreval/engines/__init__.py - Engine registry → dots.ocr adapter: registers
ocreval/engines/__init__.py - Engine registry → Granite adapter: registers
ocreval/engines/__init__.py - Streamlit UI → Evaluation orchestrator: evaluates
app.py - Headless CLI → Evaluation orchestrator: evaluates
run_eval.py - Evaluation orchestrator → Engine registry: resolves defaults
ocreval/evaluator.py - Evaluation orchestrator → Engine runtime: runs engines
ocreval/evaluator.py - Engine runtime → Document model: accepts input
ocreval/engines/base.py - Mock OCR tiers → Document model: reads text
ocreval/engines/mock.py - Evaluation orchestrator → Text metrics: computes metrics
ocreval/evaluator.py - Evaluation orchestrator → Judge selection: selects judge
ocreval/evaluator.py - Judge selection → G-Eval judge: chooses when configured
ocreval/metrics/geval.py - Judge selection → Mock judge: falls back to
ocreval/metrics/geval.py - Mock judge → Text metrics: uses metrics
ocreval/metrics/geval.py - Evaluation orchestrator → Score and composite: computes composite
ocreval/evaluator.py - Evaluation orchestrator → Ranked results: ranks scores
ocreval/evaluator.py - Streamlit UI → Leaderboard formatter: formats rows
app.py - Headless CLI → Leaderboard formatter: formats output
run_eval.py - Leaderboard formatter → Ranked results: renders
ocreval/report.py - Streamlit UI → Ranked results: displays
app.py - Headless CLI → Ranked results: prints
run_eval.py