Simam3D-GPU / tests /test_evaluate_depth_dataset.py
junaid-simamdigital's picture
test: cover depth manifest aggregation
e1975c0 verified
Raw History Blame Contribute Delete
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