# srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures architecture

> Architecture diagram of the GitHub repository srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures
- Repository: https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures

## Overview

#### Purpose and execution entry points
This is a Python 3.9+ desktop assistive-HCI application: webcam face/iris tracking drives OS cursor movement, mouse clicks, and scrolling. Likely runnable entry points are `eye_gaze_hci/main.py` for the packaged application flow and `gaze_tracker.py` as a top-level alternate/legacy launcher. Core package dependencies are declared in `eye_gaze_hci/requirements.txt`.

#### Application orchestration
`eye_gaze_hci/main.py` owns the real-time loop: acquire webcam frames, invoke face-landmark tracking, derive interaction state, issue system-control actions, and present visual feedback. It is the control boundary between computer-vision signals and irreversible host OS input events.
- `eye_gaze_hci/main.py`
- `eye_gaze_hci/config.py`

#### Face and iris landmark acquisition
MediaPipe Face Mesh is the perception engine, configured to use refined landmarks (including iris points) from camera images. OpenCV supplies capture and frame processing. The tracker should normalize raw per-frame landmarks into gaze/gesture measurements rather than exposing MediaPipe-specific structures throughout the app.
- `eye_gaze_hci/tracker.py`
- `eye_gaze_hci/main.py`

#### Gaze-to-cursor pipeline
Iris/eye geometry is transformed into screen-space coordinates, then smoothed with an exponential moving average to reduce jitter before cursor movement. Screen resolution and tuning thresholds are centralized configuration concerns, keeping calibration and sensitivity separate from the frame loop.
- `eye_gaze_hci/tracker.py`
- `eye_gaze_hci/utils/math_utils.py`
- `eye_gaze_hci/config.py`

#### Gesture interpretation and interaction modes
Facial micro-gestures form a discrete state layer over continuous gaze: left/right winks map to left/right clicks, while mouth opening (via mouth aspect ratio) toggles scrolling behavior. In scroll mode, vertical eye/head movement is interpreted as page scrolling rather than ordinary cursor-only control. Debouncing/cooldowns are architecturally important here to prevent repeated click or toggle events from consecutive frames.
- `eye_gaze_hci/tracker.py`
- `eye_gaze_hci/config.py`
- `eye_gaze_hci/utils/math_utils.py`

#### Host automation boundary
PyAutoGUI is the actuator integration: cursor positioning, button clicks, and scrolling are emitted as OS-level input. `controller.py` isolates these side effects from detection logic, allowing vision code to produce semantic commands instead of directly manipulating the desktop.
- `eye_gaze_hci/utils/controller.py`
- `eye_gaze_hci/main.py`

#### Visual runtime feedback
OpenCV-based visualization provides live camera output and likely draws landmarks, gaze indicators, or interaction status for calibration and user feedback. This display path is separate from OS control output and should not alter gesture decisions.
- `eye_gaze_hci/utils/visualization.py`
- `eye_gaze_hci/main.py`

#### Runtime and infrastructure
The system is local, CPU-oriented, and uses a standard webcam; no server, database, cloud service, GPU, or network dependency is indicated. Material external libraries are OpenCV, MediaPipe Face Mesh, NumPy, and PyAutoGUI.
- `eye_gaze_hci/requirements.txt`
- `eye_gaze_hci/main.py`

