fix: distinguish admitted RELLIS previews from smoke
This commit is contained in:
@@ -624,7 +624,10 @@ def read_dataset_native_scan_preview(path: Path) -> dict[str, Any]:
|
||||
"navigation_or_safety_accepted": False,
|
||||
}
|
||||
if identity[1] == "rellis-3d/v1.1":
|
||||
expected_safety["compatibility_smoke_only"] = True
|
||||
compatibility_smoke_only = safety.get("compatibility_smoke_only")
|
||||
if not isinstance(compatibility_smoke_only, bool):
|
||||
raise DatasetAdmissionError("RELLIS preview scope is incompatible")
|
||||
expected_safety["compatibility_smoke_only"] = compatibility_smoke_only
|
||||
if safety != expected_safety:
|
||||
raise DatasetAdmissionError("dataset preview safety boundary is incompatible")
|
||||
if not isinstance(document.get("frame_id"), str) or not document["frame_id"]:
|
||||
@@ -670,9 +673,9 @@ def _validate_rellis_preview_metadata(
|
||||
):
|
||||
raise DatasetAdmissionError("RELLIS class catalog is incompatible")
|
||||
evidence = _object(document.get("source_evidence"), "source_evidence")
|
||||
if (
|
||||
common_evidence_valid = (
|
||||
set(evidence)
|
||||
!= {
|
||||
== {
|
||||
"repository_url",
|
||||
"repository_commit",
|
||||
"label_config_sha256",
|
||||
@@ -680,16 +683,31 @@ def _validate_rellis_preview_metadata(
|
||||
"label_sha256",
|
||||
"license",
|
||||
}
|
||||
or evidence.get("repository_url") != "https://github.com/unmannedlab/RELLIS-3D"
|
||||
or evidence.get("repository_commit")
|
||||
!= "c17a118fcaed1559f03cc32cc3a91dedc557f8b8"
|
||||
or evidence.get("label_config_sha256")
|
||||
!= "573379a232ac561805987466c391a61fd5ad338be7fb9c4c2842f3f28067e0ad"
|
||||
or evidence.get("point_sha256")
|
||||
!= "ed81a9c3636d55b17d78058c72545d5d22419beecf174d50596d23ae178752af"
|
||||
or evidence.get("label_sha256")
|
||||
!= "9b8c65b710873e931af4ac6dfc7d3dd2298696514ab721e50300bd55ad5b634e"
|
||||
or evidence.get("license") != "CC-BY-NC-SA-3.0"
|
||||
and evidence.get("repository_url") == "https://github.com/unmannedlab/RELLIS-3D"
|
||||
and evidence.get("repository_commit")
|
||||
== "c17a118fcaed1559f03cc32cc3a91dedc557f8b8"
|
||||
and evidence.get("label_config_sha256")
|
||||
== "573379a232ac561805987466c391a61fd5ad338be7fb9c4c2842f3f28067e0ad"
|
||||
and evidence.get("license") == "CC-BY-NC-SA-3.0"
|
||||
)
|
||||
digest_values = (evidence.get("point_sha256"), evidence.get("label_sha256"))
|
||||
digests_valid = all(
|
||||
isinstance(value, str)
|
||||
and len(value) == 64
|
||||
and all(character in "0123456789abcdef" for character in value)
|
||||
for value in digest_values
|
||||
)
|
||||
smoke_only = document["safety"]["compatibility_smoke_only"]
|
||||
smoke_digests_valid = (
|
||||
evidence.get("point_sha256")
|
||||
== "ed81a9c3636d55b17d78058c72545d5d22419beecf174d50596d23ae178752af"
|
||||
and evidence.get("label_sha256")
|
||||
== "9b8c65b710873e931af4ac6dfc7d3dd2298696514ab721e50300bd55ad5b634e"
|
||||
)
|
||||
if (
|
||||
not common_evidence_valid
|
||||
or not digests_valid
|
||||
or (smoke_only and not smoke_digests_valid)
|
||||
):
|
||||
raise DatasetAdmissionError("RELLIS source evidence is incompatible")
|
||||
|
||||
|
||||
@@ -195,6 +195,7 @@ def admit_rellis_release(
|
||||
"label_sha256": hashlib.sha256(label_bytes).hexdigest(),
|
||||
"license": RELLIS_LICENSE,
|
||||
},
|
||||
compatibility_smoke_only=False,
|
||||
)
|
||||
except (OSError, KeyError, zipfile.BadZipFile, DatasetFrameError, RellisSmokeError) as exc:
|
||||
raise RellisAdmissionError("RELLIS archives could not be verified") from exc
|
||||
|
||||
@@ -143,6 +143,7 @@ def rellis_native_scan_preview(
|
||||
frame_id: str,
|
||||
maximum_points: int,
|
||||
source_evidence: dict[str, str],
|
||||
compatibility_smoke_only: bool = True,
|
||||
) -> dict[str, Any]:
|
||||
"""Build the common viewer artifact from a validated RELLIS native frame."""
|
||||
|
||||
@@ -243,7 +244,7 @@ def rellis_native_scan_preview(
|
||||
"source_evidence": source_evidence,
|
||||
"safety": {
|
||||
"visualization_only": True,
|
||||
"compatibility_smoke_only": True,
|
||||
"compatibility_smoke_only": compatibility_smoke_only,
|
||||
"navigation_or_safety_accepted": False,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user