Spaces:
Running on Zero
Running on Zero
Download tests/test_evaluate_depth_dataset.py from junaid-simamdigital/Simam3D-GPU: direct link, hf CLI and curl.
- Browser
- Download file 884 Bytes
-
https://huggingface.co/spaces/junaid-simamdigital/Simam3D-GPU/resolve/main/tests/test_evaluate_depth_dataset.py
- Command line
-
hf download hf://spaces/junaid-simamdigital/Simam3D-GPU/tests/test_evaluate_depth_dataset.py
-
curl -L -o test_evaluate_depth_dataset.py https://huggingface.co/spaces/junaid-simamdigital/Simam3D-GPU/resolve/main/tests/test_evaluate_depth_dataset.py
884 Bytes
| import json | |
| import numpy as np | |
| from evaluate_depth_dataset import evaluate_manifest | |
| def test_depth_manifest_runner_aggregates_rows_and_records_failures(tmp_path): | |
| prediction = tmp_path / "prediction.npy" | |
| ground_truth = tmp_path / "ground_truth.npy" | |
| np.save(prediction, np.array([[1.0, 2.0], [3.0, 4.0]])) | |
| np.save(ground_truth, np.array([[1.0, 2.0], [3.0, 4.0]])) | |
| manifest = tmp_path / "pairs.jsonl" | |
| manifest.write_text("\n".join([ | |
| json.dumps({"id": "good", "prediction": prediction.name, "ground_truth": ground_truth.name}), | |
| json.dumps({"id": "missing", "prediction": "missing.npy", "ground_truth": ground_truth.name}), | |
| ]), encoding="utf-8") | |
| report = evaluate_manifest(manifest) | |
| assert report["successful_rows"] == 1 | |
| assert len(report["failed_rows"]) == 1 | |
| assert report["aggregate_median_scaled"]["rmse"]["mean"] == 0.0 | |