docs: new repo URL (andrew/...), requirements.txt, pytest smoke tests + CI
This commit is contained in:
1 parent
0235a0f597
commit
a568ebb182
10 files changed
+403
-1
No files matched your search
@@ -0,0 +1,49 @@
|
||||
# Deployment (Jetson)
|
||||
|
||||
Repo: `https://git.proit.id/andrew/karung-counting-feedmill-semarang`
|
||||
(`git remote set-url origin <url>` after the ervan → andrew transfer).
|
||||
|
||||
## Systemd services
|
||||
|
||||
| Unit | Runs | After |
|
||||
|---|---|---|
|
||||
| `karung-counter.service` | `/usr/bin/python3 predict.py` (cwd `/home/jetson/karung`, `QT_QPA_PLATFORM=offscreen`) | `network.target` |
|
||||
| `karung-counter-dashboard.service` | `/usr/bin/python3 counter_dashboard.py` | `network.target` + counter |
|
||||
| `mediamtx.service` | MediaMTX restream (see `zones.json:external_stream_url`) | — |
|
||||
|
||||
Both app units: `Restart=always`, `RestartSec=5`, load `EnvironmentFile=/home/jetson/karung/.env`.
|
||||
|
||||
```bash
|
||||
sudo systemctl enable --now karung-counter karung-counter-dashboard
|
||||
sudo systemctl restart karung-counter karung-counter-dashboard
|
||||
systemctl status karung-counter karung-counter-dashboard --no-pager
|
||||
```
|
||||
|
||||
## Deploy flow (`deploy_to_jetson.py`)
|
||||
Paramiko sync of `templates/{operator,monitoring,base}.html`, `counter_dashboard.py`,
|
||||
`predict.py`, `.env` → `192.168.192.96:/home/jetson/karung/`, then restarts both
|
||||
services and checks status + ports (5000/5721). Run from the dev machine.
|
||||
|
||||
## TensorRT export
|
||||
On the Jetson (needs CUDA): `python3 export_model.py` exports
|
||||
`karung-dimuat-detection-di-feedmill-yolo26n-seg-200e.pt` → FP16 `.engine`;
|
||||
`export_v4.py` is the `v4-best` variant. Point `MODEL_PATH` / loader constants at the
|
||||
`.engine` afterwards.
|
||||
|
||||
## Runtime data files
|
||||
- SQLite `jetson_counter.db`: `batches(counting_date, batch_number, camera_name,
|
||||
object_label, count, start/end_time)`, `daily_summaries(...)`.
|
||||
- `current_batch.json` (crash recovery), `batch_mode.json` (manual/auto),
|
||||
`batch_history_folder/batch_<ts>.json` + `hasil_perhitungan.json` (per-batch reports).
|
||||
- Live frame: `/dev/shm/jetson-counter/live_frame.jpg` (written every 2nd frame,
|
||||
consumed by `/api/live-video` MJPEG).
|
||||
- Helpers: `backup.py`, `dump_db.py`, `check_jetson_db.py`, `migrate_jetson_db.py`,
|
||||
`merge_batches_*.py`, `update_batches.py`, `diagnose_truck_jetson.py`.
|
||||
|
||||
## Dashboard (`counter_dashboard.py`)
|
||||
Pages: `/` + `/monitoring`, `/operator` (manual start/stop, mode switch),
|
||||
`/history`, `/analytics`. Key APIs: `/api/live-video`, `/api/current-batch`,
|
||||
`/api/previous-batch`, `/api/batch/{start,stop,mode}`, `/api/summary`,
|
||||
`/api/daily-data`, `/api/day-detail/<date>`, `/api/recent-batches`,
|
||||
`/api/available-dates`, `/api/export-daily-csv`, `/api/export-day-csv/<date>`
|
||||
(CSV + Excel via openpyxl).
|
||||
Reference in new issue
Block a user