Detect blinks using the J!NS MEME glasses
Data is recorded with the JINS-MEME Data Logger and OpenFace.
- Connect the JINS data logger to the glasses, but do not start recording. Set the mode to'Full'. It is recommended to set the transmission speed to 100Hz.
- Set OpenFace to record AUs. You may also set it to record other things, but AUs are all that is necessary.
- Begin recording the webcam with OpenFace, then begin measuring with JINS. Once both are running, blink repeatedly at the webcam.
- Begin to blink normally, making sure your eyes are visible to the webcam and the JINS glasses are getting a good signal.
- Before stopping the recording blink repeatedly again. Stop measuring with JINS and then stop OpenFace.
- Move the generated OpenFace and JINS files into a folder of your choosing, and modify the
path
variable inalignment.py
andmerge_data.py
. - Run
alignment.py
. Zoom in as necessary and right click a point on the JINS EOG plot, then right click the corresponding point in time on the OpenFace plot. Close the window. A new window will open showing the end of the data. Again, right click on an JINS EOG point and then on the corresponding OpenFace point. Close the window. - Run
merge_data.py
.
After recording data, a model can be trained to look at the JINS EOG signal and determine if the user is blinking or not.
- Set the
training_data_fname
intrain.py
to thecombined.csv
file produced bymerge_data.py
. - Run
train.py
Once a model has been trained, blinks can be detected in realtime.
- Open the JINS MEME Data Logger. Make sure 'external output socket' is turned on in settings. Connect to the glasses and begin. Set the mode to 'Full' and the transmission speed to the speed you chose when recording. Start measuring.
- Run
live_classify.py
. It will ask for the IP address and port of the JINS data logger. You can also run live classify with arguments like so:
$ python live_classify.py ip_address port