placeframe-core 2.0.0.dev1367__tar.gz → 2.0.0.dev1370__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/AGENTS.md +1 -1
  2. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/PKG-INFO +1 -1
  3. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/pyproject.toml +1 -1
  4. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/calibration.py +11 -3
  5. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/.gitignore +0 -0
  6. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/CLAUDE.md +0 -0
  7. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/README.md +0 -0
  8. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/main.py +0 -0
  9. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/axis_convention.py +0 -0
  10. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/camera_config.py +0 -0
  11. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/capture_session_manifest.py +0 -0
  12. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/h5.py +0 -0
  13. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/image_preprocess.py +0 -0
  14. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/lightglue.py +0 -0
  15. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/localization_metrics.py +0 -0
  16. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/model_wrappers.py +0 -0
  17. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/numpy_ops.py +0 -0
  18. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/opq.py +0 -0
  19. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/py.typed +0 -0
  20. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/reconstruction_manifest.py +0 -0
  21. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/reconstruction_metrics.py +0 -0
  22. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/reconstruction_options.py +0 -0
  23. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/tensor_types.py +0 -0
  24. {placeframe_core-2.0.0.dev1367 → placeframe_core-2.0.0.dev1370}/src/placeframe_core/transform.py +0 -0
@@ -35,7 +35,7 @@ The package is flat: 16 leaf modules under `src/placeframe_core/`, no `__init__.
35
35
 
36
36
  **Confidence-calibration model.**
37
37
 
38
- - `calibration.py` — `SCHEMA_VERSION = 2`. `RawLocalizationMetrics` and `RawMapMetrics` are the per-query and per-map raw inputs. `Features.compute(localization, map_metrics)` produces a 10-feature vector: `log1p` of inlier / match / image / point counts, `reproj_error_median / image_diagonal`, plus four ratios and diversities. `ToleranceModel` carries `logistic_weights` (Features-shaped), `logistic_intercept`, and an isotonic table (`isotonic_x_breakpoints`, `isotonic_y_breakpoints`). `CalibrationArtifact` bundles a `tight` and `loose` `ToleranceModel`, `sigma_meas_alpha` / `sigma_meas_beta` for the measurement-covariance scaling `Sigma_meas = alpha * Sigma_pnp + beta * I_6`, `loose_min` / `tight_min` floors, and version metadata. `load_global_calibration(path, expected_pipeline_version)` raises `CalibrationLoadError` with a remediation message if the file is missing, the schema version mismatches, or the pipeline version mismatches. `apply_global_calibration(calibration, features)` returns `(tight, loose, True)` — the third element is always literal `True`.
38
+ - `calibration.py` — `SCHEMA_VERSION = 3`. `RawLocalizationMetrics` and `RawMapMetrics` are the per-query and per-map raw inputs. `Features.compute(localization, map_metrics)` produces a 10-feature vector: `log1p` of inlier / match / image / point counts, `reproj_error_median / image_diagonal`, plus four ratios and diversities. `ToleranceModel` carries `logistic_weights` (Features-shaped), `logistic_intercept`, and an isotonic table (`isotonic_x_breakpoints`, `isotonic_y_breakpoints`). `CalibrationArtifact` bundles a `tight` and `loose` `ToleranceModel`, `sigma_meas_alpha` and the floors `sigma_meas_beta_rotation` (rad²) / `sigma_meas_beta_translation` (m²) for the measurement covariance `Sigma_meas = alpha * Sigma_pnp + diag(beta_rotation * I_3, beta_translation * I_3)` (`measurement_covariance_floor()`), `loose_min` / `tight_min` floors, and version metadata. `load_global_calibration(path, expected_pipeline_version)` raises `CalibrationLoadError` with a remediation message if the file is missing, the schema version mismatches, or the pipeline version mismatches. `apply_global_calibration(calibration, features)` returns `(tight, loose, True)` — the third element is always literal `True`.
39
39
 
40
40
  **Inference glue and typing shims (torch-aware).**
41
41
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: placeframe-core
3
- Version: 2.0.0.dev1367
3
+ Version: 2.0.0.dev1370
4
4
  Summary: Placeframe domain logic: camera configs, coordinate transforms, metrics
5
5
  License-Expression: Apache-2.0
6
6
  Requires-Python: >=3.13
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "placeframe-core"
3
- version = "2.0.0.dev1367"
3
+ version = "2.0.0.dev1370"
4
4
  description = "Placeframe domain logic: camera configs, coordinate transforms, metrics"
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -4,11 +4,11 @@ import math
4
4
  import sys
5
5
  from pathlib import Path
6
6
 
7
- from numpy import interp, log1p
7
+ from numpy import diag, dtype, float64, interp, log1p, ndarray
8
8
  from pydantic import BaseModel
9
9
 
10
10
 
11
- SCHEMA_VERSION = 2
11
+ SCHEMA_VERSION = 3
12
12
 
13
13
  # Sentinel `pipeline_version` value that bypasses the pipeline-version check in
14
14
  # `load_global_calibration`. Use only with placeholder calibrations whose values
@@ -84,10 +84,18 @@ class CalibrationArtifact(BaseModel):
84
84
  tight: ToleranceModel
85
85
  loose: ToleranceModel
86
86
  sigma_meas_alpha: float
87
- sigma_meas_beta: float
87
+ # Variance floors added to the measurement covariance's diagonal: rad² on the three rotation
88
+ # axes, m² on the three translation axes. Separate because one number can't be a sensible floor
89
+ # in both units.
90
+ sigma_meas_beta_rotation: float
91
+ sigma_meas_beta_translation: float
88
92
  loose_min: float
89
93
  tight_min: float
90
94
 
95
+ def measurement_covariance_floor(self) -> ndarray[tuple[int, int], dtype[float64]]:
96
+ """The 6x6 floor, ordered [rotation, translation] like the covariance it is added to."""
97
+ return diag([self.sigma_meas_beta_rotation] * 3 + [self.sigma_meas_beta_translation] * 3)
98
+
91
99
  def write(self, path: Path) -> None:
92
100
  path.write_text(self.model_dump_json(indent=2) + "\n", encoding="utf-8")
93
101