refactor: single predict.py entrypoint (production + CLI), archive experiments
ci / smoke (push) Canceled after 0s
ci / smoke (push) Canceled after 0s
This commit is contained in:
1 parent
beb9c9fb6b
commit
52d3127302
36 files changed
+161
-48
No files matched your search
+13
-7
@@ -112,14 +112,20 @@ stats panel (Loading / Unloading / Net / last-3-batch history), and a bottom sta
|
||||
(`batch_id,start,end,duration,loading,unloading,net`) and `sack_events.csv`
|
||||
(`timestamp,batch_id,sack_crossed,T-<id>,direction`).
|
||||
|
||||
## Legacy pipelines (same concepts, different implementation)
|
||||
## Production pipeline (`predict.py`)
|
||||
|
||||
Same stage order as v3 but implemented with shapely polygons (`zones.json`:
|
||||
pallet/truck/counting), visual-similarity + Re-ID registries, static-frame debounce,
|
||||
SQLite persistence, and live-frame publishing to `/dev/shm` for the dashboard. Uses the
|
||||
repo `src/` modules (imports at `predict.py`). Zero CLI flags = systemd behaviour;
|
||||
dev flags (`--source`, `--no-dashboard`, …) are additive overrides — see
|
||||
`predict.py --help` and `docs/scripts.md`. (`init_db()` and the `http.server` imports
|
||||
are dead code — persistence goes through `finalize_batch`/`save_active_batch_state`,
|
||||
dashboard integration is file-based.)
|
||||
|
||||
## Retired (`archive/`, not imported)
|
||||
|
||||
- **`predict.py`** — production Jetson pipeline. Same stage order but implemented with
|
||||
shapely polygons (`zones.json`: pallet/truck/counting), visual-similarity + Re-ID
|
||||
registries, static-frame debounce, SQLite persistence, live-frame publishing to
|
||||
`/dev/shm`, and an embedded HTTP status server. Uses the repo `src/` modules
|
||||
(imports at `predict.py:19-25`).
|
||||
- **`predict_new.py`** — duo-model state machine (`WAITING_FOR_TRUCK → COUNTING_SACKS →
|
||||
TRUCK_LEAVING`) with hardcoded default zones, perspective-area filtering and HUD.
|
||||
TRUCK_LEAVING`) with hardcoded default zones, perspective filtering and HUD.
|
||||
- **`rpo_iki/`** — alternate geometric engine (`count.py`: `LineCounter` with approach
|
||||
depth, burst/cooldown dedup, blind-truck overlay) + `predict_rpo_iki.py` runner.
|
||||
+12
-12
@@ -1,17 +1,17 @@
|
||||
# Scripts reference
|
||||
|
||||
## Entry points (pipelines)
|
||||
- `predict.py` — **production** Jetson pipeline: combined sack+truck model + repo `src/`
|
||||
modules, shapely zones, visual-similarity/Re-ID debounce, SQLite, live-frame publish,
|
||||
embedded HTTP status. Run by `karung-counter.service`.
|
||||
- `predict_new.py` — duo-model state machine (`WAITING_FOR_TRUCK → COUNTING_SACKS →
|
||||
TRUCK_LEAVING`), hardcoded zones + `zones.json` override, perspective filtering, HUD.
|
||||
Standalone experiment path.
|
||||
- `src/main.py` — clean v3 pipeline (`python -m src.main --source VID --env .env`).
|
||||
- `rpo_iki/predict_rpo_iki.py` — runner for the alternate `rpo_iki/count.py` geometric
|
||||
engine (approach-depth + burst/cooldown dedup, blind-truck overlay).
|
||||
- `simple_predict.py` — minimal CPU demo: `best.pt`, stride 3, `imgsz=320`, OpenCV window.
|
||||
- `ini.py` — tiny import/smoke check.
|
||||
## Entry points
|
||||
- `predict.py` — **single entrypoint: production service (zero flags) + dev CLI.**
|
||||
Combined sack+truck model + repo `src/` modules, shapely zones,
|
||||
visual-similarity/Re-ID debounce, SQLite, live-frame publish. Run by
|
||||
`karung-counter.service`. Flags: `--source/--env/--model/--output-dir/
|
||||
--output-json/--sack-conf/--truck-conf/--box-conf(placeholder)/
|
||||
--batch-timeout/--max-frames/--no-dashboard/--no-db` (see `predict.py --help`).
|
||||
- `src/main.py` — deprecated shim: prints a pointer to `predict.py`, still runs the
|
||||
old v3 loop for backward compat.
|
||||
- `archive/` — retired: `predict_new.py` (duo-model state machine),
|
||||
`rpo_iki/` (alternate geometric engine + `predict_rpo_iki.py`), `simple_predict.py`
|
||||
(minimal CPU demo), `ini.py`, check/merge/test scripts. Not imported anywhere.
|
||||
|
||||
## Calibration & data tools
|
||||
- `get_coordinates.py` / `get_calib_frame.py` — zone calibration (`calib_frame.jpg`,
|
||||
|
||||
Reference in new issue
Block a user