feat: add RELLIS dataset compatibility smoke

This commit is contained in:
DCCONSTRUCTIONS
2026-07-25 20:45:30 +03:00
parent 13c35ff446
commit 054feec0d2
19 changed files with 1633 additions and 277 deletions
+71 -1
View File
@@ -12,6 +12,7 @@ from fastapi.routing import APIRoute
from k1link.datasets import (
DatasetAdmissionError,
DatasetFrameError,
RELLIS_SOURCE_ID,
dataset_gateway_catalog,
goose_admission,
goose_benchmark,
@@ -19,6 +20,7 @@ from k1link.datasets import (
read_dataset_ground_preview,
read_dataset_native_scan_preview,
read_semantic_kitti_frame,
rellis_native_scan_preview,
)
from k1link.datasets.goose_admission import admit_goose_validation
from k1link.datasets.goose_benchmark import (
@@ -111,10 +113,14 @@ def test_dataset_gateway_api_is_read_only_and_path_free(
route = _endpoint(build_lidar_router(), "/api/v1/lidar/dataset-gateway")
response = route() # type: ignore[operator]
assert response["schema_version"] == "missioncore.dataset-gateway-catalog/v2"
assert response["schema_version"] == "missioncore.dataset-gateway-catalog/v3"
assert response["access"] == "read-only"
assert response["storage"]["admitted"] is True
assert response["storage"]["path_exposed"] is False
assert [source["source_id"] for source in response["sources"]] == [
"goose-3d/v2025-08-22",
RELLIS_SOURCE_ID,
]
assert "/mnt/d/NDC_MISSIONCORE/datasets" not in repr(response).replace(
response["storage"]["required_wsl_root"], # type: ignore[index]
"",
@@ -286,6 +292,70 @@ def test_dataset_preview_api_is_read_only_and_integrity_checked(
assert response["frame_id"] == "frame-1"
def test_rellis_smoke_preview_keeps_semantickitti_alignment_and_ignore_policy(
tmp_path: Path,
) -> None:
points_path = tmp_path / "000104.bin"
labels_path = tmp_path / "000104.label"
np.asarray(
[
[1.0, 0.0, -1.0, 0.1],
[2.0, 0.2, -0.8, 0.2],
[3.0, -0.2, 0.5, 0.3],
[4.0, 0.0, -0.5, 0.4],
],
dtype="<f4",
).tofile(points_path)
np.asarray([3, 23, 4, 31], dtype="<u4").tofile(labels_path)
frame = read_semantic_kitti_frame(points_path, labels_path)
preview = rellis_native_scan_preview(
frame,
frame_id="000104",
maximum_points=4,
source_evidence={
"repository_url": "https://github.com/unmannedlab/RELLIS-3D",
"repository_commit": "c17a118fcaed1559f03cc32cc3a91dedc557f8b8",
"label_config_sha256": (
"573379a232ac561805987466c391a61fd5ad338be7fb9c4c2842f3f28067e0ad"
),
"point_sha256": (
"ed81a9c3636d55b17d78058c72545d5d22419beecf174d50596d23ae178752af"
),
"label_sha256": (
"9b8c65b710873e931af4ac6dfc7d3dd2298696514ab721e50300bd55ad5b634e"
),
"license": "CC-BY-NC-SA-3.0",
},
)
preview_path = tmp_path / "rellis-preview.json"
preview_path.write_text(json.dumps(preview), encoding="utf-8")
decoded = read_dataset_native_scan_preview(preview_path)
assert decoded["source_id"] == RELLIS_SOURCE_ID
assert decoded["ground_truth_ground"] == [1, 1, 0, 0]
assert decoded["evaluation_mask"] == [1, 1, 1, 0]
assert decoded["coordinate_frame"]["x"] == "forward"
assert decoded["safety"]["compatibility_smoke_only"] is True
router = build_lidar_router(
dataset_admission_provider=lambda: None,
dataset_preview_provider=lambda: None,
dataset_rellis_preview_provider=lambda: preview_path,
)
route = _endpoint(router, "/api/v1/lidar/dataset-gateway/preview")
response = route(source_id=RELLIS_SOURCE_ID) # type: ignore[operator]
assert response["frame_id"] == "000104"
catalog = dataset_gateway_catalog(
Path("/mnt/d/NDC_MISSIONCORE/datasets"),
rellis_preview_path=preview_path,
)
rellis = catalog["sources"][1] # type: ignore[index]
assert rellis["admission"]["status"] == "smoke-ready" # type: ignore[index]
def test_goose_current_ground_is_scored_against_independent_labels(
tmp_path: Path,
monkeypatch: pytest.MonkeyPatch,