Files
karung-counting-feedmill-se…/models/modelREADME.md
T
andrew 2d9c66cbb6
ci / smoke (push) Canceled after 0s
feat: unified config.yaml with extensible model presets (A-D data-driven, E/F ready)
- config.yaml canonical for stream/models/counting/batch/output/camera
- models.modes hold engines+class filters only; conf/iou/min_bbox in detection_params
- predict.py derives tracker roles structurally (no per-mode branching)
- dashboard mode switch validates + persists atomically to config.yaml
- .env keeps secrets/deployment only; zones.json geometry; tracker.yaml hyperparams
- batch_mode.json keeps manual/auto batch mode; legacy model_mode ignored w/ warning
- src/detection+tracking gain iou param (default 0.7 = no behavior change)
2026-09-17 11:44:45 +07:00

61 lines
3.4 KiB
Markdown

# Model Zoo
All weights live here. Three formats coexist per model:
- `.pt` — PyTorch checkpoint (training source, dev, re-export)
- `.onnx` — ONNX intermediate (export pipeline artifact)
- `.engine` — TensorRT FP16, **what production loads on the Jetson**
Class names below are read directly from each checkpoint (`YOLO(path).names`).
## Inventory
| File | Classes | Task | Role |
|---|---|---|---|
| `truck-detector.{pt,engine}` | `{0: truck}` | bbox | Dedicated truck specialist (ROI, batch lifecycle) |
| `v4-best.{pt,onnx,engine}` (`v4-best (1).pt` = duplicate copy) | `{0: sack, 1: truck}` | bbox | Combined sack+truck (Modes A/B/C/D truck; Modes A/C sack) |
| `model_karung_truk.{pt,onnx,engine}` | `{0: sack, 1: truck}` | bbox | Legacy combined alias (auto-pick fallback) |
| `yolo11n-bbox-100ep-sack+box-20260909-best.{pt,onnx,engine}` | `{0: sack, 1: box}` | bbox | Unified sack+box (Modes B/C/D) |
| `best.{pt,onnx,engine}` | `{0: sack}` | seg | Sack-only specialist (Mode D sack) |
| `karung-dimuat-detection-di-feedmill-yolo26n-seg-200e.{pt,onnx,engine}` | `{0: person, 1: sack}` | **seg** | Person-exclusion seg model (legacy `predict_new.py`) |
## Model Modes (`predict.py --model-mode` / `config.yaml models.active_mode`, default **C**)
Modes are DATA in `config.yaml` `models.modes` — each preset declares engines
(path key + contributed classes) and class filters only. Per-class
conf/iou/min_bbox live in `models.detection_params` (shared across modes).
Add E/F/... in YAML with no code change; `predict.py` derives tracker roles
structurally and the dashboard lists new modes automatically.
Counting filters by **class name, not ID** (`BaseDetector(class_filter)` in
`src/detection.py`; tracker allow-list in `src/tracking.py`; dual counters in
`src/counting.py`). "Filtered out" = class exists in the checkpoint but is
dropped before tracking/counting.
| Mode | Truck detector (filter) | Sack detector (filter) | Box detector (filter) |
|---|---|---|---|
| **A** | `v4-best.engine` → keep `truck`, drop `sack` | `v4-best.engine` (shared) → keep `sack`, drop `truck` | — (no box counting) |
| **B** | `v4-best.engine` → keep `truck`, drop `sack` | `yolo11n-….engine` → keep `sack`, drop `box` | `yolo11n-….engine` (shared with sack) → keep `box`, drop `sack` |
| **C** (default) | `v4-best.engine` → keep `truck`, drop `sack` | `v4-best.engine` (shared) → keep `sack`, drop `truck` | `yolo11n-….engine` → keep `box`, drop `sack` |
| **D** | `v4-best.engine` → keep `truck`, drop `sack` | `best.engine` → `sack` only (nothing to drop) | `yolo11n-….engine` → keep `box`, drop `sack` |
Notes:
- Mode B loads **one** yolo11n handle shared by the sack and box paths (single
tracker, single track-ID space); modes C/D run a dedicated box tracker
(separate ID space + own stabilizer, so sack/box IDs never collide).
- All `.engine` files verified to coexist: 2 engines ~16 MB, 3 engines ~24 MB
peak of 7.6 GB Jetson GPU. If `.pt` is ever used, load PyTorch models **before**
TensorRT engines or CUDA init fails.
- Mode switches via dashboard persist to `batch_mode.json` and apply on next
`karung-counter` restart (models load once at startup).
## Exporting
```bash
python export_model.py models/<name>.pt # → FP16 .engine next to the .pt
```
## Deploy
`deploy_to_jetson.py` syncs the `.engine` files only (what production loads);
`.pt`/`.onnx` stay local for dev/export.