Skip to main content

Gaze-tracking and pupillometry with MEYE

Project description

MEYELens

MEYELens: 3D-Printable Wearable System for Pupillometry and Gaze Tracking

MEYELens

MEYELens is a low-cost, modular, 3D-printable eyewear platform for pupillometry and gaze tracking, designed to be reproducible and adaptable across research and clinical contexts. The project includes printable hardware, acquisition scripts, and an open-source processing toolkit (meyelens) providing both a Python API and a GUI for offline analysis.

This project is based on MEYE


3D PRINT

3D printing files are in the 3d_print_files/ folder.

If you have a Bambu Lab printer, you can also find them on MakerWorld

The files are also uploaded to NIH 3D

Bambu Studio

We used Bambu Lab Matte Black PLA.

Print settings (Bambu Studio baseline profile with fixed infill):

  • 0.2 mm layer height, 0.4 mm nozzle
  • Supports enabled, 2 wall loops
  • ~50% gyroid infill (lower infill may reduce print time)
  • ~55 g filament, ~3 hours (printer-dependent)
3D Printer Bed

CAMERAS (TESTED CONFIGURATIONS)

The platform supports:

  • Single camera: pupillometry (optionally chin-rest gaze tracking)
  • Dual camera: eye + world camera for naturalistic gaze tracking
Cameras Used

Tested camera modules:

  • GC0307 (640×480, nominal 30 Hz; IR-cut removed; external 96-LED IR illuminator)
  • GC0308 (640×480, nominal 30 Hz; built-in IR LEDs; 50° eye lens, 80° world lens)

Note: low-cost camera modules may not sustain the advertised FPS. In our tests, we often limited capture to 20 fps for stability.


ASSEMBLY

Assembly uses mostly standard fasteners:

  • M3 × 16 mm (×3) - frame joints
  • M3 × 12 mm (×4) - ear supports, camera arm, ball joint
  • M3 nuts (×6) - except the ball-bearing anchor (as used in our build)
  • M2 × 10 mm + M2 nuts - camera mounting

Exploded view / assembly diagram:

MEYELens exploded view

MEYELens SOFTWARE

Install

We recommend using a dedicated environment:

conda create -n meyelens python=3.10 -y
conda activate meyelens
pip install meyelens[tf]

This installs a standard TensorFlow dependency set, which may run on CPU depending on your system.

TensorFlow GPU support (optional)

If you want to manage TensorFlow yourself (e.g., to enable GPU support), install MEYELens without TensorFlow and then follow TensorFlow’s official installation guide:

pip install meyelens

Then install TensorFlow following:

GPU enablement depends on your OS, CUDA/cuDNN compatibility, and TensorFlow version. Follow the TensorFlow guide exactly for your platform.

Documentation

API documentation: https://raffaelemazziotti.github.io/MEYElens/


UTILIZING THE PACKAGE

We provide examples to use the library:

Quick test

To quickly check that the camera and Meye model are working:

from meyelens import meye, camera

cam = camera.Camera(camera_ind=0)  # Select the correct camera index for your setup.
meye = meye.Meye()
meye.preview(cam)

offline_recorder

Records a video and a .csv with trigger markers sent through keypresses.

Controls:

  • 1–9: send trigger markers
  • S: start recording
  • E: stop recording
  • Q: quit

online_recorder

Same behavior, but runs online prediction and does not save the video.

gaze_tracking_example

Runs a calibration process and then shows the predicted gaze on a gray background.


OFFLINE GUI (PUPIL PROCESSING)

If you recorded videos through the offline_recorder (or have your own IR eye videos), you can run the offline GUI:

conda activate meyelens
python -m meyelens_offlinegui
GUI

GUI workflow:

  1. Select a model file (the packaged model is detected automatically when available).

  2. Select a video file.

  3. Preview a frame and adjust parameters (threshold / closing / invert / flip), then drag the ROI box.

  4. Run full processing.

Outputs:

  • *_pupil.csv written next to the input video
  • Optional overlay QC video (if enabled)

CITATION

If you use MEYELens in your work, please cite the following papers:

MEYELens: 3D-Printable Wearable System for Pupillometry and Gaze Tracking
G. Vecchieschi, L. Ingenito, A. Benedetto, C. Luciani, F. Carrara, G. Cioni, A. Guzzetta, T. Pizzorusso, L. Baroncelli, R. M. Mazziotti
DOI: [ADD LINK]

MEYE: Web App for Translational and Real-Time Pupillometry
R. Mazziotti, F. Carrara, A. Viglione, L. Lupori, L. Lo Verde, A. Benedetto, G. Ricci, G. Sagona, G. Amato, T. Pizzorusso
eNeuro (2021) 8(5): ENEURO.0122-21.2021
DOI: https://doi.org/10.1523/ENEURO.0122-21.2021


LICENSE

  • Code: GPL-3.0 license
  • Hardware files: CERN-OHL-P-2.0

CONTACT

Raffaele M. Mazziotti
Email: raffaelemario.mazziotti@unifi.it

Giacomo Vecchieschi
Email: giacomovecchieschi@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meyelens-0.2.1.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meyelens-0.2.1-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file meyelens-0.2.1.tar.gz.

File metadata

  • Download URL: meyelens-0.2.1.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for meyelens-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5de459f054224fd76e0132dd67957c335d1763f3451905b7a4b0ba40ff818871
MD5 8edaf0c566ca862f408ab0a8013346fe
BLAKE2b-256 a9762768c6f8a4c8ae345fced38b604615ed836550acb123289bbe07dbcb06f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for meyelens-0.2.1.tar.gz:

Publisher: publish.yml on raffaelemazziotti/MEYElens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file meyelens-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: meyelens-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for meyelens-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 136c27d0ae09110ed9b7b6dfe0dfff99eacf34ef243d930f693a92392e53e929
MD5 33a8264db05e1d3d56a338526f7e12d7
BLAKE2b-256 865318c2ba30e05e17496b8349f9369e879efa75fb96af7adc9b401911c284bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for meyelens-0.2.1-py3-none-any.whl:

Publisher: publish.yml on raffaelemazziotti/MEYElens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page