chore: align detection thresholds with FCP (sack conf 0.30, box area 1000)

This commit is contained in:
jetson committed 2026-10-27 14:53:23 +07:00
1 parent b396b0ded0
commit 3c354c6d81
2 files changed
+21 -6

No files matched your search

+4 -4
View File
@@ -4,15 +4,15 @@
# Missing keys fall back to built-in defaults — partial files are fine.
detection:
sack_conf: 0.4 # detector confidence for sack
sack_conf: 0.3 # detector confidence for sack (FCP config.yaml:87 — reduce undercounting)
box_conf: 0.35 # detector confidence for box
truck_conf: 0.45 # truck detector confidence
# Per-class minimum bbox area (px^2) — authored in platform's 1280x720
# reference space; pipeline scales to actual frame size (physical parity).
# Per-class minimum bbox area (px^2) — literal values in the 1280x720
# analysis frame (scale factor is 1.0, so no rescaling happens).
min_bbox_area:
sack: 1500
box: 1500
box: 1000
truck: 5000
iou:
+17 -2
View File
@@ -74,7 +74,7 @@ def test_repo_config_yaml_exists_and_parses():
assert cfg["detection"]["truck_conf"] == 0.45
assert cfg["iou"]["suppress_sack_box"] == 0.4
assert cfg["min_bbox_area"]["sack"] == 1500
assert cfg["min_bbox_area"]["box"] == 1500
assert cfg["min_bbox_area"]["box"] == 1000
assert cfg["min_bbox_area"]["truck"] == 5000
for key in ("detect_interval", "sup_det_interval", "truck_det_interval", "preview_every_n"):
@@ -90,7 +90,9 @@ def test_repo_config_yaml_exists_and_parses():
def test_get_accessor():
assert get("detection", "sack_conf") == DEFAULTS["detection"]["sack_conf"]
# config.yaml is the source of truth; DEFAULTS is only the fallback for
# missing keys, so the accessor must track config.yaml, not DEFAULTS.
assert get("detection", "sack_conf") == load_config()["detection"]["sack_conf"]
def test_config_path_points_at_repo_root():
@@ -120,3 +122,16 @@ def test_truck_roi_tracker_accepts_sticky_iou():
t = TruckROITracker(frame_width=100, frame_height=100, sticky_iou=0.5)
assert t._sticky_iou == 0.5
# ── FCP parity (karung_counter_semarang) ───────────────────────────────
def test_detection_thresholds_match_fcp():
cfg = load_config()
assert cfg["detection"]["sack_conf"] == 0.30
assert cfg["detection"]["box_conf"] == 0.35
assert cfg["detection"]["truck_conf"] == 0.45
assert cfg["min_bbox_area"]["sack"] == 1500
assert cfg["min_bbox_area"]["box"] == 1000
assert cfg["min_bbox_area"]["truck"] == 5000