[open] EyeTribe and PyGaze
I've been trying to get an EyeTribe tracker working with PyGaze. I'm hoping someone can help me troubleshoot a problem with logging the tracker fixation output.
The setup is the WinPython-PyGaze-0.5.1 self-contained installation downloaded from the PyGaze website.
To test the setup, I have taken the scripts experiment.py and constants.py and folders img and data from Edwin Dalmaijer's EyeTribe test (https://github.com/esdalmaijer/EyeTribe_test/tree/master/experiment) and put them in folder inside the "examples" folder of the pygaze module in WinPython-PyGaze-0.5.1. My thought here is not to replicate the experiment but to use it to make sure the setup is working.
If I comment out the saccade portion of experiment.py, the script runs through fine, but doesn't log the eyetracker fixation data. It produces log output like this as shown in Example A below. For some reason, when the eyetracker calibration finishes, the time stops updating and data that should be written as a result of the call tracker.start_recording() doesn't get written.
However, if I comment out tracker.calibrate() and use the EyeTribe tool to calibrate before running the script, the log contains fixation data as in Example B.
It seems that pygaze may be having trouble accessing the tracker after running tracker.calibrate(). Can anyone help me figure out what I need to do to get the script to run?
David
Example A:
MSG 2015-09-01 17:04:04.670 179916862 pygaze initiation report start
MSG 2015-09-01 17:04:04.703 179916895 display resolution: 1920x1200
MSG 2015-09-01 17:04:04.703 179916895 display size in cm: 33.8x27.1
MSG 2015-09-01 17:04:04.703 179916895 samplerate: 30.00 Hz
MSG 2015-09-01 17:04:04.703 179916895 sampletime: 33.33 ms
MSG 2015-09-01 17:04:04.736 179916928 fixation threshold: 1.5 degrees
MSG 2015-09-01 17:04:04.736 179916928 speed threshold: 35 degrees/second
MSG 2015-09-01 17:04:04.736 179916928 acceleration threshold: 9500 degrees/second**2
MSG 2015-09-01 17:04:04.736 179916928 pygaze initiation report end
MSG 2015-09-01 17:04:22.323 179934515 pygaze calibration report start
MSG 2015-09-01 17:04:22.323 179934515 accuracy (degrees): LX=1.4627, LY=1.4627, RX=1.1249, RY=1.1249
MSG 2015-09-01 17:04:22.323 179934515 accuracy (in pixels): LX=73.5629817411, LY=73.5629817411, RX=56.5691202483, RY=56.5691202483
MSG 2015-09-01 17:04:22.323 179934515 precision (RMS noise in pixels): X=37.8039333333, Y=37.8039333333
MSG 2015-09-01 17:04:22.323 179934515 distance between participant and display: 57.0 cm
MSG 2015-09-01 17:04:22.323 179934515 fixation threshold: 75.4397423777 pixels
MSG 2015-09-01 17:04:22.323 179934515 speed threshold: 1.75985870146 pixels/ms
MSG 2015-09-01 17:04:22.323 179934515 acceleration threshold: 482.10192964 pixels/ms**2
MSG 2015-09-01 17:04:22.323 179934515 pygaze calibration report end
MSG 2015-09-01 17:04:22.323 179934515 start_recording
MSG 2015-09-01 17:04:22.323 179934515 VALIDATION_TRIALSTART, trialnr=0, x=288, y=180
MSG 2015-09-01 17:04:22.323 179934515 validation_point_on
MSG 2015-09-01 17:04:22.323 179934515 validation_point_fix
MSG 2015-09-01 17:04:22.323 179934515 validation_point_off
MSG 2015-09-01 17:04:22.323 179934515 stop_recording
MSG 2015-09-01 17:04:22.323 179934515 start_recording
MSG 2015-09-01 17:04:22.323 179934515 VALIDATION_TRIALSTART, trialnr=1, x=288, y=600
MSG 2015-09-01 17:04:22.323 179934515 validation_point_on
MSG 2015-09-01 17:04:22.323 179934515 validation_point_fix
MSG 2015-09-01 17:04:22.323 179934515 validation_point_off
MSG 2015-09-01 17:04:22.323 179934515 stop_recording
....
Example B:
MSG 2015-09-01 17:10:53.828 180326020 pygaze initiation report start
MSG 2015-09-01 17:10:53.828 180326020 display resolution: 1920x1200
MSG 2015-09-01 17:10:53.828 180326020 display size in cm: 33.8x27.1
MSG 2015-09-01 17:10:53.828 180326020 samplerate: 30.00 Hz
MSG 2015-09-01 17:10:53.828 180326020 sampletime: 33.33 ms
MSG 2015-09-01 17:10:53.828 180326020 fixation threshold: 1.5 degrees
MSG 2015-09-01 17:10:53.828 180326020 speed threshold: 35 degrees/second
MSG 2015-09-01 17:10:53.828 180326020 acceleration threshold: 9500 degrees/second**2
MSG 2015-09-01 17:10:53.862 180326054 pygaze initiation report end
MSG 2015-09-01 17:10:56.093 180328285 start_recording
2015-09-01 17:10:56.126 180328318 False 7 948.5359 603.1096 937.7371 613.9985 16.81485 925.7729 588.4476 929.5175 607.5111 17.3684 0.4012 0.5197 971.299 617.7715 945.9568 620.4858 16.2613 0.5842 0.5295
MSG 2015-09-01 17:10:56.126 180328318 VALIDATION_TRIALSTART, trialnr=0, x=288, y=180
MSG 2015-09-01 17:10:56.126 180328318 validation_point_on
2015-09-01 17:10:56.160 180328352 False 7 944.6416 598.6471 938.2916 613.1371 16.4524 936.7584 585.3172 929.8983 606.1401 17.303 0.4009 0.5197 952.5247 611.9771 946.6848 620.134 15.6018 0.5838 0.5294
2015-09-01 17:10:56.226 180328418 False 7 950.556 623.5518 939.8221 613.5804 16.84195 956.9889 610.9008 933.0311 606.1137 17.6574 0.4006 0.5197 944.1232 636.2028 946.6134 621.0471 16.0265 0.5835 0.5297
2015-09-01 17:10:56.260 180328452 False 7 938.0348 608.8777 939.7335 613.4658 16.3343 943.3262 590.8431 933.799 605.1857 16.966 0.4004 0.5194 932.7433 626.9122 945.6679 621.7457 15.7026 0.5831 0.5295
2015-09-01 17:10:56.293 180328485 False 7 962.1305 603.2253 940.8586 613.2537 16.5727 958.2985 591.9441 935.0056 604.734 17.5973 0.4 0.5192 965.9624 614.5065 946.7117 621.7733 15.5481 0.583 0.5291
2015-09-01 17:10:56.326 180328518 False 7 955.0674 619.9399 941.3539 613.564 16.76485 956.3131 596.7495 936.2361 604.3339 17.4347 0.3999 0.519 953.8217 643.1303 946.4717 622.7939 16.095 0.5828 0.5291
2015-09-01 17:10:56.360 180328552 False 7 937.7423 628.5649 941.5235 614.5604 16.6571 943.736 598.166 937.2473 603.887 17.4866 0.3996 0.5191 931.7487 658.9639 945.7996 625.2341 15.8276 0.5825 0.5291
2015-09-01 17:10:56.393 180328585 False 7 973.4203 606.4723 943.7604 614.2894 16.734 968.6191 573.5208 939.552 602.0162 17.2284 0.3998 0.519 978.2216 639.4238 947.9688 626.5626 16.2396 0.5828 0.529
2015-09-01 17:10:56.426 180328618 False 7 963.1259 645.4539 945.2289 616.4199 16.83925 915.1216 630.5118 938.8088 603.6957 17.6972 0.3997 0.5194 1011.1302 660.3959 951.6493 629.144 15.9813 0.583 0.5292
2015-09-01 17:10:56.493 180328685 False 7 937.4998 582.7087 944.8535 613.4875 16.16435 938.7055 570.8434 938.9278 600.6705 16.9996 0.4003 0.5192 936.2941 594.5742 950.7792 626.3046 15.3291 0.5831 0.5292
2015-09-01 17:10:56.526 180328718 False 7 970.5735 611.8318 946.773 613.3495 16.93935 973.4581 609.6381 941.3558 600.9468 17.1432 0.4008 0.5195 967.689 614.0254 952.1899 625.7524 16.7355 0.5835 0.5294
2015-09-01 17:10:56.559 180328751 False 7 970.6635 606.948 948.4608 612.7483 16.77055 967.933 589.3924 943.0216 599.8597 17.4099 0.4009 0.5194 973.394 624.5037 953.8999 625.637 16.1312 0.5838 0.5295
2015-09-01 17:10:56.593 180328785 False 7 999.5775 266.8542 999.5775 266.8542 17.00135 957.7495 607.2889 944.6583 599.7921 17.7154 0.4011 0.5196 1041.4056 -73.5804 1041.4056 -73.5804 16.2873 0.5837 0.5295
2015-09-01 17:10:56.626 180328818 False 7 953.09 621.512 953.09 621.512 17.0303 967.9977 618.4736 946.6398 600.5434 17.5898 0.4015 0.5197 938.1821 624.5504 938.1821 624.5504 16.4708 0.5841 0.5296
.....
Comments
Hi David,
Thanks for trying to figure this one out yourself before turning to the forum, I appreciate the information to debug your issue with!
For starters, the saccade bit you commented out doesn't work due to the lack of data coming in. The repeating time stamps are due to the simple heuristic PyTribe uses for time-stamping messages, which is to use the time of the last known sample. Without any samples coming in, the last known timestamp is from the calibration.
Despite the logs, I can't quite figure out what's going wrong. I agree it seems to have to do with the calibration. Did you notice anything weird while doing it? Did it cut out before finishing all points?
Could I ask you to post the content of an EyeTribe log from two experimental sessions: one with and one without a call to
calibrate
? You can find logs in the following folder:C:\Users\USERNAME\AppData\Local\EyeTribe\Logs
Where
USERNAME
is your actual user name.Best,
Edwin
Thanks Edwin!
Here are the EyeTribe logs for a run with and without eyetracker.calibrate() in experiment.py.
With: https://drive.google.com/open?id=0B_tWlE-q6acAcWRNVW92ZTRKNkU
Without: https://drive.google.com/open?id=0B_tWlE-q6acAcWRNVW92ZTRKNkU
The datafiles corresponding to those runs are:
With: https://drive.google.com/open?id=0B_tWlE-q6acAUTA5QUphX3czWkU
Without: https://drive.google.com/open?id=0B_tWlE-q6acAWkNzRldlRTFpT2M
I also have a MATLAB installation with PTB, so I ran the Example_PTB.m script from the EyeTribe for MATLAB software. Here the calibration works and the data file seems correct. If possible I'd like to use python though since it seems more flexible than PTB.
EyeTribe Log: https://drive.google.com/open?id=0B_tWlE-q6acARHY4T2E2cmk3M3M
Data: https://drive.google.com/open?id=0B_tWlE-q6acAUXhObkQzMzhKOXM
When I run calibration using python, there is a JSON error in the EyeTribe log. I hope it is meaningful!
I made a little progress, perhaps, by seeing whether the python program would run properly if I replace the version of pytribe.py in the WinPython-PyGaze-0.5.1 installation with the one in EyeTribe for MATLAB.
The JSON error in the EyeTribe log is still there, but data is now written to the pygaze log.
Data: https://drive.google.com/file/d/0B_tWlE-q6acAMjNTV3lZck5uNlU/view?usp=sharing
Log: https://drive.google.com/file/d/0B_tWlE-q6acAQXctaGNCYTZreGM/view?usp=sharing
Just a quick answer, to let you know I haven't forgotten about this. I'm currently away, and have no EyeTribe handy, so I can't actually test anything.
I have a feeling the issue might arise from a mismatch between versions of the EyeTribe Server and PyTribe. Specifically, the error messages indicate the calibration point command is not understood by the EyeTribe Server. This is odd, because that code works on the versions I have used and those that I have seen others using.
Three options remain: 1) You've downloaded the newest EyeTribe Server version and functionality broke there, 2) You're working with an older version of the EyeTribe Server, or 3) Something else entirely. From your log I can see you're using v0.9.56, but I can't access my PC to check whether this is newer or later. Sorry!
Will check back in a week or two, when I return to my lab.
Thanks Edwin. 0.9.56 is the latest version of the server. I might try finding an older version and checking to see if it works.
My test version was 0.9.41, so there might be something there. Will report back after more elaborate testing.
Thanks Edwin. Appreciate the help.
Hi guys,
It might not be fully relevant to this topic but I am curious about the benchmarks provided at the beginning of the file.
For example,
fixation threshold: 1.5 degrees
speed threshold: 35 degrees/second
acceleration threshold: 9500 degrees/second**2
These thresholds seem important in fixation and saccade detection but it appears that the PyGaze in OpenSesame only gives you the raw data. So should I just ignore this information? In fact for the last project I imported the data into OGAMA 5.0 and used its algorithms to do post-experiment fixation detection...
Another question is, where I can find the explanations of the headers (e.g., rawx, rawy, avgx, etc.) of the data file?
@Edwin @DLC @sebastiaan Thanks guys!
Han
Hi Han,
The thresholds are only used in PyGaze's online event detection functions, i.e.
wait_for_*
. They do not affect the calibration or the data collection.The headers are simply the values that the EyeTribe produces. See their website (www.theeyetribe.com) for more info. Feel free to ask about whatever you can't find
Cheers,
Edwin
PS. On the original topic: I've lost track of tech and software projects a bit, for various reasons, but hope to get back to them soon. Sorry about the delay.