Skip to content

This project implements a CNN and trains it to predict the pupil position in an image or video.

License

Notifications You must be signed in to change notification settings

nahueespinosa/pupil_finder

Repository files navigation

Pupil Finder

This project implements an CNN and trains it to predict the pupil position in an image.

Demo Image

Getting started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Ensure you have Python 3.7 and git installed. TensorFlow currently does not support Python 3.8.

Installation

Clone this repository:

$ git clone https://github.com/nahueespinosa/pupil_finder.git

Install requirements:

$ pip3 install -r requirements.txt

If you want to train your own models download the dataset and extract it in the repository. More information can be obtained here.

Usage

To train a neural network use this command:

$ python main.py -h
usage: main.py [-h] [-v] [-l LIMIT] [-s] filename

Train a CNN to identify pupil position.

positional arguments:
  filename             name of the output file (use *.h5 for HDF5 format)

optional arguments:
  -h, --help           show this help message and exit
  -v, --verbose        increase verbosity level
  -l LIMIT             limit the number of images to load
  -s, --show-database  show database images before processing

To test a trained model with a camera you can use this script:

$ python test_model.py -h
usage: test_model.py [-h] filename

Test CNN to predict pupil position using a camera.

positional arguments:
  filename    name of the input model file

optional arguments:
  -h, --help  show this help message and exit

Configuration

Logging and training parameters can be configured modifying the file configuration.yml.

training:
  img_width: 64
  img_height: 64
  epochs: 50
  test_size: 0.4

Acknowledgements

The dataset was obtained here from the Media Research Lab (MRL) at the Department of Computer Science, Faculty of Electrical Engineering and Computer Science, VSB - Technical University of Ostrava.

About

This project implements a CNN and trains it to predict the pupil position in an image or video.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages