Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 3.35 KB

README.md

File metadata and controls

57 lines (41 loc) · 3.35 KB

MEYE pupillometry on MATLAB

Try MEYE on a standalone Web-App

Learn more on the original MEYE repo

Label your own dataset with pLabeler

Starting from MATLAB version 2021b, MEYE is also available for use on MATLAB!

Here's a brief tutorial on how to use it in you own experiments.

What do you need?

Quick start!

% Create an instance of Meye
meye = Meye('path/to/model.onnx');

% Example 1
% Make predictions on a single Image
%
% Load an image for which you want to predict the pupil
img = imread('path/to/img.tif');
% Make a prediction on a frame
[pupil, isEye, isBlink] = meye.predictImage(img);

% Example 2
% Make predictions on a video file and preview the results
%
meye.predictMovie_Preview('path/to/video');

Examples

Inside the file example.m you can find 5 extensively commented examples of some use cases for MEYE on MATLAB.
These examples require you to download example data from here. To run the examples succesfully, make sure that the downloaded files are in the same folder as the example.m file.

Known issues

Small issue with Upsample layers

When importing a ONNX network, MATLAB tries to translate all the layers of the network from ONNX Operators to built-in MATLAB layers (see here).
This operation is not succesful for all the layers and MATLAB tries to overcome erros by automatically generating custom layers to replace the ones that it wasnt able to translate. These custom layers are stored in a folder as MATLAB .m class files.
We found a small bug in the way MATLAB translates Upsample layers while importing MEYE network. In particular, the custom generated layers perform the upsample with the nearest interpolation method, while it should be used the linear method for best results.
For now, we solved this bug by automatically replacing the nearest method with the linear one in all the custom generated layers. This restores optimal performance with no additional computational costs, but it's a bit hacky.
We hope that in future releases MATLAB's process of translation to its own built-in layers will be smoother and this trick will not be needed anymore.