Reset Error

This commit is contained in:
proitlab committed 2026-08-03 15:51:43 +07:00
1 parent 2437566712
commit 75587ddae2
3 files changed
+27 -11

No files matched your search

+5 -2
View File
@@ -4,10 +4,11 @@
- **Edge AI counter**: RTSP camera → YOLO RKNN (NPU) → tracking → line-crossing → SQLite + JSON state → Flask dashboard.
- **2 counter scripts**, only 1 deployed:
- `counter_live.py` — Jetson TensorRT variant (CUDA, NOT used on RK3588).
- `counter_live.py` — Jetson TensorRT artifact (CUDA, NOT used on RK3588).
- **`counter_live_rknn_bytetrack.py`** — RK3588 with ByteTrack. **This is what systemd runs.** Reference for C++ port.
- `batch_store.py` — shared SQLite persistence + batch state machine.
- `counter_dashboard.py` — Flask dashboard on port 5000, same DB.
- `recounting_dashboard.py` — Flask recounting dashboard on port 5002, consumes live + recount APIs.
## No build / test / lint
@@ -40,11 +41,13 @@ PYTHONNOUSERSITE=1 venv/bin/python counter_dashboard.py
- Service user is **`root`**, not `jetson` (despite README saying otherwise).
- Two systemd units: `bytetrack-counter.service` + `bytetrack-counter-dashboard.service`.
- `counter_live.py` (TensorRT) is Jetson-only and won't work on RK3588.
- **Reset flow**: `POST /api/reset` → deletes state JSON + touches `{SHM_DIR}/.reset`. `batch_store._check_reset_signal()` watches this marker and clears in-memory state on next crossing.
## Code conventions
- All config lives in `.env` (dotenv), read via `os.getenv()` at module top-level in each script.
- The 3 counter scripts duplicate ~80% of each other (drawing helpers, batch loop, etc). Changes to logic may need replication across variants.
- The 2 counter scripts share drawing/batch helpers. `counter_live_rknn_bytetrack.py` is the reference for C++ port.
- `batch_store.py` has its own threading (cutoff watcher, batch timeout timer) — thread safety is via a single `state_lock`.
- The dashboard re-creates DB tables on startup (`_ensure_db()`) independently from `batch_store.py`.
- No formal version tracking exists anywhere in this codebase.
- Dashboard template selectable via `DASHBOARD_TEMPLATE` env var — supports `dashboard.html`, `dashboard_lamborghini.html`, `dashboard_tesla.html`.