Training-free CTC decoding under identifier constraints.
Python 3.10 or newer is required.
python -m venv .venv
. .venv/bin/activate
pip install -e .
python -m unittest discover -s tests -vInstall OCR dependencies before running inference scripts.
pip install -e ".[inference]"Set EACT_DATA to the public benchmark downloads or use data/.
python scripts/cqu_crop_all.py --data data/cqu_vd20k/CQU_VD20K/Steel/train_img \
--gt data/cqu_vd20k/CQU_VD20K/Steel/train_gt --out data/cqu_labels/images
cp labels/labels.tsv data/cqu_labels/labels.tsv
(cd data/cqu_labels && sha256sum -c ../../labels/SHA256SUMS)# CQU cropped-input evaluation
python scripts/cqu_eval.py --data data/cqu_labels \
--model-dir /path/to/en_PP-OCRv5_mobile_rec --device cpu --out out/cqu
# Other cropped benchmarks
python scripts/trudi_eval.py --device cpu
python scripts/midv_eval.py --source scan --device cpu
python scripts/ufpr_eval.py --device cpu
# Cached-posterior comparisons
python scripts/paddle_run.py --bench cqu --tag v5mobile \
--model-dir /path/to/model --out runs --device cpu --save-posteriors
python scripts/nbest.py --reader v5mobile --bench cqu --out runs --beam 256
python scripts/aggregate.py --runs runs --out runs/results.tsv
# Controls and end-to-end evaluation
python scripts/wrong_specification_controls.py \
--family iso6346 --manifest runs/trudi/manifest.tsv
python scripts/score_confidence.py --family iso6346 \
--manifest runs/trudi/manifest.tsv --out runs/trudi/confidence.tsv
python scripts/run_cqu_e2e.py --out out/cqu_e2e.tsv
python scripts/run_muenster.py --out out/muenster_e2e.tsvCached-posterior manifests contain key, gt, and posterior columns.
Posterior paths are relative to the manifest. Arrays use the alphabet declared
by --family.