fix(v1): wire model confidence, explicit source mode, unique event ids

A: PoseAdapter.set_confidence_threshold is applied on start, so the
   settings model-confidence field actually affects inference.
B: config source.mode ('stream'|'replay') is explicit; app no longer
   guesses the source type from the URL prefix.
C: FallStateMachine takes a session_id and from_config generates a
   unique one per run, so event ids never collide across restarts
   (no screenshot overwrite or duplicate JSONL identity in a day).

51 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ila
2026-07-21 20:54:34 +08:00
co-authored by Claude Opus 4.8
parent 7443a8f031
commit 04422d9ca0
13 changed files with 188 additions and 7 deletions
+12
View File
@@ -66,6 +66,18 @@ class PoseAdapter:
def model_path(self) -> Path:
return self._model_path
@property
def confidence_threshold(self) -> float:
return self._confidence
def set_confidence_threshold(self, value: float) -> None:
"""Update the inference confidence so settings changes take effect."""
confidence = float(value)
if not 0.0 <= confidence <= 1.0:
raise ModelValidationError("confidence threshold must be between 0 and 1")
self._confidence = confidence
def infer(self, image: np.ndarray) -> Sequence[PersonPose]:
results = self._model(image, conf=self._confidence, verbose=False)
return self.from_results(results, self._person_class_ids)