Spaces:
Running on Zero
Running on Zero
Download tests/test_evaluate_pointcloud_dataset.py from junaid-simamdigital/Simam3D-GPU: direct link, hf CLI and curl.
- Browser
- Download file 885 Bytes
-
https://huggingface.co/spaces/junaid-simamdigital/Simam3D-GPU/resolve/main/tests/test_evaluate_pointcloud_dataset.py
- Command line
-
hf download hf://spaces/junaid-simamdigital/Simam3D-GPU/tests/test_evaluate_pointcloud_dataset.py
-
curl -L -o test_evaluate_pointcloud_dataset.py https://huggingface.co/spaces/junaid-simamdigital/Simam3D-GPU/resolve/main/tests/test_evaluate_pointcloud_dataset.py
885 Bytes
| import json | |
| from evaluate_pointcloud_dataset import evaluate_manifest | |
| def test_pointcloud_manifest_runner_aggregates_rows_and_failures(tmp_path): | |
| cloud = tmp_path / "cloud.ply" | |
| cloud.write_text("\n".join([ | |
| "ply", "format ascii 1.0", "element vertex 2", "property float x", | |
| "property float y", "property float z", "end_header", "0 0 0", "1 0 0", "", | |
| ]), encoding="utf-8") | |
| manifest = tmp_path / "pairs.jsonl" | |
| manifest.write_text("\n".join([ | |
| json.dumps({"id": "good", "prediction": cloud.name, "reference": cloud.name, "threshold": 0.01}), | |
| json.dumps({"id": "missing", "prediction": "missing.ply", "reference": cloud.name}), | |
| ]), encoding="utf-8") | |
| report = evaluate_manifest(manifest) | |
| assert report["successful_rows"] == 1 | |
| assert len(report["failed_rows"]) == 1 | |
| assert report["aggregate"]["fscore"]["mean"] == 1.0 | |