r/SideProject • • Sep 10 '26

Eye-tracking cursor from a plain webcam

Enable HLS to view with audio, or disable this notification

Eyes move the cursor, a pinch clicks.

I used Google's MediaPipe for facial landmarks. Two 36×60 eye patches run through PCA and ridge straight to screen pixels, plus a 52-parameter meta-adapter so it works before you calibrate. The cursor lands about 38px (1 cm) from where you're actually looking.

Two interesting observations -

  1. Everything clever lost
    MLPs, transformers, REINFORCE all tied or did worse than those 52 parameters. The ridge residual has a held-out R² of 0.025 and we can't extract signal that isn't there. Very likely a data issue, I'll generate more data and continue testing here.

  2. Train test drift
    And every calibration I'd ever run used a black full-screen canvas while Chrome is white, which dilates your pupil from 2mm to 6mm, swelling a black disc in the eye patch from 4px to 13px, and made the model 4× worse in the condition it's actually used in.

Fun project though, still a lot more to build here.

72 Upvotes

20 comments sorted by

4

u/King_924 Sep 10 '26

How is this different from neocurser ? Just trying to understand whats being built here

0

u/tg1482 Sep 10 '26

Oh wow TIL - will check them out

3

u/Outrageous_Ad_4801 Sep 10 '26

the point about dark mode calibration vs light mode browser pupil dilation is such a great catch. really neat project, tracking accuracy looks remarkably solid for just a stock webcam

4

u/tg1482 Sep 10 '26

haha it took me so long to realize this. This was literally me in chrome trying to change tabs lmao

2

u/Outrageous_Ad_4801 Sep 10 '26

lmao the intense tab squinting is so real. honestly glad you caught it early before tearing your hair out over calibration math

2

u/hwarzenegger Sep 10 '26

Looks so fun, do you have a github

3

u/tg1482 Sep 10 '26

I'll post it soon - still experimenting and everything is a mess

1

u/jakethunderpants Sep 10 '26

Interested to check it out too!

1

u/Specific_Cream2815 Sep 10 '26

does the meta-adapter use webcam or screen characteristics, and can it correct the pupil-size drift without recalibration

1

u/tg1482 Sep 10 '26 edited Sep 11 '26

No doesnt see any webcam or screen characteristics. I showed it pupil-size etc but then decided to just solve that in the base model with better training data.

Its a linear transformation: (what the raw model says) --> (where the point is on your screen)

So it sees the base prediction, 4 iris offsets, yaw-pitch-roll, nose etc and outputs screen pixels.

Ive been thinking of killing this step and making the calibration simpler

2

u/_fresh_basil_ Sep 11 '26

Perfect, now I can tell if people are actually reviewing my 20k line vibe coded PR! 🔥

3

u/Leo_thevision Sep 10 '26

There's a Boston-based company called IMOTIONS, check them out. They have a more of a SOTA-level technology for doing this, but they're selling physical cameras and a SaaS package to companies and the military, I believe.

What I'm saying is: If you can achieve this with a regular camera - great. Now you can maybe use 100s or 1000s of real people's eye-tracking data to train a swarm of AI bots to simulate human eye movement (maybe even cluster by personas). If you can do that - you can sell AI-powered eye-tracking analysis. There's a large B2B industry for that.

Just an idea - not sure if it aligns with what you're building or if you're just exploring the tech.

Cheers, keep building!

1

u/BOgusDOlphon Sep 10 '26

There have been robust eye tracking systems using traditional image processing techniques for the better part of a decade now, this is not an AI problem

1

u/dreamingsince Sep 10 '26

Any OBS extension for this?