- 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
4.4 KiB
Models
Class names below are read directly from each checkpoint (YOLO(path).names).
Formats present: .pt (PyTorch) → .onnx (ONNX) → .engine (TensorRT FP16 for Jetson;
see export_model.py / export_v4.py).
Inventory
All weights live in models/ — full per-mode detector/filter matrix in
models/modelREADME.md.
| File | Classes | Task | Used by |
|---|---|---|---|
models/truck-detector.{pt,engine} |
{0: truck} |
bbox | Dedicated truck specialist; src/config.py default truck model |
models/model_karung_truk.{pt,onnx,engine} |
{0: sack, 1: truck} |
bbox | Legacy combined alias (auto-pick fallback in predict.py) |
models/v4-best.{pt,onnx,engine} (v4-best (1).pt = duplicate copy) |
{0: sack, 1: truck} |
bbox | Combined model (Modes A/B/C/D truck; Modes A/C sack) |
models/karung-dimuat-detection-di-feedmill-yolo26n-seg-200e.{pt,onnx,engine} |
{0: person, 1: sack} |
seg | Person-exclusion seg model (legacy predict_new.py) |
models/yolo11n-bbox-100ep-sack+box-20260909-best.{pt,onnx,engine} |
{0: sack, 1: box} |
bbox | Unified sack+box (Modes B/C/D) |
models/best.{pt,onnx,engine} |
{0: sack} |
seg | Sack-only specialist (Mode D sack; src/config.py default) |
Model registry for the rpo_iki engine: rpo_iki/configs/model_registry.json
(currently pins karung-dimuat-seg-200e, mAP50-mask 0.899, val MAE 0.67).
Support matrix
1. Multiple specialized models — YES (current design)
Two dedicated models run in parallel on the same frames:
- Truck model (
truck-detector.pt) → presence, ROI, counting-line placement, batch lifecycle. Runs every 15th frame insrc/main.py:130-145. - Sack model (seg or combined) → per-frame track + count (
src/main.py:163-169). predict_new.py:184-185hardcodes the same duo (TRUCK_MODEL_PATH,SACK_MODEL_PATH);rpo_iki/count.py:1136-1143prefers a dedicatedtruck-detector.ptfor dynamic truck calibration.
2. Multiple classes within a single model — YES (filter-then-count)
- Combined models expose 2 classes (
sack+truck,person+sack,sack+box). - Consumers select what they need and ignore the rest:
SackDetector._parse(src/detection.py:34): keepsname == "sack"only.ByteTrackTracker._parse(src/tracking.py:62): keeps("sack", "truck").predict_new.py:379-389,571-579: auto-detects karung/person class IDs by name substring, tracksclasses=[person, sack], draws persons in red and skips them in counting.rpo_iki/count.py(SACK_CLASS_ID = 1): counts one class; falls back to the same model'struck_class_id=2when no dedicated truck model exists.
- Rule of thumb: only the sack/karung class is ever counted; other classes are auxiliary (ROI, visualization, exclusion).
3. Hybrid multi-model — YES (modes A/B/C/D, default C)
-
predict.py --model-mode(orMODEL_MODEenv / dashboard/api/batch/mode):Mode Truck Sack Box A v4 (sack+truck) v4 — B v4 (truck-only) yolo11n yolo11n C (default) v4 (sack+truck) v4 yolo11n (box-only) -
All weights load as
.engine(verified coexist: 2 engines ~16 MB, 3 engines ~24 MB peak of 7.6 GB). Dashboard switches persist tobatch_mode.jsonand apply on next service restart (models load once at startup). -
Counting:
MultiClassLineCounter= dualLineCrossCounters on one shared line; events tagged withclass_name; sack and box track IDs live in separate spaces.
Choosing / swapping a model
src/pipeline:MODEL_SACK_PATH/MODEL_TRUCK_PATHenv vars (defaults:./models/best.engine/./models/truck-detector.engine; seeconfiguration.md) or--sourcefor files.predict.py:config.yamlmodels.pathsis canonical (per-mode presets inmodels.modes, per-class conf/iou/min_bbox inmodels.detection_params). Legacy overrides still work:MODEL_PATHenv or--model(single v4 file),--box-model(yolo11n weights),--model-mode/ deprecatedMODEL_MODEenv for the preset,--sack-conf/--truck-conf/--box-conffor thresholds.- TensorRT:
python export_model.py models/<name>.pt(FP16.engine) on the Jetson; production loads.engineonly (missing.enginefalls back to the.ptsibling with a warning).deploy_to_jetson.pysyncsconfig.yaml+ the.enginefiles.