feat(v1): relax fall sensitivity for low overhead cameras
Adds configurable event.require_rapid_drop (default off), require_lower_body (default off) and horizontal_angle_threshold_degrees (default 45). With the lenient defaults a sustained horizontal pose alone enters SUSPECT and confirms after the confirm window, which is now the main false-positive guard; missing knees/ankles no longer reject the pose. Thresholds flow into config_version. End-to-end smoke confirms a lying pose; 70 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+6
-3
@@ -7,7 +7,9 @@ from typing import Optional
|
||||
from v1.pose import PersonPose
|
||||
|
||||
|
||||
_REQUIRED_JOINTS = (5, 6, 11, 12, 13, 14, 15, 16)
|
||||
_TORSO_JOINTS = (5, 6, 11, 12) # shoulders and hips (used by the geometry)
|
||||
_LOWER_JOINTS = (13, 14, 15, 16) # knees and ankles (often occluded in a fall)
|
||||
_REQUIRED_JOINTS = _TORSO_JOINTS + _LOWER_JOINTS
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -29,7 +31,7 @@ class PoseEvidence:
|
||||
|
||||
|
||||
def assess_pose_quality(
|
||||
pose: Optional[PersonPose], threshold: float
|
||||
pose: Optional[PersonPose], threshold: float, require_lower_body: bool = True
|
||||
) -> PoseQuality:
|
||||
if not 0.0 <= threshold <= 1.0:
|
||||
raise ValueError("threshold must be between 0 and 1")
|
||||
@@ -40,7 +42,8 @@ def assess_pose_quality(
|
||||
visible_count = sum(
|
||||
point.confidence >= threshold for point in pose.keypoints
|
||||
)
|
||||
if any(pose.keypoints[index].confidence < threshold for index in _REQUIRED_JOINTS):
|
||||
required = _REQUIRED_JOINTS if require_lower_body else _TORSO_JOINTS
|
||||
if any(pose.keypoints[index].confidence < threshold for index in required):
|
||||
return PoseQuality(False, "required_joint_low_confidence", visible_count)
|
||||
return PoseQuality(True, "accepted", visible_count)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user