docs: add CHANGELOG.md, sync all guides with config.yaml migration
ci / smoke (push) Canceled after 0s

- CHANGELOG.md (Keep-a-Changelog, dated entries from git history)
- README: production pipeline framing, config table, layout, flags, changelog link
- configuration.md: legacy env overrides, zones geometry-only, archive paths
- scripts.md: current flags, correct archive/ paths, tracked vs ignored weights
- deployment.md: config.yaml in sync list, model_mode location, /api/model-modes
- models.md + architecture.md: config.yaml pointers, deprecated src/config.py
This commit is contained in:
andrew committed 2026-09-17 12:04:56 +07:00
1 parent 2d9c66cbb6
commit 0467e0ce68
7 files changed
+164 -62

No files matched your search

+17 -11
View File
@@ -11,7 +11,7 @@ persists results to SQLite/CSV, and serves a live Flask dashboard.
> (`karung` = sack/bag, `truk` = truck, `muat` = load). Class names inside the YOLO
> models are English (`sack`, `box`, `truck`, `person`).
## Pipeline (v3, `src/`)
## Pipeline (production, `predict.py`)
```
Frame → TruckDetect → ROI → SackTrack → Stabilize → Count → Dashboard / DB
@@ -39,16 +39,17 @@ cp .env.example .env # then edit RTSP_URL / paths
# Dev / offline (any flags omitted = production defaults):
python predict.py --source path/to/video.mp4 --env .env
python predict.py --source vid.mp4 --no-dashboard --no-db --output-dir /tmp/out --max-frames 500
python predict.py --help # all flags: --model/--output-json/--sack-conf/--truck-conf/--box-conf/--batch-timeout
python predict.py --help # all flags: --config/--model/--model-mode/--output-json/--sack-conf/--truck-conf/--box-conf/--box-model/--batch-timeout
# Production (Jetson systemd, zero flags):
sudo systemctl restart karung-counter karung-counter-dashboard
```
Production on the Jetson runs `predict.py` + `counter_dashboard.py` as systemd services
(see [`docs/deployment.md`](docs/deployment.md)) — the `src/` package is the clean
re-implementation; `predict.py` / `predict_new.py` are the deployed legacy pipelines that
add SQLite persistence, live-frame publishing to `/dev/shm`, and zone polygons.
(see [`docs/deployment.md`](docs/deployment.md)) — `predict.py` is the production
pipeline (SQLite persistence, live-frame publishing to `/dev/shm`, zone polygons);
the `src/` package is the shared detection/tracking/counting library it builds on
(the old v3 `src/main.py` loop is deprecated). Retired experiments live in `archive/`.
## Models
@@ -72,10 +73,10 @@ support matrix.
| File | Purpose |
|---|---|
| `.env` (see `.env.example`) | DB paths, camera name, object label, cutoff time, ports, RTSP URL |
| `zones.json` | Calibrated pallet / truck / counting polygons + tuning knobs |
| `config.yaml` | Canonical config: stream, model modes/presets, counting knobs, batch, output paths, camera |
| `.env` (see `.env.example`) | Secrets + deployment only: RTSP URL, dashboard host/ports/secret/site |
| `zones.json` | Calibrated pallet / truck / counting polygons + left/right limits (geometry only) |
| `cfg/tracker.yaml` | FastTrack/ByteTrack occlusion tuning (buffer 60, re-ID windows) |
| `rpo_iki/configs/` | Alternate counting engine configs (areas, params, model registry, cameras) |
See [`docs/configuration.md`](docs/configuration.md) for every variable.
@@ -84,23 +85,27 @@ See [`docs/configuration.md`](docs/configuration.md) for every variable.
Pages in `templates/`: `monitoring.html`, `operator.html` (manual batch start/stop),
`history.html`, `analytics.html`. JSON APIs under `/api/*` (live video MJPEG, current/
previous batch, summary, daily data, CSV/Excel export). Data source:
`jetson_counter.db` + `current_batch.json` (+ `batch_mode.json`).
`jetson_counter.db` + `current_batch.json` (+ `batch_mode.json` for the
manual/auto batch switch; the model mode lives in `config.yaml`).
## Repository layout
```
src/ Shared library (streaming, detection, tracking, stabilizer,
truck_roi, counting, batch, dashboard, logger, config, main)
truck_roi, counting, batch, dashboard, logger, config_loader, main)
config.yaml Canonical config (stream/models/counting/batch/output/camera)
cfg/tracker.yaml Tracker tuning
predict.py Single entrypoint: production service + dev CLI (see --help)
counter_dashboard.py Flask dashboard + APIs | templates/*.html pages
tests/ Pytest smoke tests (counting, batch, config, config_loader)
archive/ Retired experiments (predict_new.py, rpo_iki/, simple_predict.py,
check/merge/test scripts) — history preserved, not imported
export_model.py Export .pt → TensorRT .engine (FP16) | export_v4.py variant
deploy_to_jetson.py Paramiko sync + service restart
*.service systemd units (counter, dashboard, mediamtx)
zones.json Calibrated zones
zones.json Calibrated zone geometry
batch_history_folder/ Per-batch JSON reports
CHANGELOG.md Release history (dated entries, Keep-a-Changelog style)
```
Script-by-script reference: [`docs/scripts.md`](docs/scripts.md).
@@ -112,3 +117,4 @@ Script-by-script reference: [`docs/scripts.md`](docs/scripts.md).
- [`docs/configuration.md`](docs/configuration.md) — all config files/variables
- [`docs/deployment.md`](docs/deployment.md) — Jetson services, TensorRT, deploy flow
- [`docs/scripts.md`](docs/scripts.md) — entry points & utility scripts
- [`CHANGELOG.md`](CHANGELOG.md) — release history