code wiki / (root) / nx_pose_classify.nx

nx_pose_classify.nx

buildroot/runtime/nx_pose_classify.nx

5396 B142 linesdepth 2pulls 2 transitivereach 3 importersview sourcekind librarytopic pose
docsdependenciesstructsconstsfunctions

about

nx_pose_classify.nx -- classify body pose from face + torso geometry. Heuristic geometric classifier — given face and torso bounding boxes (already produced by nx_region), emit the most-likely pose enum that drives nx_breast_drape_pose and other pose-aware detectors. Decision tree: 1. Torso wider than tall (aspect < 1.0): → LAYING_BACK if face above torso center → FACE_DOWN_ASS_UP / ALL_FOURS otherwise 2. Face strongly offset horizontally from torso center: → SIDE_PROFILE if offset > 40% of torso width → RECLINING_TWISTED if offset 20..40% 3. Face above torso top with normal alignment: → STANDING_FACING (or LEANING_FORWARD if torso aspect very tall) 4. Face overlaps with torso vertically: → ARCHED_PRESENTING (bent / kneeling) if torso aspect 1..1.4 Pose enum values mirror nx_breast_drape_pose for direct routing. Output flat-array (result[]): result[0] = pose_enum result[1] = confidence_q10 (0=guess, 1024=clear signal) result[2] = torso_aspect_q10 result[3] = face_x_offset_from_torso_center_q10 (% of torso width) result[4] = face_above_torso (0=overlap, 1=fully above)

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_pose_classify.nx nx_multi_pair_test.nx nx_pair_synchrony.nx nx_pose_classify_test.nx

imports: nx_syscalls.nx

imported by: nx_multi_pair_test.nxnx_pair_synchrony.nxnx_pose_classify_test.nx

structs

none

consts

35const NX_MAGIC_1024: i64 = 1024
38const NX_POSE_UNKNOWN: i64 = 0
39const NX_POSE_STANDING_FACING: i64 = 1
40const NX_POSE_LEANING_FORWARD: i64 = 2
41const NX_POSE_LAYING_BACK: i64 = 3
42const NX_POSE_ARCHED_PRESENTING: i64 = 4
43const NX_POSE_RECLINING_TWISTED: i64 = 5
44const NX_POSE_SIDE_PROFILE: i64 = 6
45const NX_POSE_ALL_FOURS: i64 = 7
46const NX_POSE_FACE_DOWN_ASS_UP: i64 = 8
47const NX_POSE_KNEELING: i64 = 9
49const NX_POSE_RES_KIND: i64 = 0
50const NX_POSE_RES_CONFIDENCE: i64 = 1
51const NX_POSE_RES_TORSO_ASPECT: i64 = 2
52const NX_POSE_RES_X_OFFSET_PCT: i64 = 3
53const NX_POSE_RES_FACE_ABOVE: i64 = 4
54const NX_POSE_RES_FIELDS: i64 = 5
57const NX_POSE_LAY_ASPECT_MAX_Q10: i64 = 1024 // < 1.0 = wider than tall = laying
58const NX_POSE_LEAN_ASPECT_MIN_Q10: i64 = 1638 // > 1.6 = very tall torso = leaning
59const NX_POSE_TWIST_OFFSET_MIN_PCT: i64 = 20 // 20%+ horizontal face offset
60const NX_POSE_PROFILE_OFFSET_MIN_PCT: i64 = 40 // 40%+ = side profile
61const NX_POSE_ABOVE_GAP_MIN_PCT: i64 = 5 // face_y1 ≤ torso_y0 - 5%

functions

66func nx_pose_classify(bbox: *i64, result: *i64) -> i64
called by 1: main