eval: enforce Gaussian parameter ranges
Browse files- inspect_gaussian_ply.py +6 -0
inspect_gaussian_ply.py
CHANGED
|
@@ -42,6 +42,12 @@ def inspect_gaussian_ply(path: str | Path) -> dict[str, object]:
|
|
| 42 |
quaternion_norms = np.linalg.norm(quaternions, axis=1)
|
| 43 |
confidence = values[:, indices["confidence"]]
|
| 44 |
opacity = values[:, indices["opacity"]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
return {
|
| 46 |
"path": str(path),
|
| 47 |
"vertex_count": count,
|
|
|
|
| 42 |
quaternion_norms = np.linalg.norm(quaternions, axis=1)
|
| 43 |
confidence = values[:, indices["confidence"]]
|
| 44 |
opacity = values[:, indices["opacity"]]
|
| 45 |
+
if not np.all((quaternion_norms >= 0.99) & (quaternion_norms <= 1.01)):
|
| 46 |
+
raise ValueError("Gaussian rotations must be normalized quaternions")
|
| 47 |
+
if not np.all((confidence >= 0.0) & (confidence <= 1.0)):
|
| 48 |
+
raise ValueError("Gaussian confidence values must be within [0, 1]")
|
| 49 |
+
if not np.all((opacity >= 0.0) & (opacity <= 1.0)):
|
| 50 |
+
raise ValueError("Gaussian opacity values must be within [0, 1]")
|
| 51 |
return {
|
| 52 |
"path": str(path),
|
| 53 |
"vertex_count": count,
|