fix(auto-batch): truck presence needs 50% polygon overlap, config-authoritative timers
ci / smoke (push) Canceled after 0s

Big docked truck bbox rests 1-2px past detection_polygon bottom edge, so
100%-containment made truck_in_area flicker False -> batch 15 split (6+276)
on 2026-09-29 while the truck never left. v4-best.engine detected it at
conf 0.92-0.97 in every replayed frame (no model miss, no retraining).

- truck gate: frac_inside >= 0.5 instead of contains(bbox)
- batch.truck_gone_tolerance_seconds (new, 30) authoritative; drop the
  hardcoded batch_mgr._truck_gone_tolerance = 30.0 override;
  batch.timeout_seconds documented as sack-idle pause only
- [TRUCK] truck_in_area transition debug log
This commit is contained in:
andrew committed 2026-09-30 09:40:15 +07:00
1 parent 12f921f81c
commit f621ae86fb
8 files changed
+74 -9

No files matched your search

+5
View File
@@ -42,6 +42,9 @@ def test_repo_config_loads_and_validates(repo_config_path):
def test_do_block_and_batch_default_mode(repo_config_path):
cfg = load_config(repo_config_path)
assert cfg.batch.default_mode == "auto"
# timeout_seconds = sack-idle (pause); truck_gone_tolerance_seconds = finalize
assert cfg.batch.timeout_seconds == 20.0
assert cfg.batch.truck_gone_tolerance_seconds == 30.0
assert cfg.do.enabled is True
assert cfg.do.require_do is True
assert cfg.do.require_plate is False
@@ -61,9 +64,11 @@ def test_do_block_missing_uses_defaults(tmp_path):
raw = yaml.safe_load(p.read_text())
del raw["do"]
raw["batch"].pop("default_mode", None)
raw["batch"].pop("truck_gone_tolerance_seconds", None)
p.write_text(yaml.safe_dump(raw))
cfg = load_config(p)
assert cfg.batch.default_mode == "auto"
assert cfg.batch.truck_gone_tolerance_seconds == 30.0
assert cfg.do.enabled is True
assert cfg.do.ocr.engine == "rapid"
assert cfg.do.retention_days == 7