Test malformed-pose fallback
Browse files- tests/test_core.py +11 -0
tests/test_core.py
CHANGED
|
@@ -151,6 +151,17 @@ def test_prediction_contract_rejects_mismatched_confidence():
|
|
| 151 |
raise AssertionError("mismatched DA3 confidence should be rejected")
|
| 152 |
|
| 153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
def test_world_projection_reports_in_frame_points():
|
| 155 |
points = np.array([[0.0, 0.0, 1.0], [2.0, 0.0, 1.0]], dtype=np.float32)
|
| 156 |
pixels, depths, inside = project_world_points(points, None, None, 10, 10)
|
|
|
|
| 151 |
raise AssertionError("mismatched DA3 confidence should be rejected")
|
| 152 |
|
| 153 |
|
| 154 |
+
def test_prediction_contract_downgrades_singular_poses_to_synthetic_prior():
|
| 155 |
+
prediction = SimpleNamespace(
|
| 156 |
+
depth=np.ones((1, 4, 5), dtype=np.float32),
|
| 157 |
+
conf=np.ones((1, 4, 5), dtype=np.float32),
|
| 158 |
+
extrinsics=np.zeros((1, 4, 4), dtype=np.float32),
|
| 159 |
+
)
|
| 160 |
+
_, _, extrinsics, _, _, pose_source = normalize_prediction_contract(prediction, 1)
|
| 161 |
+
assert extrinsics.shape == (1, 4, 4)
|
| 162 |
+
assert pose_source == "synthetic_orbit_prior"
|
| 163 |
+
|
| 164 |
+
|
| 165 |
def test_world_projection_reports_in_frame_points():
|
| 166 |
points = np.array([[0.0, 0.0, 1.0], [2.0, 0.0, 1.0]], dtype=np.float32)
|
| 167 |
pixels, depths, inside = project_world_points(points, None, None, 10, 10)
|