# Scripts reference ## 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/--config/--model/--model-mode/ --output-dir/--output-json/--sack-conf/--truck-conf/--box-conf/--box-model/ --batch-timeout/--max-frames/--no-dashboard/--no-db` (see `predict.py --help`). Config: `config.yaml` (canonical) + `.env` (secrets/deployment). - `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 - `archive/get_coordinates.py` / `archive/get_calib_frame.py` — zone calibration (`calib_frame.jpg`, `zones.json`); `archive/capture_frame_native.py` — grab native frames (`live_frame_native.png`). - `scripts/extract_random_frames.py` — sample frames for labeling; `archive/check_*.py` (`check_20_23`, `check_20_aug`, `check_all_after`) — batch verification passes. - `archive/test_bytetrack.py`, `archive/test_track_crash.py` — tracker experiments/crash repro. ## DB / ops helpers `counter_dashboard.py` (dashboard), `scripts/check_jetson_db.py`, `archive/backup.py`, `archive/dump_db.py`, `archive/migrate_jetson_db.py`, `archive/merge_batches_20_23.py`, `archive/merge_batches_28_35.py`, `archive/update_batches.py`, `archive/diagnose_truck_jetson.py`, `deploy_to_jetson.py`, `export_model.py` / `archive/export_v4.py` (TensorRT export), `scripts/generate_guide_pdf.py` (operator guide PDF). ## Ignored at runtime (`.gitignore`) `.env`, `*.db`, state JSONs, `batch_history_folder/`, media (`*.mp4/*.jpg/*.png`), `*.engine` (rebuildable via `export_model.py`), venvs, IDE files — so the large weights, videos and local DBs in this working tree are intentionally untracked. (`models/*.pt`/`*.onnx` ARE tracked so clones are inference-ready.)