feat(zones): ship FCP's calibrations in the 1280x720 analysis space
This commit is contained in:
1 parent
957ab0297d
commit
7b3c5be2a9
2 files changed
+42
-18
No files matched your search
+23
-17
@@ -303,20 +303,20 @@ def test_build_static_roi_without_count_line_has_no_x_window():
|
||||
# ── Shipped preset (FCP's calibration in the 1280x720 analysis space) ──────
|
||||
|
||||
|
||||
def test_shipped_default_preset_matches_fcp_7beb820():
|
||||
"""The shipped zones.json carries FCP's calibration in 1280x720."""
|
||||
def test_shipped_default_preset_matches_fcp_live_calibration():
|
||||
"""The default preset is FCP's 2026-11-11 calibration in 1280x720."""
|
||||
zone = {
|
||||
"truck_area": [[400, 257], [406, 717], [936, 719], [921, 229]],
|
||||
"counting_area": [[383, 33], [391, 718], [945, 717], [931, 33]],
|
||||
"truck_area": [[398, 152], [359, 720], [876, 720], [949, 201]],
|
||||
"counting_area": [[362, 157], [306, 720], [912, 720], [979, 169]],
|
||||
"palet": [[408, 419], [969, 420], [972, 716], [405, 714]],
|
||||
"count_line": {"x_start": 385, "x_end": 934, "y": 220},
|
||||
"count_line": {"x_start": 423, "x_end": 939, "y": 182},
|
||||
"reference_resolution": [1280, 720],
|
||||
}
|
||||
roi = build_static_roi(zone, video_w=1280, video_h=720)
|
||||
assert (roi.x1, roi.y1, roi.x2, roi.y2) == (400, 229, 936, 719)
|
||||
assert roi.line_y == 220
|
||||
assert roi.line_x_start == 385
|
||||
assert roi.line_x_end == 934
|
||||
assert (roi.x1, roi.y1, roi.x2, roi.y2) == (359, 152, 949, 720)
|
||||
assert roi.line_y == 182
|
||||
assert roi.line_x_start == 423
|
||||
assert roi.line_x_end == 939
|
||||
assert roi.confidence == 1.0
|
||||
assert roi.fixed is True
|
||||
|
||||
@@ -324,8 +324,8 @@ def test_shipped_default_preset_matches_fcp_7beb820():
|
||||
def test_shipped_default_preset_polygons_are_usable():
|
||||
"""Both shipped polygons are valid and the counting one covers the scene."""
|
||||
zone = {
|
||||
"truck_area": [[400, 257], [406, 717], [936, 719], [921, 229]],
|
||||
"counting_area": [[383, 33], [391, 718], [945, 717], [931, 33]],
|
||||
"truck_area": [[398, 152], [359, 720], [876, 720], [949, 201]],
|
||||
"counting_area": [[362, 157], [306, 720], [912, 720], [979, 169]],
|
||||
"reference_resolution": [1280, 720],
|
||||
}
|
||||
counting = build_counting_polygon(zone, 1280, 720)
|
||||
@@ -335,12 +335,18 @@ def test_shipped_default_preset_polygons_are_usable():
|
||||
assert counting.contains(Point(600, 300))
|
||||
|
||||
|
||||
def test_repo_zones_json_ships_the_fcp_calibration():
|
||||
def test_repo_zones_json_ships_the_fcp_calibrations():
|
||||
"""Guards the shipped file, not an inline fixture."""
|
||||
repo_zones = os.path.join(os.path.dirname(os.path.dirname(__file__)), "zones.json")
|
||||
cfg = load_zone_config(repo_zones)
|
||||
zone = cfg["presets"]["default"]
|
||||
assert zone["reference_resolution"] == [1280, 720]
|
||||
assert zone["count_line"] == {"x_start": 385, "x_end": 934, "y": 220}
|
||||
assert zone["truck_area"] == [[400, 257], [406, 717], [936, 719], [921, 229]]
|
||||
assert zone["counting_area"] == [[383, 33], [391, 718], [945, 717], [931, 33]]
|
||||
assert cfg["active_preset"] == "default"
|
||||
live = cfg["presets"]["default"]
|
||||
assert live["reference_resolution"] == [1280, 720]
|
||||
assert live["count_line"] == {"x_start": 423, "x_end": 939, "y": 182}
|
||||
assert live["truck_area"] == [[398, 152], [359, 720], [876, 720], [949, 201]]
|
||||
assert live["counting_area"] == [[362, 157], [306, 720], [912, 720], [979, 169]]
|
||||
legacy = cfg["presets"]["fcp-2026-10-15"]
|
||||
assert legacy["reference_resolution"] == [1280, 720]
|
||||
assert legacy["count_line"] == {"x_start": 385, "x_end": 934, "y": 220}
|
||||
assert legacy["truck_area"] == [[400, 257], [406, 717], [936, 719], [921, 229]]
|
||||
assert legacy["counting_area"] == [[383, 33], [391, 718], [945, 717], [931, 33]]
|
||||
+19
-1
@@ -1,6 +1,24 @@
|
||||
{
|
||||
"presets": {
|
||||
"default": {
|
||||
"truck_area": [[398, 152], [359, 720], [876, 720], [949, 201]],
|
||||
"counting_area": [[362, 157], [306, 720], [912, 720], [979, 169]],
|
||||
"palet": [[408, 419], [969, 420], [972, 716], [405, 714]],
|
||||
"count_line": {"x_start": 423, "x_end": 939, "y": 182},
|
||||
"reference_resolution": [1280, 720],
|
||||
"left_limit": 0.27578,
|
||||
"right_limit": 0.72578,
|
||||
"duplicate_circle_radius": 30,
|
||||
"min_valid_area": 15000,
|
||||
"jarak_toleransi_duplikat": 30,
|
||||
"max_reid_transit_distance": 400,
|
||||
"circle_stay_timeout_sec": 10.0,
|
||||
"inference_stride": 2,
|
||||
"confirm_delay_sec": 0.5,
|
||||
"exit_confirm_delay_sec": 6.0,
|
||||
"description": "FCP 95c031b calibration (2026-11-11), 1280x720 analysis space"
|
||||
},
|
||||
"fcp-2026-10-15": {
|
||||
"truck_area": [[400, 257], [406, 717], [936, 719], [921, 229]],
|
||||
"counting_area": [[383, 33], [391, 718], [945, 717], [931, 33]],
|
||||
"palet": [[408, 419], [969, 420], [972, 716], [405, 714]],
|
||||
@@ -16,7 +34,7 @@
|
||||
"inference_stride": 2,
|
||||
"confirm_delay_sec": 0.5,
|
||||
"exit_confirm_delay_sec": 6.0,
|
||||
"description": "FCP 7beb820 calibration, 1280x720 analysis space"
|
||||
"description": "FCP 7beb820 calibration (pre-2026-11-11 recalibration), 1280x720 analysis space"
|
||||
}
|
||||
},
|
||||
"active_preset": "default"
|
||||
|
||||
Reference in new issue
Block a user