fix: gross-based batch discard, direction-correct event logs, wire CSV logger
ci / smoke (push) Canceled after 0s

This commit is contained in:
andrew committed 2026-09-28 12:08:37 +07:00
1 parent 508bee736d
commit d3357fccef
8 files changed
+200 -22

No files matched your search

+8 -3
View File
@@ -116,7 +116,11 @@ stats panel (Loading / Unloading / Net / last-3-batch history), and a bottom sta
do not add keys here.
- `src/logger.py` — `CSVLogger` appends `batch_summary.csv`
(`batch_id,start,end,duration,loading,unloading,net`) and `sack_events.csv`
(`timestamp,batch_id,sack_crossed,T-<id>,direction`).
(`timestamp,batch_id,sack_crossed,T-<id>,direction`). **Wired into
`predict.py`**: one `log_event` per crossing in both event loops, one
`log_batch` per kept batch (`finalize_batch` + manual dashboard stop);
files live in `output.dir` next to `jetson_counter.db`, all calls
best-effort (warn on failure, never crash the pipeline).
## Production pipeline (`predict.py`)
@@ -142,8 +146,9 @@ dashboard integration is file-based.)
`predict.py` reads mode every frame: `auto` → FSM branch; any other valid value
→ operator/state-file branch (persists `count`, `box_count`, `box_unloading`,
**`unloading`**). Finalize discard = **both nets 0**
(`net_sack = loading − unloading`, `net_box = box_loading − box_unloading`).
**`unloading`**). Finalize discard = **both gross counts 0** (`count == 0` and
`box_loading == 0`). Stored nets: `net_sack = loading − unloading`,
`net_box = box_loading − box_unloading`.
DO pipeline (dashboard): smartphone upload → OCR draft → edit/stage → start
gates → active batch → stop-preview soft-warn → stop → `batches` + DO columns.