software-dev


user-b14f98 03 October, 2022, 14:43:02

Hey @papr , we've noticed that the 3d model fit to eye0 (the right eye) is a consistently worse fit for many subjects. We're using HMD data, and I'm not sure if the same is the case for data collected with the core. This could be an camera-specific issue (aberration?) ...but, it seems unlikely, because the 2d pupil segmentation looks great, and the issue even persists when we use a more reliable custom ML segmentation algorithm, like RITNet or Ellseg. I wonder, have you noticed this issue yourself?

user-b14f98 03 October, 2022, 14:43:45

Because I'm convinced it's not an issue with 2D pupil segmentation, I'm currently digging around in pye_3dplugin.py to see if any properties passed into py3d are off.

user-b14f98 05 October, 2022, 15:19:55

To back the claim that pupil fits are great. I believe the long term model fit filters 2D pupils <0.8. Well, the avg of pupil conf > 0.8 is 0.935 for eye 0 and 0.925 for eye 1.

user-b14f98 05 October, 2022, 15:20:35

This suggests that the input data is comparable or better for eye0.

user-b14f98 05 October, 2022, 15:20:44

Despite that, the model confidence is lower.

user-b14f98 05 October, 2022, 15:22:16

Calculating those vals now, if that would help...

papr 05 October, 2022, 15:22:35

@user-b14f98 The code does not differentiate between left and right eye camera. One reason I see might be different eye camera positions (relative to average viewing direction)

papr 05 October, 2022, 15:23:06

I know that fitting the eye model is more difficult if there are many pupil ellipses with high circularity

user-b14f98 05 October, 2022, 15:26:40

Right.

user-b14f98 05 October, 2022, 15:26:53

Perhaps I can check the aspect ratio.

user-b14f98 05 October, 2022, 15:27:25

Strange thing, papr. I just calculated the model confidence, and it's ...

user-b14f98 05 October, 2022, 15:27:51

0.1 for eye 0, and 0.99 for the other eye.

user-b14f98 05 October, 2022, 15:28:05

Getting data from pupil_positions.csv.

user-b14f98 05 October, 2022, 15:28:12

Let me try that again to make sure there isn't human error.

user-b14f98 05 October, 2022, 15:28:15

That's zany, though.

user-b14f98 05 October, 2022, 15:30:37

Yeah, that's the result.

user-b14f98 05 October, 2022, 15:31:46

In what code is this confidence value calculated?

papr 05 October, 2022, 15:32:00

Which pye3d version are you using?

user-b14f98 05 October, 2022, 15:41:53

I pulled the most recent version of pupil core about two days ago, and installed the latest dependencies, I believe.

user-b14f98 05 October, 2022, 15:42:14

Looking for version info

user-b14f98 05 October, 2022, 15:42:23

version_installed = getattr(pye3d, "version", "0.0.1") version_supported = "0.3.0"

user-b14f98 05 October, 2022, 15:46:00

That seems old. šŸ™‚ Running off of a fresh conda env., and I used the Windows requirements.txt to install dependencies.

user-b14f98 05 October, 2022, 17:57:19

Is that version number the latest? 0.0.1 ?

user-b14f98 05 October, 2022, 19:26:56

Alright, I'll update.

user-b14f98 05 October, 2022, 19:33:29

Yep, pip says that's what I have

user-b14f98 05 October, 2022, 19:33:50

Strange that the code still has that line, "version_installed = getattr(pye3d, "version", "0.0.1")"

papr 05 October, 2022, 21:52:15

That code is pupil code and is not pye3d specific

user-b14f98 05 October, 2022, 19:34:12

in any case, I'll check the pupil aspect ratio

user-b14f98 05 October, 2022, 19:58:27

Chat image

user-b14f98 05 October, 2022, 19:58:48

Well, there you go.

user-b14f98 05 October, 2022, 20:13:09

Have you guys ever speculated on a fix for this? Sadly, you can't update the model on earlier fames based on data from later in the recording

papr 05 October, 2022, 21:55:28

Usually, the recommendation is to have an explicit model fitting phase to sample ellipses with sufficiently different aspect ratios to fit a good model.

You can always write your own post-processing where you hand select the pupil data and fit a single model.

user-3cff0d 05 October, 2022, 22:40:20

But I could double check that on the whiteboard

user-3cff0d 05 October, 2022, 22:41:21

A test we could do is to swap eye0 and eye1's files' names, so 0 is processed as 1 and vice versa. Then we could see if it actually is a hardware issue

papr 05 October, 2022, 22:45:43

I would be very surprised if you didn't get the same results as before.

user-b14f98 06 October, 2022, 01:29:18

Do that and maybe the vertical flip, but I share papr's instinct here.

papr 06 October, 2022, 05:55:43

Just as a visualization, I would like to see all high confidence 2d ellipses rendered together, each with very slight alpha, into one frame.

user-b14f98 05 October, 2022, 22:41:27

Asssy. Gotta run - being rude to company

papr 07 October, 2022, 09:57:04

@user-b14f98 @user-3cff0d You have been using the post-hoc hmd gazer branch extensively, correct? Can you confirm that it is working better than the default post-hoc gazer for VR recordings?

user-b14f98 07 October, 2022, 11:39:20

We can confirm that its still not great. Happy to say more. Kevin has put a lot of time in to that,

user-b14f98 10 October, 2022, 15:53:58

Just as a visualization I would like to

user-eeecc7 13 October, 2022, 06:59:30

