Spaces:
Paused
Paused
test: cover point cloud manifest aggregation
Browse files
tests/test_evaluate_pointcloud_dataset.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
|
| 3 |
+
from evaluate_pointcloud_dataset import evaluate_manifest
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def test_pointcloud_manifest_runner_aggregates_rows_and_failures(tmp_path):
|
| 7 |
+
cloud = tmp_path / "cloud.ply"
|
| 8 |
+
cloud.write_text("\n".join([
|
| 9 |
+
"ply", "format ascii 1.0", "element vertex 2", "property float x",
|
| 10 |
+
"property float y", "property float z", "end_header", "0 0 0", "1 0 0", "",
|
| 11 |
+
]), encoding="utf-8")
|
| 12 |
+
manifest = tmp_path / "pairs.jsonl"
|
| 13 |
+
manifest.write_text("\n".join([
|
| 14 |
+
json.dumps({"id": "good", "prediction": cloud.name, "reference": cloud.name, "threshold": 0.01}),
|
| 15 |
+
json.dumps({"id": "missing", "prediction": "missing.ply", "reference": cloud.name}),
|
| 16 |
+
]), encoding="utf-8")
|
| 17 |
+
report = evaluate_manifest(manifest)
|
| 18 |
+
assert report["successful_rows"] == 1
|
| 19 |
+
assert len(report["failed_rows"]) == 1
|
| 20 |
+
assert report["aggregate"]["fscore"]["mean"] == 1.0
|