@user-a09f5d There is a default depth value that is being assumed. In your case, it should always be the same z-value, correct? @papr Hi Papr. The values for
gaze_normal0_z
are not the same and actually vary quite a bit (easily as much as the values for x and y in some places) hence my confusion.
A second screen shot that shows quite well how much z seems to change.
@user-a09f5d Thank you for providing the screenshots. I will have a look at the code to refresh my memory.
Thank you @papr
Hi! A different issue this time. A few days ago I made a recording in pupil capture (using a core head set) to test out and compare different methods of calibrating the set up. Immediately after making the recording I opened it in pupil player and used the post-hoc gaze calibration to create separate calibration files (each based on the different calibration methods used during recording) and then map the gaze point of each calibration so I could visually compare their accuracy. This all worked fine with no issues, however ever since I closed pupil player I experience problems every time I try to reload the recording. The recording opens as normal in player under default setting, however player crashes (without recovery) every time I try to switch to post-hoc gaze calibration meaning the recording is currently unusable. I would be extremely grateful for any advice on how to resolve this issue and/or how to stop it happening again. Happy to provide as much information as you need. Many thanks!
Hi @user-a09f5d, please share the log file with us after Player crashes. Assuming you run Pupil from bundle, you can find it your home folder > pupil_player_settings > player.log
Either post it here, or share it with data@pupil-labs.com
No problem. I have attached the log.
@user-a09f5d Mmh, it looks like the data is somehow inconsistent. I would suggest deleting the offline_data
folder and setting up the post-hoc calibrations and gaze mappers again.
@user-a09f5d Mmh, it looks like the data is somehow inconsistent. I would suggest deleting the
offline_data
folder and setting up the post-hoc calibrations and gaze mappers again. @papr Thanks, that seems to have worked and it no longer crashes. Do you have an idea what could have caused the problem so I can take steps to avoid it happening again? It took me quite a while to set up the post-hoc calibration and gaze mappers so I'd like to avoid having the same issue again.
I have not come across this issue before. This must have been an issue during saving the result cache. Do you remember Player crashing after running the post-hoc mapping successfully?
No, I don't recall it crashing the day I made the recording and calibrations. It only crashed today when I tried to work with the recording again. With that said however, from time to time I do experience the problem of player not opening and this can only be solved by deleting user_settings_player
in pupil_player_settings (I found this solution online as someone else had reported the same issue on one of your forum pages).
@user-a09f5d The application window not appearing is a Windows-only issue that is related to multi-monitor setups and will be addressed in our next release.
Should you encounter this issue [1] again, please share a copy of the raw recording, including offline_data
such that we can investigate the issue.
[1] https://discordapp.com/channels/285728493612957698/446977689690177536/750304315431845980
Should you encounter this issue [1] again, please share a copy of the raw recording, including
offline_data
such that we can investigate the issue.[1] https://discordapp.com/channels/285728493612957698/446977689690177536/750304315431845980 @papr I will do. Thanks for your help.
@user-a09f5d I looked at the monocular depth issue. My statement was not entirely correct. We assume a fixed depth, but it is used to scale the pupil normal (gaze direction in eye coordinates) before mapping it to the scene camera.
Hi @papr Thanks for getting back to me on this. I'm afraid I don't completely follow. So what does this mean for the values of gaze_normal[0,1]_z
that are exported in gaze_position.csv? Does pupil normal relate to norm_pos_[x,y]
in pupil_position.csv or gaze_position.csv?
For context, the reason I am interested in gaze_normal[0,1]_[x,y,z]
is because I'm trying to find the best way to calculate the angle of rotation of the eye between two different time points (e.g. if at time_point_1 the left eye is looking at target A but at time_point_2 the same eye is looking at target B; I want to calculate the angle between the gaze direction at time_point_1 and time_point_2). I am currently testing out if I can use the the x, y, z values provided by gaze_normal[0,1]_[x,y,z]
to calculate this angle of rotation. Hopefully that makes sense?
@user-a09f5d Do you care about the targets or only about the individual eye movement?
In the former case, use gaze_normals, in the latter use circle_3d_normal
I only care about the rotation of the eye along the x and y axis.
x and y axis of the eye image or the scene camera?
To be honest, I think using gaze normals migth make more sense, nontheless, as they have a common coordinate system
if you use circle_3d_normal, the vectors lie in different coordinate systems and comparing the x/y differences of both eyes will not be possible
@user-c5fb8b @papr Thanks for your help earlier. With 2019.4, I'm getting the following warning:
Assets\Plugins\Pupil\Scripts\Calibration.cs(133,31): warning CS0618: 'InputTracking.GetLocalPosition(XRNode)' is obsolete: 'This API is obsolete, and should no longer be used. Please use InputDevice.TryGetFeatureValue with the CommonUsages.devicePosition usage instead.'
Should this cause any issues? I can't remember if I had this warning with the 2018 version.
@user-99ee4f Unity's InputTracking
was marked obsolete in version 2019.2, so it does not cause issues in 2018. I did not find why they deprecated it, but it seems the InputTracking
system did not pick up some sorts of input controllers, such as GameControllers, HardwareTrackers, ...
That being said, marking a method as obsolete
normally means it still works the same way as it did before, but might be removed at some point in the future. In HMD-Eyes this is only used to read the 3D coordinates of the eyes from the XR integration. If this continues to work for you, then you should be fine.
Hi,
Hope you're all well. Have a question about data extracted from gaze pldata files (recordings made in capture 1.9.7). In python, using load_pldata_file with the topic 'gaze', seems to be returning data with a frequency just over 240Hz. Trying to understand why that would be the case - i read somewhere about prioritising latency in data recordings and the timestamps we're getting appear twice (with differences on the 5th or so decimal) - Am i seeing gaze data for left and right eyes, or have i accidentally accessed the pupil data instead?
Any advice?
Thanks, Sam.
@user-5b46cf This is a result of how we match pupil data in realtime in order to map it go binocular and monocular gaze. We have made a detailed visualization of how the algorithm builds pairs here: https://nbviewer.jupyter.org/github/pupil-labs/pupil-matching-evaluation/blob/master/gaze_mapper_evaluation.ipynb I think the key message is that a single pupil datum can be used for two different gaze points.
@papr Great thanks - just the info i was looking for - i'll have a look through the docs.
hi all, I am wondering if there is a way to batch export the pupil lab recordings (like a script) instead of opening the pupil player and manually export the data. Thanks in advance!
Hi @user-664974, Pupil Player does currently not support batch export
Thanks @user-c5fb8b I only managed to create a python script to load the pupil player recordings in a for loop and then manually export them. Only if there was a way to send a command 'e' to the pupil_player.exe 🙂 Thanks anyways!
I keep getting this message "world - [ERROR] calibration_choreography.screen_marker_plugin: Calibration requiers world capture video input." and it won't let me calibrate my pupil. Can anyone help?
@user-ec94b9 Hey 🙂 Which software version and hardware do you use?
I have the pupil core headset and the pupil capture software v2.3.0.
@user-ec94b9 Do you see the realtime camera preview in all three windows?
Or has any of the windows a grey background?
I just realized I have v2.4.0. so I opened that and it's working!
great! My guess is the cameras were not correctly detected the first time.
It now says "calibration failed - not enough pupil data"
@user-ec94b9 Same questions apply here: Do you see the realtime camera preview in all three windows? Or has any of the windows a grey background?
I only see the realtime camera preview in one window; the other two windows have a white background.
@user-ec94b9 It looks like these cameras are not setup correctly. Which operating system do you use?
Windows 10?
ok. Then it looks like the drivers are not properly installed. Please turn Capture off, make sure the headset is properly connected and start Capture again. If there is a dialogue asking for administration permissions, please grant them.
Okay - thanks SO MUCH for all of your help.
Should the real time video show up in all three windows?
Yes, each window represents one of the three cameras: world/scene, eye0/right eye, and eye1/left eye
@user-ec94b9 Are the eye0/1 windows still grey/white?
"Plugin Gazer3D failed to initialize"
Those two windows are gone...?
I just have the real time window.
I got the other two windows back 🙂
Sorry for being so dumb LOL
@user-ec94b9 You will need to get all three cameras to work first, else you will get subsequent errors, e.g. Plugin Gazer3D failed to initialize
Ugh, okay. I have all three cameras going, but am still getting the same error. I also can't get my pupils centres in eye0 and eye1
How do I know if these are even working?
@user-ec94b9 Have you gone through the Getting Started guide already? If not, I highly recommend to have a look: https://docs.pupil-labs.com/core/
Hi guys! I used Pupil Core glasses to obtain pupil/gaze positions data from two groups. I have done some visualizations with the Tutorials https://github.com/pupil-labs/pupil-tutorials; but now, I would like to use Python to (statistically) compare those groups (e.g., with student's T-test) using the available data in those datasets. Could anyone recommend me any Python code or paper+code or any ideas to handle those datasets and to perform between-group comparisons? Thank you!
@user-deed87 I can recommend https://pingouin-stats.org as a python lib for statistics. What data you want to compare between your groups highly depends on your research question/experiment
@user-deed87 I can also recommend having a look at their guidelines https://pingouin-stats.org/guidelines.html
dear @papr thank you for your quick reply, I have two groups: frequent book readers vs. not frequent book readers, so I just want to make simple comparisons regarding their eye movements
@user-deed87 Have you setup surface tracking for the books? Sounds like you would want gaze that is mapped onto the book pages.
Unfortunately I didn't gather the data, I am just doing the analyses and the only I got are two datasets: pupil_positions, gaze_positions
Without the scene video?
I already normalized them (I stablished a confidence threshold)
that's the only I have received
for each individual
One thing you could do based on that is to calculate fixations and compare the mean fixation duration between the groups. Assuming the data is clean and only includes data while the subject was actually reading (difficult to tell without the scene video).
I can start from that point
@user-deed87 But to be clear: You don't have a specific research question yet / you are doing explorative research?
is there any Python code to calculate fixations
explorative research
to calculate fixations from the datasets I have
@user-deed87 If you had the original recording, you could use Pupil Player. Without it, you will have to extract the algorithm from here https://github.com/pupil-labs/pupil/blob/master/pupil_src/shared_modules/fixation_detector.py
Ohh I see, in that code, should I pass "gaze_positions" for the "gaze_data" argument in the "detect_fixations" function
"gaze_positions.csv" I mean
You might need to transform the data into dicts. I do not remember the exact input format by heart
Ohhh I see
well, that's a good starting point, thank you for your time!
Hi everyone ! I am really beginner in pupil (plug-ins) developpement. When I try to find the (native) plug-ins files in my windows folder "(user)\pupil_capture_settings\plugins", I don't find anything (while they are displayed in "plug-in manager"). Can you please tell me if it is a normal thing ?
Hi @user-c0fead, this folder is only intended for user plugins. You can write your own plugins and place them there, Pupil will the load these on startup. The native plugins are incorporated in Pupil's source code, which you can find on GitHub: https://github.com/pupil-labs/pupil This separation is especially useful when you run Pupil from the prebuilt bundles, as these do not contain the raw source-code anymore, but still allow you to add custom user plugins that will be loaded at runtime.
Ok, thank you very much @user-c5fb8b .
@user-c0fead does that answer your question? Feel free to ask more, if things are still unclear!
Hum... truth to tell I have indeed one other question : when I try now to add a plug-in in "pupil capture" (I tried with "gcvlc" plug-in), adding the python scripts inside this folder (or the whole folder "gcvlc"), I don't however dont find this plug-in in my "plug-in manager" menu. Is there something more to find the added plug-ins inside "plug-in manager" ?
@user-c0fead Are you running Pupil from source or from bundle?
I am running from bundle.
When running from bundle, Pupil only supports a very limited set of user plugins, as it does not allow (without great effort) to import any Python library that we don't already include in the bundle. I would normally recommend to run Pupil from source when developing custom plugins. Would that be an issue for you?
The session settings (and corresponding plugins folder) can then be found in: path_to_pupil_source\pupil_capture_settings\plugins i.e. it keeps separate session settings when running from source
You can also create a symlink to the dependency in the user plugin folder if you want to run from source.
The session settings (and corresponding plugins folder) can then be found in: path_to_pupil_source\pupil_capture_settings\plugins i.e. it keeps separate session settings when running from source @user-c5fb8b I hope I am not in a wrong folder, but the folders I find inside the pupil source are ".travis", "deployment", "docs", "pupil_external" and "pupil_src". Did I misunderstand ?
@user-c0fead No, this is correct. The folder does not exist before you run Pupil once (and exit then). You can also just create the two folders there: \pupil_capture_settings\plugins
@user-c0fead do I understand correct that you are running on Windows? Please make sure you follow the dependency setup instructions from https://github.com/pupil-labs/pupil/blob/master/docs/dependencies-windows.md
Yes I am running on windows. Thank you for these elements. I am going to try this and won't hesitate to come back to you if other questions. 🙂
this might be a better place to ask this-- anyone have tips for getting an NDSI client running on iOS? all I've been able to find is Zyre and I don't understand it well enough to receive any data (though I have gotten to the point of seeing peers on the network)
Hi again ! I am coming back to you because it seems that I HAVE to run additional pupil plug-ins from the bundle, and not using the source (for admin reasons). I have already managed to use the plug-in "Pupil LSL Relay" in bundle, after having put "pupil_lsl_relay.py" inside the "plugins" folder, but I don't to do the same with file "display_recent_gaze.py" (I don't manage to find it in "Pupil Management").
Can someone please help me to find how to solve my problem ?
it doesn't* do the same
@user-c0fead what do you mean with > I don't manage to find it in "Pupil Management"? Do you mean the plugin does not show up in the Plugin Manager menu?
Yes, that's what I mean.
@user-c0fead please share the log file with us, it might contain information on why your custom plugin is not being loaded. You can find it in: your user folder > pupil_capture_settings > capture.log
Ok, here you are.
@user-c0fead you have an error in your plugin code display_recent_gaze.py
All the code inside class Display_Recent_Gaze(System_Plugin_Base):
has to be indended one tab to the right.
Currently all the code is outside of the class, it is basically an empty plugin and therefore does not show up.
@user-c0fead @user-c5fb8b Also, system plugins are not listed in the plugin manager. I think display recent gaze is a default plugin, too
So there should not be the need to add it to you plugins folder
@papr Hum, truth to tell I looked at this file after reading Plugin class comment """ A simple example Plugin: 'display_recent_gaze.py' It is a good starting point to build your own plugin. """
This example does not show how to include a new plug-in in "Plug-in manager" ?
(because that's what I need too...)
(so a new and "[my] own" plugin)
@user-c0fead I guess that comment is very old already. I don't think the display_recent_gaze
is the best starting poing for creating custom plugins anymore. We will update this comment.
There's some information on our developer docs: https://docs.pupil-labs.com/developer/core/plugin-api/
Specifically there's the most simplest example plugin (that will show up in the Plugin Manager):
from plugin import Plugin
class MyCustomPlugin(Plugin):
pass
If you save this as e.g. mycustomplugin.py
in the plugins folder, this should show up in the Plugin Manager.
Obviously it won't do anything yet, but that can be your starting point!
hum ok ok
@user-c0fead afterwards you should familiarize yourself with all methods of the Plugin class in plugin.py. You can overwrite any of these to add custom behavior to your plugin.
There is no kind of "Hello World !" plug-in (just to discover to the bases of the Plugin API...) ?
😉
@user-c0fead no we don't have something like that. I also recommend looking at other existing plugins to see how they accomplish their tasks.
DisplayRecentGaze might not be a bad reference after all, but just keep in mind that every plugin inheriting from System_Plugin_Base
is considered a system plugin and cannot be enabled/disabled in the Plugin Manager. The logic for what methods do what stays the same however.
hum ok. But if I change "Display_Recent_Gaze(System_Plugin_Base)" to "Display_Recent_Gaze(Plugin)", will it appear in "Pupil manager" ?
Theoretically yes, but please also change the class name as it might otherwise interfere with the existing Display_Recent_Gaze plugin. Also make sure you indend all code inside of the class (as I commented earlier).
ok, have I to change the file name too ?
no, the file name is not important, the plugins get loaded by their classname
you can overwrite pretty_class_name
to change the display string, e.g.
@property
def pretty_class_name(self):
return "My Plugin"
inside of your plugin will make it show up as "My Plugin" in the Plugin Manager.
Ok, but I tried with this new version of the file and does not work more.
(also after adding the missing quotation mark at the end)
@user-c0fead please try with a minimal working example, e.g. the empty plugin I linked above. Make sure that this one shows up in the Plugin Manager. Then start exploring the Plugin API by adding one function at a time and verify that it does what you want.
Also the log file might help you to debug issues, it will print the errors that occur when loading a plugin
And additionally: developing a custom plugin while running from bundle might be very exhausting, because you are lacking proper debugging tools. If you cannot run from source on the computer you are at, I recommend finding another computer and setting up running from source there. After you have developed a stable, working plugin, you can just transfer it to a bundle.
Ok, "MyCustomPlugin" works. I will try to work from here and solve my problem for working for the source. Thank you very much ! 🙂
@user-c0fead great! Feel free to ask questions if there's anything unclear about the Plugin API.
Hi guys. I am using pupil glasses for eye tracking in one of my experiments. I want to play a video on my computer and the participants will be watching it. Now I want to capture the cordinates and pupil diameter corresponding to each frame of the video. I thought of using pyschopy to synchronise them. Is this is right way to go about it?
If so had anyone done anything like this. It would be really helpful if someone can guide me as this is my first time working with pupil glasses.