Main entry points: [`eye_gaze_hci/main.py`](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/main.py) (Real-time loop), [`eye_gaze_hci/tracker.py`](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/tracker.py) (Gaze tracker), [`eye_gaze_hci/utils/math_utils.py`](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/utils/math_utils.py) (Gaze math), [`eye_gaze_hci/config.py`](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/config.py) (Tuning config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application Runtime"]
  node_main["Real-time loop<br/>application entry<br/>[main.py]"]
  node_config["Tuning config<br/>configuration module<br/>[config.py]"]
  node_requirements["Dependencies<br/>runtime manifest<br/>[requirements.txt]"]
  node_legacy_launcher["Alternate launcher<br/>legacy entry point<br/>[gaze_tracker.py]"]
end

subgraph group_vision["Vision &amp; Interaction"]
  node_opencv["OpenCV<br/>vision runtime"]
  node_tracker["Gaze tracker<br/>perception pipeline<br/>[tracker.py]"]
  node_mediapipe["MediaPipe Face Mesh<br/>landmark engine"]
  node_math["Gaze math<br/>signal processing<br/>[math_utils.py]"]
  node_gesture{{"Gesture state<br/>interaction state<br/>[tracker.py]"}}
  node_visualization["Live visualization<br/>feedback renderer<br/>[visualization.py]"]
end

subgraph group_host["Host I/O"]
  node_webcam(("Webcam<br/>local device"))
  node_controller["OS controller<br/>actuator adapter<br/>[controller.py]"]
  node_pyautogui["PyAutoGUI<br/>OS automation library"]
  node_desktop(("Host desktop<br/>operating system"))
end

node_webcam -->|"camera frames"| node_opencv
node_opencv -->|"processed frames"| node_main
node_main -->|"analyze frame"| node_tracker
node_tracker -->|"refined landmarks"| node_mediapipe
node_tracker -->|"iris/eye geometry"| node_math
node_config -.->|"screen and smoothing tuning"| node_math
node_math -->|"smoothed gaze"| node_gesture
node_tracker -->|"wink and mouth measures"| node_gesture
node_config -.->|"thresholds and cooldowns"| node_gesture
node_gesture -->|"cursor, click, scroll commands"| node_controller
node_controller -->|"automation calls"| node_pyautogui
node_pyautogui -->|"OS input events"| node_desktop
node_main -->|"frame and interaction state"| node_visualization
node_visualization -->|"render live feedback"| node_opencv
node_requirements -.->|"declares runtime libraries"| node_main
node_legacy_launcher -.->|"alternate application flow"| node_main

click node_main "https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/main.py"
click node_config "https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/config.py"
click node_tracker "https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/tracker.py"
click node_math "https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/utils/math_utils.py"
click node_gesture "https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/tracker.py"
click node_controller "https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/utils/controller.py"
click node_visualization "https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/utils/visualization.py"
click node_requirements "https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/requirements.txt"
click node_legacy_launcher "https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/gaze_tracker.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_config,node_requirements,node_legacy_launcher toneBlue
class node_opencv,node_tracker,node_mediapipe,node_math,node_gesture,node_visualization toneAmber
class node_webcam,node_controller,node_pyautogui,node_desktop toneMint
```

## Components

### Application Runtime

- [Real-time loop](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/main.py): application entry · Coordinates frames, interaction, control, and feedback. · `eye_gaze_hci/main.py`
- [Tuning config](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/config.py): configuration module · Centralizes screen, calibration, and gesture thresholds. · `eye_gaze_hci/config.py`
- [Dependencies](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/requirements.txt): runtime manifest · Declares the local Python runtime dependencies. · `eye_gaze_hci/requirements.txt`
- [Alternate launcher](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/gaze_tracker.py): legacy entry point · `gaze_tracker.py`

### Vision & Interaction

- **OpenCV**: vision runtime · Captures and processes camera frames.
- [Gaze tracker](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/tracker.py): perception pipeline · Normalizes landmarks into gaze and gesture measurements. · `eye_gaze_hci/tracker.py`
- **MediaPipe Face Mesh**: landmark engine · Produces refined face and iris landmarks.
- [Gaze math](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/utils/math_utils.py): signal processing · Maps eye geometry and smooths cursor coordinates. · `eye_gaze_hci/utils/math_utils.py`
- [Gesture state](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/tracker.py): interaction state · Interprets winks, mouth toggle, scrolling, and cooldowns. · `eye_gaze_hci/tracker.py`
- [Live visualization](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/utils/visualization.py): feedback renderer · Draws camera, landmarks, and interaction feedback. · `eye_gaze_hci/utils/visualization.py`

### Host I/O

- **Webcam**: local device
- [OS controller](https://github.com/srinathsenthilkumar/real-time-hands-free-human-computer-interaction-via-eye-gaze-tracking-and-gestures/blob/main/eye_gaze_hci/utils/controller.py): actuator adapter · Converts semantic commands into desktop input. · `eye_gaze_hci/utils/controller.py`
- **PyAutoGUI**: OS automation library
- **Host desktop**: operating system · Receives cursor, click, and scroll events.

## Connections

- Webcam → OpenCV: camera frames
- OpenCV → Real-time loop: processed frames
- Real-time loop → Gaze tracker: analyze frame
- Gaze tracker → MediaPipe Face Mesh: refined landmarks
- Gaze tracker → Gaze math: iris/eye geometry
- Tuning config → Gaze math: screen and smoothing tuning
- Gaze math → Gesture state: smoothed gaze
- Gaze tracker → Gesture state: wink and mouth measures
- Tuning config → Gesture state: thresholds and cooldowns
- Gesture state → OS controller: cursor, click, scroll commands
- OS controller → PyAutoGUI: automation calls
- PyAutoGUI → Host desktop: OS input events
- Real-time loop → Live visualization: frame and interaction state
- Live visualization → OpenCV: render live feedback
- Dependencies → Real-time loop: declares runtime libraries
- Alternate launcher → Real-time loop: alternate application flow
