hysts / pytorch_mpiigaze

An unofficial PyTorch implementation of MPIIGaze and MPIIFaceGaze
MIT License
346 stars 85 forks source link

What is the actual range of gaze pitch and yaw in the MPIIGaze dataset? #43

Closed err-or closed 3 years ago

err-or commented 3 years ago

Hi @hysts! I have generated the hdf file of the evaluation subset of MPIIGaze dataset using your 'preprocess_mpiigaze.py'. The gaze angle distribution for the mpiigaze dataset according to the paper are [-1.5, 20] (in degrees) for pitch and [-18, 18] for yaw. I believe in preprocess_mpiigaze.py the gazes are stacked in a way so that the first column corresponds to pitch and the second column corresponds to yaw angles in radian. I tried to convert these angles in degrees to verify the angle distribution with the one reported in paper. However, the distributions I found are [-22.76, 4.76] for pitch and [-41.53, 38.71] for yaw which apparently does not match with the paper. These are the steps I followed to calculate this distribution:

  1. I generated the hdf file using your 'preprocess_mpiigaze.py'
  2. I stacked the gaze labels of all the participants using np.vstack((p00, p01...p14)) = Gaze
  3. I calculated the range of gaze values for pitch by math.degrees(np.min(Gaze[:,0])); math.degrees(np.max(Gaze[:,0])) and the same way for yaw.

I am not very confident about my process of calculating the distribution. Could you please correct me here if I am wrong? I am also a bit confused about the gaze angle distribution reported in the paper. Is it based on the entire dataset or is it just based on the evaluation subset? Please share your thoughts about this! Thank you! :))

hysts commented 3 years ago

Hi, @err-or

I think the ranges in the paper are the ones ignoring outliers. If you compute 0.005-th and 0.995-th quantiles, you get [-19.12, 1.62] for pitch and [-18.25, 18.15] for yaw, and if you plot the histograms of pitch and yaw, you get the following: pitchyaw pitch_yaw

BTW, the sign of the pitch angles in the paper seems to be incorrect, as Figure 4 shows that they are basically in the range of [-20, 0].

I am also a bit confused about the gaze angle distribution reported in the paper. Is it based on the entire dataset or is it just based on the evaluation subset?

I don't know which was reported, but anyway, the subset is sampled randomly, so the distribution shouldn't differ much and I don't think we need to worry about it.

err-or commented 3 years ago

Hi @hysts thank you very much for such a quick response! Yes, I have calculated the 0.005-th and 0.995-th quantiles and got exactly the same values for pitch and yaw as you mentioned.

However, I do have one more question, as you can see the range for pitch we found is [-19.12, 1.62] whereas the one reported in the paper is [-1.5, 20]. I am wondering why the sign is opposite here. I initially thought it is because we are making the theta negative here for the right eye by * np.array([-1, 1]) ? (previously mentioned in #2) However, in the code the gaze and headpose of right eye are actually being multiplied by * np.array([1, -1]) which should make changes to the yaw angles I believe.

hysts commented 3 years ago

@err-or

I think it's just a typo. As I mentioned in my last comment, you can see the pitch angles are distributed roughly in the range of [-20, 0] in Figure 4 of the paper. Multiplying by np.array([1, -1]) is for flipping yaw angles when flipping left eye images so that we can treat them as right eye images, so it's not relevant here.

err-or commented 3 years ago

Yes, I have noticed that in the figure. Thanks again for answering all my questions! :))