A Python interface for the Tobii Eye Tracker. Supports GUI and websocket server.
- Support for both 32-bit and 64-bit (massive improvement, guys!) Python environments.
- Easy-to-use GazeTracker class for 64-bit applications compare to V1.
- Backward compatibility with the original 32-bit EyeTracker interface
Download the executable from the releases page and run it. This provides a graphical interface and WebSocket server.
Run the WebSocket server from the command line:
python WebSocketServer.py
For 64-bit applications, use the new GazeTracker class:
from GazeTracker import GazeTracker
import time
# Start the eye tracker
tracker = GazeTracker()
for i in range(100):
# Read data every second, result is a list of tuples (x, y)
print(tracker.get_movement())
time.sleep(1)
- Ensure you have Python installed (32-bit or 64-bit)
- Install required dependencies:
pip install pywin32 websockets
- Copy
TobiiEyeTracker.pyd
,tobii_stream_engine.dll
,GazeTracker.py
, and_listener_win32.py
into your project directory - Set up the
PYTHON_32BIT
path inGazeTracker.py
- install python 32bit (if you are using conda, try:
set CONDA_SUBDIR=win-32
andconda create -n py32 python=3.7
) - install pywin32:
pip install pywin32 websockets
To develop additional functions, follow these steps:
- Download Tobii Native Stream Engine using NuGet in Visual Studio
- Open Package Manager Console
- Search for "Tobii.StreamEngine" and install the package (This can no longer be done becase Tobii decided to sell its pro line for more money)
- Follow the setup instructions in the Visual Studio C++/Python integration guide
- Refer to the Tobii Stream Engine API documentation for available functions and usage
See the LICENSE file for details.