Skip to content

feat(zyra-eyes): add calibrated gaze-to-pointer control - #67

Merged
sonoxo merged 4 commits into
mainfrom
feat/zyra-eyes-gaze-control
Sep 1, 2026
Merged

sonoxo merged 4 commits into
mainfrom
feat/zyra-eyes-gaze-control

Conversation

@sonoxo

@sonoxo sonoxo commented Sep 1, 2026

Copy link
Copy Markdown
Owner

ZYRA Eyes gaze augmentation

Adds a local webcam gaze runtime so ZYRA Eyes can map an authorized operator's eye movement to screen coordinates and optionally move the local pointer.

Implemented

  • nine-point user calibration
  • OpenCV face/eye detection and pupil feature extraction
  • supports one detected eye or two detected eyes
  • per-user calibration mapped to the current screen
  • EMA gaze smoothing and configurable deadzone
  • preview/simulation mode by default
  • native pointer-follow mode behind the existing owner sentinel + --native --approve
  • PyAutoGUI emergency corner failsafe plus Esc/Ctrl-C shutdown
  • camera frames remain memory-only
  • calibration stores numeric coefficients only
  • local session audit metadata
  • macOS Camera / Screen Recording / Accessibility setup documentation
  • CI syntax + safety invariant coverage

Scope

This is an accessibility/control experiment and local operator interface, not a medical device, remote-control implant, credential tool, or authorization bypass. No webcam frame is written to disk and native mode only moves the pointer.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T10:03:32.027467Z d5d011a PR opened
🔒 Security Review Completed 2026-09-01T10:03:35.891493Z d5d011a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sonoxo
sonoxo merged commit 6cf8563 into main Sep 1, 2026
7 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d5d011a439

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +343 to +344
x_coefficients, *_ = np.linalg.lstsq(design, target_x, rcond=None)
y_coefficients, *_ = np.linalg.lstsq(design, target_y, rcond=None)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject degenerate calibration fits

When pupil extraction yields nearly identical or collinear features across the nine targets, lstsq still returns coefficients and the calibration is saved as successful because its rank, condition, and residuals are discarded. The resulting pointer can remain near the center or jump between clamped screen edges, so reject rank-deficient or high-error fits and ask the user to recalibrate.

Useful? React with 👍 / 👎.


def run_gaze(camera_index: int, camera_width: int, camera_height: int, native: bool, approve: bool, smoothing: float, deadzone: float, preview: bool) -> None:
require_native_authorization(native, approve)
model = load_calibration()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate the active display against the calibration

When the display resolution changes after calibration, --run loads the old screen dimensions without comparing them with pyautogui.size(). Since CalibrationModel.predict clamps to those stored dimensions, a larger display becomes partly unreachable and a smaller display receives out-of-range pointer coordinates; require recalibration or transform the predictions for the active display before starting the session.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant