refactor: remove --metrics-json from refine_ground_plane.py

This commit is contained in:
2026-02-09 09:59:43 +00:00
parent 3b471c2cae
commit 915c7973d1
4 changed files with 78 additions and 42 deletions
+5 -11
View File
@@ -85,7 +85,6 @@ def test_cli_help():
def test_refine_ground_basic(tmp_path, mock_data):
extrinsics_path, depth_path = mock_data
output_path = tmp_path / "refined.json"
metrics_path = tmp_path / "metrics.json"
runner = CliRunner()
result = runner.invoke(
@@ -97,8 +96,6 @@ def test_refine_ground_basic(tmp_path, mock_data):
str(depth_path),
"-o",
str(output_path),
"--metrics-json",
str(metrics_path),
"--no-plot",
"--debug",
],
@@ -108,23 +105,20 @@ def test_refine_ground_basic(tmp_path, mock_data):
# Check output exists
assert output_path.exists()
assert metrics_path.exists()
# Load output
with open(output_path) as f:
out_data = json.load(f)
# Check metadata
assert "_meta" in out_data
assert "ground_refined" in out_data["_meta"]
assert out_data["_meta"]["ground_refined"]["metrics"]["success"] is True
assert "per_camera" in out_data["_meta"]["ground_refined"]
assert "1001" in out_data["_meta"]["ground_refined"]["per_camera"]
assert "1002" in out_data["_meta"]["ground_refined"]["per_camera"]
# Check metrics
with open(metrics_path) as f:
metrics = json.load(f)
assert metrics["success"] is True
assert metrics["num_cameras_valid"] == 2
assert "ground_refine" not in out_data["1001"]
assert "ground_refine" not in out_data["1002"]
# We expect some correction because we simulated floor at Y=1.5m (cam frame)
# And input extrinsics were Identity (Cam Y down = World Y down)