Hey All, I have a question regarding the gaze estimation after the pupil detection step. Is there a way for me to import a custom pupil_positions file that can then be used for the gaze mapping? I can create a file identical to the pupil_positions.csv that is exported by the player.

papr 13 October, 2022, 07:01:51

Yes. There are multiple options here. Can you tell us more about how you do pupil detection?

user-eeecc7 13 October, 2022, 07:04:47

I have a pretrained neural network model https://github.com/openPupil/PyPupilEXT that I am using to detect the pupil positions for both eye0.mp4 and eye1.mp4 that was recording. All of the processing is post hoc. Real time is not a requirement.

papr 13 October, 2022, 07:17:52

The proper way to integrate your data would be to write a pupil detection plugin that wraps the neural network and performs the detection within Capture or Pupil Player https://docs.pupil-labs.com/developer/core/plugin-api/#pupil-detection-plugins

If you want to load the data from disk, then you have two options: 1. (recommended) Save the data correctly in the native format 2. Write a plugin data provider plugin that loads the custom csv pupil data, similar to this https://github.com/pupil-labs/pupil/blob/master/pupil_src/shared_modules/pupil_producers.py#L349 (This class is not a good example on what needs to happen as the data transformation is fairly implicit)

To make use of the custom depth data, you will need write a custom gazer class that configure the calibration estimation accordingly to your needs. You can find the gazer classes here https://github.com/pupil-labs/pupil/tree/master/pupil_src/shared_modules/gaze_mapping

papr 13 October, 2022, 07:19:03

Instead of performing the calibration in Player, you might also be able to use this instead https://github.com/papr/pupil-core-pipeline

user-eeecc7 13 October, 2022, 07:06:54

The model gives me pupil center, diameter, axis, angle and confidence. I am hoping this is sufficient. I also have a depth estimate for every world view frame. That is, I know what depth the two gaze vectors must be triangulated onto. If possible I would like to use this depth instead of the fixed depth that was set in pupil capture.

user-eeecc7 13 October, 2022, 07:24:52

Thanks a lot for your help @papr I will look into these methods and get back to you if I get stuck. For clarification, by native format you mean the pupil.pldata file needs to be replaced? If that is done can I run the pupil player as is with the new data?

papr 13 October, 2022, 07:27:57

pupil.pldata and pupil_timestamps.npy, but yes

user-eeecc7 13 October, 2022, 07:29:30

Thanks a lot. šŸ™‚ So I can use this to generate a new gaze_positions.csv using only pupil player?

papr 13 October, 2022, 07:32:00

Yes, that should work

user-eeecc7 13 October, 2022, 07:32:35

Great. Thank you so much. Will try this. šŸ™‚

user-648ceb 13 October, 2022, 09:54:43

_video_fra

user-cde981 13 October, 2022, 20:47:06

If I was interested in researching, gathering data, only on pupil diameter changes and not the object the viewer is fixated on, which product should I get? Pupil Core might do too much for what Iā€™m looking for, but add-on may not be enough.

papr 14 October, 2022, 06:43:23

The only differences between the add-on and the Core headset are: 1. The Core headset has an additional scene camera 2. The add-on needs a VR headset to attach to. The Core headset can be worn by the subject without further hardware.

user-b14f98 14 October, 2022, 00:52:49

By the way, I have been able to install the develop branch using the requirements.txt on both PC and M1 mac

user-2e522e 15 October, 2022, 20:39:17

Hi! I was wondering if there was a python version of pupil labs 2d pupil detector! It would be beneficial if there was!

papr 16 October, 2022, 06:45:13

See https://pypi.org/project/pupil-detectors/2.0.2/

user-2e522e 16 October, 2022, 19:44:38

is it ok if I ask questions about it then here?

papr 16 October, 2022, 20:01:37

2D pupil detector

papr 28 October, 2022, 11:28:34

Pro tip: use the eye video overlay to verify whether the timing of your pupil data is correct

user-eeecc7 28 October, 2022, 12:02:23

Thanks for this tip. The timing is way off. My pupil.pldata file is way shorter than it should be

user-eeecc7 28 October, 2022, 12:00:22

How do we create the pupil.pldata exactly? Here are the steps that I am following: 1. Load the pupil.pldata file. 2. Use the timestamp in the pupil datum to search the eye timestamp for the corresponding eye id. 3. Use the eye frame corresponding to the least abs difference 4. Perform pupil detection on the frame and add datum to file 5. Continue till end of pupil.pldata or end of eye video. But this is giving me a much shorter file than I need

papr 28 October, 2022, 12:03:34

Are you generating the file externally or modifying it in Player?

papr 28 October, 2022, 12:06:28

Also, I recommend using pyav and not Opencv to decode the video

user-eeecc7 28 October, 2022, 12:08:14

Will do. Thanks

user-eeecc7 28 October, 2022, 12:07:21

Okay. So you mean I should just loop through the eye_timestamp.npy files and create a pupil.pldata file based on that?

papr 28 October, 2022, 12:08:18

Yeah, exactly. The datums for each eye do not need to be interleaved within the file. Player will sort them on load

user-eeecc7 28 October, 2022, 12:08:31

Oh cool. Let me try that

user-eeecc7 28 October, 2022, 12:19:44

I ran the code for both eyes. The eye overlay is still racing ahead. May I share my code here?

papr 28 October, 2022, 12:35:00

Custom pupil.pldata

End of October archive