feat(lidar): qualify Patchwork++ on GOOSE
This commit is contained in:
@@ -21,7 +21,11 @@ from k1link.datasets import (
|
||||
read_semantic_kitti_frame,
|
||||
)
|
||||
from k1link.datasets.goose_admission import admit_goose_validation
|
||||
from k1link.datasets.goose_benchmark import benchmark_goose_current_ground
|
||||
from k1link.datasets.goose_benchmark import (
|
||||
benchmark_goose_current_ground,
|
||||
benchmark_goose_patchwork_ground,
|
||||
)
|
||||
from k1link.ground_segmentation import GroundSegmentation
|
||||
from k1link.web.lidar_api import build_lidar_router
|
||||
|
||||
|
||||
@@ -354,12 +358,49 @@ def test_goose_current_ground_is_scored_against_independent_labels(
|
||||
assert report["ground_truth"]["evaluated_points"] == 4
|
||||
assert 0 <= report["metrics"]["ground_iou"] <= 1
|
||||
assert report["decision"]["promoted"] is False
|
||||
output = (
|
||||
install
|
||||
/ "benchmarks"
|
||||
/ f"current-ground-{report['identity_sha256']}"
|
||||
/ "preview.json"
|
||||
)
|
||||
preview = read_dataset_ground_preview(output)
|
||||
output = install / "benchmarks" / f"current-ground-{report['identity_sha256']}" / "preview.json"
|
||||
preview = json.loads(output.read_text(encoding="utf-8"))
|
||||
assert preview["point_count"] == 4
|
||||
assert len(preview["disagreement"]) == 4
|
||||
|
||||
class FakePatchwork:
|
||||
identity = {
|
||||
"provider_id": "patchworkpp/v1.4.1",
|
||||
"source_url": "https://github.com/url-kaist/patchwork-plusplus",
|
||||
"source_tag": "v1.4.1",
|
||||
"source_commit": "3e6903a1d5537a4cc2ace897b0bbb98a92d6014c",
|
||||
"binding_version": "test",
|
||||
"binary_sha256": "c" * 64,
|
||||
"platform": "linux",
|
||||
"machine": "x86_64",
|
||||
"ground_truth": False,
|
||||
}
|
||||
|
||||
def segment(self, xyzi: np.ndarray) -> GroundSegmentation:
|
||||
return GroundSegmentation(
|
||||
ground_mask=np.asarray([True, True, False, False]),
|
||||
assigned_mask=np.ones(xyzi.shape[0], dtype=np.bool_),
|
||||
latency_ms=0.2,
|
||||
)
|
||||
|
||||
ab_report = benchmark_goose_patchwork_ground(
|
||||
root,
|
||||
patchwork=FakePatchwork(),
|
||||
preview_points=4,
|
||||
)
|
||||
|
||||
assert ab_report["scope"]["patchworkpp_input_admitted"] is True
|
||||
assert ab_report["scope"]["normalized_scan_produced"] is False
|
||||
assert ab_report["decision"]["promoted"] is False
|
||||
ab_output = (
|
||||
install / "benchmarks" / f"ground-ab-{ab_report['identity_sha256']}" / "preview.json"
|
||||
)
|
||||
ab_preview = read_dataset_ground_preview(ab_output)
|
||||
assert ab_preview["schema_version"] == "missioncore.dataset-ground-comparison-preview/v2"
|
||||
assert ab_preview["input_profile"]["height"]["sensor_above_ground_m"] == 2.24
|
||||
assert len(ab_preview["patchwork_disagreement"]) == 4
|
||||
|
||||
ab_preview["input_profile"]["height"]["sensor_above_ground_m"] = 2.25
|
||||
ab_output.write_text(json.dumps(ab_preview), encoding="utf-8")
|
||||
with pytest.raises(DatasetAdmissionError, match="input profile"):
|
||||
read_dataset_ground_preview(ab_output)
|
||||
|
||||
Reference in New Issue
Block a user