junaid-simamdigital commited on
Commit
75bb132
·
verified ·
1 Parent(s): 2eb912a

eval: tighten calibration matrix validation

Browse files
Files changed (1) hide show
  1. validate_capture_manifest.py +8 -1
validate_capture_manifest.py CHANGED
@@ -48,8 +48,15 @@ def validate_capture_manifest(manifest_path: str | Path, check_files: bool = Fal
48
  shape = (3, 3) if field == "intrinsics" else (4, 4)
49
  if array.shape != shape or not np.isfinite(array).all():
50
  errors.append(f"{prefix} {field} must be finite {shape}")
51
- elif field == "extrinsics" and abs(float(np.linalg.det(array[:3, :3]))) < 1e-8:
 
 
 
 
 
52
  errors.append(f"{prefix} extrinsics rotation is singular")
 
 
53
  if "held_out" not in splits:
54
  errors.append("manifest must contain at least one held_out view")
55
  if "train" not in splits:
 
48
  shape = (3, 3) if field == "intrinsics" else (4, 4)
49
  if array.shape != shape or not np.isfinite(array).all():
50
  errors.append(f"{prefix} {field} must be finite {shape}")
51
+ elif field == "intrinsics":
52
+ if not np.allclose(array[2], [0.0, 0.0, 1.0], atol=1e-5):
53
+ errors.append(f"{prefix} intrinsics bottom row must be [0, 0, 1]")
54
+ if array[0, 0] <= 0 or array[1, 1] <= 0:
55
+ errors.append(f"{prefix} intrinsics focal lengths must be positive")
56
+ elif abs(float(np.linalg.det(array[:3, :3]))) < 1e-8:
57
  errors.append(f"{prefix} extrinsics rotation is singular")
58
+ elif not np.allclose(array[3], [0.0, 0.0, 0.0, 1.0], atol=1e-5):
59
+ errors.append(f"{prefix} extrinsics bottom row must be [0, 0, 0, 1]")
60
  if "held_out" not in splits:
61
  errors.append("manifest must contain at least one held_out view")
62
  if "train" not in splits: