Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gazeto3d #4

Closed
liushifu12138 opened this issue Jul 20, 2022 · 7 comments
Closed

gazeto3d #4

liushifu12138 opened this issue Jul 20, 2022 · 7 comments

Comments

@liushifu12138
Copy link

(pytorch3d) C:\Users\Admin\Desktop\GAZE\PnP-GA-main>python test.py --i -1 --p 0 --savepath path/to/save --target mpii
Test Set: cross-mpii
Read data
[Read Data]: Total num: 37652
Model building
Test 1
Traceback (most recent call last):
File "C:\Users\Admin\Desktop\GAZE\PnP-GA-main\test.py", line 118, in
accs += angular(gaze, gts.cpu().numpy()[k])
File "C:\Users\Admin\Desktop\GAZE\PnP-GA-main\test.py", line 31, in angular
label = gazeto3d(label)
File "C:\Users\Admin\Desktop\GAZE\PnP-GA-main\test.py", line 18, in gazeto3d
gaze_gt[0] = -np.cos(gaze[1]) * np.sin(gaze[0])
IndexError: index 1 is out of bounds for axis 0 with size 1

@MickeyLLG
Copy link
Collaborator

It seems that the size of gaze predictions is wrong, could you please check the above tensor "gaze" while testing?

@liushifu12138
Copy link
Author

gazes= tensor([[ 8.2086e-02, -2.9102e-01],
[ 1.2727e-01, -2.7274e-01],
[-1.4144e-02, -3.3060e-01],
[ 4.7616e-02, -2.5660e-01],
[-4.9153e-02, -2.9897e-01],
[ 1.1854e-01, -2.8301e-01],
[ 9.7247e-03, -2.9910e-01],
[-2.9545e-02, -2.3393e-01],
[ 3.5883e-02, -2.8869e-01],
[ 9.9566e-02, -1.8370e-01],
[ 2.4126e-02, -3.1156e-01],
[ 6.8830e-02, -3.0675e-01],
[ 3.2630e-02, -2.2405e-01],
[ 9.8224e-02, -2.0690e-01],
[ 9.9875e-02, -2.9076e-01],
[ 2.2173e-02, -1.7108e-01],
[-1.1407e-01, -2.3857e-01],
[ 3.2969e-02, -2.4871e-01],
[ 4.4341e-03, -2.1661e-01],
[-3.9321e-03, -1.7889e-01],
[-4.0874e-02, -2.0264e-01],
[-1.3500e-02, -1.7941e-01],
[ 5.0466e-02, -1.4337e-01],
[ 3.6743e-02, -1.5934e-01],
[ 4.9355e-02, -1.7999e-01],
[ 1.6714e-01, -1.5121e-01],
[ 1.0406e-01, -1.6036e-01],
[ 5.1303e-02, -1.4854e-01],
[ 7.3057e-02, -3.0262e-01],
[-4.4771e-02, -2.6593e-01],
[-3.4157e-02, -2.8508e-01],
[-1.2657e-02, -2.0818e-01],
[ 9.1158e-02, -1.4793e-01],
[ 8.7987e-02, -2.5586e-01],
[ 1.0863e-02, -2.8685e-01],
[ 5.1118e-02, -2.7291e-01],
[ 1.3355e-01, -1.9285e-01],
[ 9.0142e-02, -2.1928e-01],
[ 1.1850e-01, -2.1832e-01],
[ 1.7620e-01, -3.6881e-01],
[ 9.8562e-02, -2.3987e-01],
[ 6.8570e-02, -2.4656e-01],
[ 9.8616e-02, -2.2655e-01],
[ 1.5842e-01, -2.3868e-01],
[-1.8541e-02, -2.4785e-01],
[ 8.2156e-02, -2.3449e-01],
[ 1.1603e-01, -2.7651e-01],
[ 6.5590e-03, -2.9033e-01],
[ 9.7916e-02, -1.7554e-01],
[ 2.7684e-02, -1.8274e-01],
[ 2.4268e-02, -1.8580e-01],
[-4.5271e-02, -1.6706e-01],
[ 2.9319e-02, -1.6746e-01],
[ 4.6420e-02, -1.3384e-01],
[ 6.4820e-02, -1.5720e-01],
[ 3.3350e-02, -1.3427e-01],
[ 3.0542e-02, -1.7560e-01],
[ 5.1842e-02, -1.6244e-01],
[ 7.5468e-02, -1.3210e-01],
[ 8.0944e-02, -1.1087e-01],
[-1.1317e-02, -2.3868e-01],
[ 5.9044e-02, -1.8055e-01],
[ 1.2062e-01, -2.3585e-01],
[ 8.7710e-02, -2.4554e-01],
[ 2.6817e-03, -1.7670e-01],
[ 2.8156e-02, -2.2218e-01],
[ 7.2176e-02, -1.4259e-01],
[ 4.2038e-02, -1.4522e-01],
[ 6.4642e-02, -1.9856e-01],
[ 5.2133e-02, -1.3357e-01]], device='cuda:0')

@liushifu12138
Copy link
Author

gts= tensor([[ 126.],
[ 211.],
[ 878.],
[1092.],
[ 441.],
[1222.],
[ 421.],
[ 248.],
[1120.],
[ 605.],
[ 194.],
[1222.],
[ 135.],
[1272.],
[ 379.],
[ 471.],
[ 713.],
[1225.],
[ 989.],
[ 671.],
[1159.],
[ 637.],
[ 735.],
[1013.],
[ 419.],
[ 202.],
[ 365.],
[ 446.],
[1004.],
[ 701.],
[ 685.],
[1073.],
[1155.],
[1133.],
[ 920.],
[ 856.],
[ 143.],
[1013.],
[ 815.],
[ 708.],
[ 332.],
[ 963.],
[ 221.],
[ 124.],
[1213.],
[1276.],
[ 176.],
[ 479.],
[ 709.],
[ 667.],
[ 212.],
[ 456.],
[1178.],
[ 564.],
[ 156.],
[ 601.],
[ 289.],
[ 139.],
[ 541.],
[1275.],
[1079.],
[ 903.],
[ 587.],
[1216.],
[1180.],
[1050.],
[ 694.],
[ 970.],
[ 529.],
[ 329.],
[ 377.],
[ 437.],
[ 180.],
[ 71.],
[ 642.],
[ 799.],
[ 417.],
[ 575.],
[ 742.],
[ 162.]], device='cuda:0')
WHY????

@MickeyLLG
Copy link
Collaborator

It is correct the size of "gazes" is like what you've shown, but the labels are obviously wrong. I think you might read the wrong part of your mpii gaze label, probably editing your mpii label file or the reader.py, and making sure they suit well would help.

@liushifu12138
Copy link
Author

how to get picture of gaze estimation in test?

@MickeyLLG
Copy link
Collaborator

If you have any problems in preparing a dataset, please contact the authors of some common papers such as ETH, MPII, and Gaze360. By the way, the pre-processing method (normalization) is illustrated in "MPIIGaze: Real-World Dataset and Deep Appearance-Based Gaze Estimation". If you have no idea how to read images from your disks, please refer to the reader.py#L74, you can also use cv2.imshow during testing for visulization.

@liushifu12138
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants