feat: RapidOCR default OCR engine, office-only ocr_engine, drop operator toggle
ci / smoke (push) Canceled after 0s

This commit is contained in:
andrew committed 2026-09-25 16:18:41 +07:00
1 parent 080237ad3b
commit fbba169507
16 files changed
+137 -112

No files matched your search

+15 -5
View File
@@ -16,15 +16,25 @@ version tags are cut in this repo — POC stage, `main` is the release line).
- `delivery_orders` table + additive `batches` columns (`plate`, `do_numbers`,
`expected_*`, `net_*`); photo tree `do_photos/YYYY-MM-DD/` (7-day retention).
- APIs: `POST /api/batch/stop-preview`, DO CRUD + `POST /api/do/upload`,
`GET|POST /api/do/settings` (office-only plate/do flags; **ocr_engine both
ports**), office-only mode/model_mode POST (403 on operator; 409 when batch active).
`GET|POST /api/do/settings` (all gated fields office-only:
require_plate/require_do/**ocr_engine**, 403 on operator), office-only
mode/model_mode POST (403 on operator; 409 when batch active).
- `src/do_batch.py` (pure gates/nets/units), `src/do_ocr.py`
(`extract_do_fields` tesseract|paddle|none).
- Operator DO panel + OCR toggle; monitoring 3-way mode switch + model mode +
OCR/require-plate controls; history/export plate, DO, expected, net columns.
(`extract_do_fields` rapid|tesseract|paddle|none).
- **RapidOCR default engine** (`rapidocr_onnxruntime`, bundled PP-OCR models);
tesseract + paddle kept as backups, explicit error if a dep is missing.
- Operator DO panel (no OCR toggle); monitoring 3-way mode switch + model mode +
OCR selector with labels `RapidOCR (Default, Light & Accurate)` /
`Tesseract (Backup, Light)` / `PaddleOCR (Accuracy, Heavy to run)` /
`None (Manual)` + require-plate controls; history/export plate, DO,
expected, net columns.
- `ERD.md` (Mermaid ERD, repo root; superseded `docs/do-erd.md`); tests `tests/test_do_batch.py`.
### Changed
- OCR engine default **`rapid`** (was `tesseract`) across `config.yaml`,
`DoConfig`, `empty_do_settings`, `extract_do_fields`; `ocr_engine` write
moved office-only (was both ports); OCR engine selector removed from
operator page.
- Default batch mode seed **`auto`** (was hard-coded `manual` when
`batch_mode.json` missing); `predict.py` accepts `do_manual` as operator-driven
and persists sack `unloading` for net-at-stop.