Gaze Detection

  • Date: November 4, 2023
  • Categories: Fun

The code for this project is published on Github

Project Summary

 The idea for this project was born from an issue I regularly see in video calls, whereby when a person has multiple monitors and isn’t looking at the one with their webcam attached, the rest of the people in the call are stuck looking at the side of their face, which gives the impression of them being disinterested and it also reduces the immersion for everyone else on the call.

 I had a couple of webcams laying around so I decided to put two of them on different monitors, and attempt to make a program that automatically switches between them based on the monitor a person is looking at.


 The full details can be seen on the Github repository for this project (linked above), however as a brief overview the project uses something called Gaze Detection, which is an area of machine learning research focussed on trying to detect where a persons eyes are looking.

 Using a pre-existing Python module called Gaze Tracking, I have been able to make a program that passes in frames from different camera sources and then gets back an estimated value of where the eyes are looking (relative to the camera). Using these returned values, my program simply selects the camera which a person is most likely to be looking at based on the gaze tracking estimates.

 The bulk of my own code simply just interfaces with the gaze tracking module, and compares readings to then try and select a webcam feed to pipe through a virtual camera – that can then be selected in video conferencing apps. My program also does a variety of things to try and improve the reliability of switching – so that cameras do not flicker between each other really fast – these measures include adding a timeout before switching, and gathering the average of readings over a set measurement period to have more data to be compared when considering which camera should be selected and piped through the virtual camera.

More details can be seen on the Github, and I am continuing to explore different ways to improve the reliability of the program.