feat: DO-gated manual batch mode (auto default, office-only switches)
ci / smoke (push) Canceled after 0s

This commit is contained in:
andrew committed 2026-09-24 15:45:12 +07:00
1 parent 735e0c7594
commit 0efcfa45b8
20 files changed
+3128 -209

No files matched your search

+12 -7
View File
@@ -27,14 +27,20 @@ Indonesian (`karung`=sack, `truk`=truck); YOLO class names are English
## Gotchas
- **Unified config**: `config.yaml` is canonical (stream/models/counting/batch/
- **Unified config**: `config.yaml` is canonical (stream/models/counting/batch/do/
output/camera via `src/config_loader.py`); `.env` holds secrets + deployment
only (`RTSP_URL`, dashboard host/ports/secret/site); `zones.json` holds
geometry (polygons + left/right limits — knob keys there are ignored, warned);
`cfg/tracker.yaml` holds tracker hyperparams. `src/config.py` (v3 keys like
`LOCAL_RTSP`) is deprecated — don't add keys there. Dashboard mode switches
write `config.yaml` `models.active_mode` (atomic, manual restart to apply);
`batch_mode.json` keeps only manual/auto batch mode.
`batch_mode.json` keeps only batch flow mode (`auto`|`do_manual`|`manual`,
default seed `batch.default_mode: auto`).
**Port split:** `mode` / `model_mode` / `require_plate` / `require_do` POSTs →
office `:5721` only (403 on `:5000`); **`ocr_engine` POST both ports** (synced
via `GET /api/do/settings`). Discard batch only if **both** `net_sack==0` and
`net_box==0`. DO helpers: `src/do_batch.py`, OCR: `src/do_ocr.py`;
ERD: `docs/do-erd.md`.
- **Counting filters by class name, not ID**: `SackDetector`/`BoxDetector`/
`TruckDetector` filter via `BaseDetector(class_filter)` (`src/detection.py`);
tracker keeps `("sack", "truck", "box")` (`src/tracking.py`); counting uses
@@ -51,11 +57,10 @@ Indonesian (`karung`=sack, `truk`=truck); YOLO class names are English
- Counting trigger is the bbox **top edge (y1)** vs a truck-anchored line band
(`src/counting.py`, `src/truck_roi.py`); truck detect runs every 15th frame only.
- **Tests:** `python -m pytest tests/ -q` (smoke tests for `counting`, `batch`,
`config` — pure-Python, no cv2/ultralytics needed). CI (`.github/workflows/ci.yml`)
installs only `numpy python-dotenv pytest` + runs pytest + `compileall`.
Deps: `requirements.txt` (unpinned; **never** pip-install torch from PyPI on the
Jetson — use the NVIDIA wheels already on device). For visual checks run on a video
file (`--source`), not the live RTSP.
`config`, `do_batch` — pure-Python; Flask API tests skip if flask/openpyxl
missing). Deps: `requirements.txt` (unpinned; **never** pip-install torch from
PyPI on the Jetson — use the NVIDIA wheels already on device). For visual checks
run on a video file (`--source`), not the live RTSP.
- **Don't commit state**: `.gitignore` excludes `*.engine` (rebuildable),
`*.mp4/*.jpg/*.png`, `*.db`, `.env`, `batch_history_folder/`. Videos and local
DBs already sit untracked in the working tree — leave them alone.