vision_ai library

Classes

AttentionScore
Snapshot of attention state for a single frame.
AttentionScorer
Combines eye openness, face orientation, and head stability into a single attention/engagement score.
BlinkDetector
Detects eye blinks from FaceResult.leftEyeOpenProbability and FaceResult.rightEyeOpenProbability transitions over time.
BlinkEvent
Emitted when a blink is detected.
CameraConfig
Camera configuration.
CustomGesture
A user-defined gesture pattern based on finger states.
FaceConfig
Configuration for face emotion detection.
FaceDistanceEstimate
Estimated distance of a face from the camera.
FaceDistanceEstimator
Estimates how far a face is from the camera using bounding box size.
FaceResult
Detection result for a single face with emotion classification.
HandConfig
Configuration for hand gesture detection.
HandLandmarkIndex
MediaPipe hand model produces exactly 21 landmarks per hand. The topology here mirrors the MediaPipe Hand landmark documentation: 0=wrist, 1-4=thumb (CMC→tip), 5-8=index, 9-12=middle, 13-16=ring, 17-20=pinky. The connections list drives skeleton rendering and must stay in sync with how the Kotlin side packs the flat DoubleArray (index * 3 = x, +1 = y, +2 = z). Indices and topology for the 21 hand landmark points.
HandMotion
Snapshot of hand motion for a single frame.
HandMotionTracker
Tracks hand position across frames to compute velocity and direction.
HandResult
Detection result for a single hand.
HeadGestureDetector
Detects head nod (yes) and shake (no) from Euler angle oscillations.
HeadGestureEvent
Emitted when a head nod or shake is detected.
NormalizedLandmark
A 3D point in normalized image coordinates where x and y are in 0.0, 1.0 relative to the image dimensions. Z represents depth relative to the wrist (negative = closer to camera). Used for HandResult.landmarks.
TwoHandEvent
Emitted when a two-hand interaction is detected.
TwoHandInteractionDetector
Detects interactions between two hands: pinch, clap, and touching.
VisionAi
On-device hand gesture recognition and facial emotion detection.
VisionResult
Combined detection results from a single camera frame.
WorldLandmark
A 3D point in real-world coordinates where x, y, and z are in meters. Origin is the hand's geometric center. Used for HandResult.worldLandmarks.

Enums

AnalysisResolution
Camera analysis resolution. Lower is faster, higher is more accurate.
AttentionLevel
Qualitative attention level derived from the numeric score.
BlinkEye
Which eye(s) blinked.
CameraFacing
Emotion
Detected facial emotion types (FER2013 universal emotions).
FaceDistanceZone
Qualitative distance zones.
Finger
The five fingers of a hand.
FingerState
Whether a finger is extended (up) or closed (curled).
Gesture
Recognized hand gesture types.
HandDirection
Direction of hand movement, bucketed into 8 compass directions.
HandMotionState
Qualitative speed category.
HeadGesture
Type of head gesture detected.
TwoHandGesture
Type of two-hand interaction detected.