Upload 935 files
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +164 -0
- DeepGaze/(inverse)_inverse_effect.ipynb +0 -0
- DeepGaze/.gitignore +2 -0
- DeepGaze/.ipynb_checkpoints/(inverse)_inverse_effect-checkpoint.ipynb +6 -0
- DeepGaze/.ipynb_checkpoints/activation-Copy1-checkpoint.ipynb +0 -0
- DeepGaze/.ipynb_checkpoints/agent_test-checkpoint.ipynb +6 -0
- DeepGaze/.ipynb_checkpoints/christine_data-checkpoint.ipynb +0 -0
- DeepGaze/.ipynb_checkpoints/christine_data_complete-checkpoint.ipynb +0 -0
- DeepGaze/.ipynb_checkpoints/dg1_act-checkpoint.ipynb +0 -0
- DeepGaze/.ipynb_checkpoints/dg1_filter_lesion_c-checkpoint.ipynb +0 -0
- DeepGaze/.ipynb_checkpoints/dg1_filter_lesion_h-checkpoint.ipynb +0 -0
- DeepGaze/.ipynb_checkpoints/dg2E_act-checkpoint.ipynb +596 -0
- DeepGaze/.ipynb_checkpoints/dg2e_hg-checkpoint.ipynb +1596 -0
- DeepGaze/.ipynb_checkpoints/dg2e_hg_inv-checkpoint.ipynb +0 -0
- DeepGaze/.ipynb_checkpoints/dg2e_hg_mask-checkpoint.ipynb +2106 -0
- DeepGaze/.ipynb_checkpoints/dg2e_wardle-checkpoint.ipynb +0 -0
- DeepGaze/.ipynb_checkpoints/dg2e_wardle_inv-checkpoint.ipynb +0 -0
- DeepGaze/.ipynb_checkpoints/dg3_hg-checkpoint.ipynb +2272 -0
- DeepGaze/.ipynb_checkpoints/dg3_hg_split_half_rel-checkpoint.ipynb +3 -0
- DeepGaze/.ipynb_checkpoints/dg3_hg_wardle_art_inv-checkpoint.ipynb +3 -0
- DeepGaze/.ipynb_checkpoints/et_analysis-checkpoint.ipynb +3 -0
- DeepGaze/.ipynb_checkpoints/et_analysis_helena_dg1-checkpoint.ipynb +3 -0
- DeepGaze/.ipynb_checkpoints/extract_hg_c-checkpoint.ipynb +0 -0
- DeepGaze/.ipynb_checkpoints/helena_data_complete-checkpoint.ipynb +3092 -0
- DeepGaze/.ipynb_checkpoints/helena_data_masks-checkpoint.ipynb +6 -0
- DeepGaze/.ipynb_checkpoints/mask corrs-checkpoint.ipynb +6 -0
- DeepGaze/1448_face_mask.csv +0 -0
- DeepGaze/1448_face_mask.json +152 -0
- DeepGaze/1448_face_mask.png +0 -0
- DeepGaze/4_pareidolia_dg2.png +0 -0
- DeepGaze/4_pareidolia_hg.png +0 -0
- DeepGaze/4_pareidolia_s02_dg3.png +0 -0
- DeepGaze/4_pareidolia_s02_hg.png +0 -0
- DeepGaze/8_pareidolia_inv_dg2.png +0 -0
- DeepGaze/8_pareidolia_inv_hg.png +0 -0
- DeepGaze/8_pareidolia_inv_s04_dg3.png +0 -0
- DeepGaze/8_pareidolia_inv_s04_hg.png +0 -0
- DeepGaze/DG1_RSA.png +0 -0
- DeepGaze/DG1_arch.txt +40 -0
- DeepGaze/DG2E_RSA_400.png +3 -0
- DeepGaze/DG2E_arch.txt +0 -0
- DeepGaze/DG2_heatmaps/0.jpg +0 -0
- DeepGaze/DG2_heatmaps/1.jpg +0 -0
- DeepGaze/DG2_heatmaps/10.jpg +0 -0
- DeepGaze/DG2_heatmaps/100.jpg +0 -0
- DeepGaze/DG2_heatmaps/101.jpg +0 -0
- DeepGaze/DG2_heatmaps/102.jpg +0 -0
- DeepGaze/DG2_heatmaps/103.jpg +0 -0
- DeepGaze/DG2_heatmaps/104.jpg +0 -0
- DeepGaze/DG2_heatmaps/105.jpg +0 -0
.gitattributes
CHANGED
@@ -33,3 +33,167 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
DeepGaze/.ipynb_checkpoints/dg3_hg_split_half_rel-checkpoint.ipynb filter=lfs diff=lfs merge=lfs -text
|
37 |
+
DeepGaze/.ipynb_checkpoints/dg3_hg_wardle_art_inv-checkpoint.ipynb filter=lfs diff=lfs merge=lfs -text
|
38 |
+
DeepGaze/.ipynb_checkpoints/et_analysis_helena_dg1-checkpoint.ipynb filter=lfs diff=lfs merge=lfs -text
|
39 |
+
DeepGaze/.ipynb_checkpoints/et_analysis-checkpoint.ipynb filter=lfs diff=lfs merge=lfs -text
|
40 |
+
DeepGaze/DeepGazeII/DeepGazeII.ckpt.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -text
|
41 |
+
DeepGaze/DeepGazeII/DeepGazeII.ckpt.meta filter=lfs diff=lfs merge=lfs -text
|
42 |
+
DeepGaze/dg1_filter_lesion_c.ipynb filter=lfs diff=lfs merge=lfs -text
|
43 |
+
DeepGaze/dg1_filter_lesion_h.ipynb filter=lfs diff=lfs merge=lfs -text
|
44 |
+
DeepGaze/DG2E_RSA_400.png filter=lfs diff=lfs merge=lfs -text
|
45 |
+
DeepGaze/dg3_hg_wardle_art_inv.ipynb filter=lfs diff=lfs merge=lfs -text
|
46 |
+
DeepGaze/dg3_hg.ipynb filter=lfs diff=lfs merge=lfs -text
|
47 |
+
DeepGaze/et_analysis_helena_dg1.ipynb filter=lfs diff=lfs merge=lfs -text
|
48 |
+
DeepGaze/et_analysis.ipynb filter=lfs diff=lfs merge=lfs -text
|
49 |
+
DeepGaze/firstMapsAndFilenames.mat filter=lfs diff=lfs merge=lfs -text
|
50 |
+
DeepGaze/heatmaps/faces/1018.mat filter=lfs diff=lfs merge=lfs -text
|
51 |
+
DeepGaze/heatmaps/faces/1022.mat filter=lfs diff=lfs merge=lfs -text
|
52 |
+
DeepGaze/heatmaps/faces/1039.mat filter=lfs diff=lfs merge=lfs -text
|
53 |
+
DeepGaze/heatmaps/faces/1042.mat filter=lfs diff=lfs merge=lfs -text
|
54 |
+
DeepGaze/heatmaps/faces/1077.mat filter=lfs diff=lfs merge=lfs -text
|
55 |
+
DeepGaze/heatmaps/faces/1078.mat filter=lfs diff=lfs merge=lfs -text
|
56 |
+
DeepGaze/heatmaps/faces/1083.mat filter=lfs diff=lfs merge=lfs -text
|
57 |
+
DeepGaze/heatmaps/faces/1094.mat filter=lfs diff=lfs merge=lfs -text
|
58 |
+
DeepGaze/heatmaps/faces/1095.mat filter=lfs diff=lfs merge=lfs -text
|
59 |
+
DeepGaze/heatmaps/faces/1096.mat filter=lfs diff=lfs merge=lfs -text
|
60 |
+
DeepGaze/heatmaps/faces/1108.mat filter=lfs diff=lfs merge=lfs -text
|
61 |
+
DeepGaze/heatmaps/faces/1113.mat filter=lfs diff=lfs merge=lfs -text
|
62 |
+
DeepGaze/heatmaps/faces/1117.mat filter=lfs diff=lfs merge=lfs -text
|
63 |
+
DeepGaze/heatmaps/faces/1125.mat filter=lfs diff=lfs merge=lfs -text
|
64 |
+
DeepGaze/heatmaps/faces/1126.mat filter=lfs diff=lfs merge=lfs -text
|
65 |
+
DeepGaze/heatmaps/faces/1131.mat filter=lfs diff=lfs merge=lfs -text
|
66 |
+
DeepGaze/heatmaps/faces/1160.mat filter=lfs diff=lfs merge=lfs -text
|
67 |
+
DeepGaze/heatmaps/faces/1163.mat filter=lfs diff=lfs merge=lfs -text
|
68 |
+
DeepGaze/heatmaps/faces/1178.mat filter=lfs diff=lfs merge=lfs -text
|
69 |
+
DeepGaze/heatmaps/faces/1182.mat filter=lfs diff=lfs merge=lfs -text
|
70 |
+
DeepGaze/heatmaps/faces/1183.mat filter=lfs diff=lfs merge=lfs -text
|
71 |
+
DeepGaze/heatmaps/faces/1184.mat filter=lfs diff=lfs merge=lfs -text
|
72 |
+
DeepGaze/heatmaps/faces/1186.mat filter=lfs diff=lfs merge=lfs -text
|
73 |
+
DeepGaze/heatmaps/faces/1190.mat filter=lfs diff=lfs merge=lfs -text
|
74 |
+
DeepGaze/heatmaps/faces/1195.mat filter=lfs diff=lfs merge=lfs -text
|
75 |
+
DeepGaze/heatmaps/faces/1206.mat filter=lfs diff=lfs merge=lfs -text
|
76 |
+
DeepGaze/heatmaps/faces/1215.mat filter=lfs diff=lfs merge=lfs -text
|
77 |
+
DeepGaze/heatmaps/faces/1219.mat filter=lfs diff=lfs merge=lfs -text
|
78 |
+
DeepGaze/heatmaps/faces/1224.mat filter=lfs diff=lfs merge=lfs -text
|
79 |
+
DeepGaze/heatmaps/faces/1227.mat filter=lfs diff=lfs merge=lfs -text
|
80 |
+
DeepGaze/heatmaps/faces/1238.mat filter=lfs diff=lfs merge=lfs -text
|
81 |
+
DeepGaze/heatmaps/faces/1240.mat filter=lfs diff=lfs merge=lfs -text
|
82 |
+
DeepGaze/heatmaps/faces/1249.mat filter=lfs diff=lfs merge=lfs -text
|
83 |
+
DeepGaze/heatmaps/faces/1254.mat filter=lfs diff=lfs merge=lfs -text
|
84 |
+
DeepGaze/heatmaps/faces/1267.mat filter=lfs diff=lfs merge=lfs -text
|
85 |
+
DeepGaze/heatmaps/faces/1290.mat filter=lfs diff=lfs merge=lfs -text
|
86 |
+
DeepGaze/heatmaps/faces/1294.mat filter=lfs diff=lfs merge=lfs -text
|
87 |
+
DeepGaze/heatmaps/faces/1297.mat filter=lfs diff=lfs merge=lfs -text
|
88 |
+
DeepGaze/heatmaps/faces/1303.mat filter=lfs diff=lfs merge=lfs -text
|
89 |
+
DeepGaze/heatmaps/faces/1304.mat filter=lfs diff=lfs merge=lfs -text
|
90 |
+
DeepGaze/heatmaps/faces/1321.mat filter=lfs diff=lfs merge=lfs -text
|
91 |
+
DeepGaze/heatmaps/faces/1329.mat filter=lfs diff=lfs merge=lfs -text
|
92 |
+
DeepGaze/heatmaps/faces/1343.mat filter=lfs diff=lfs merge=lfs -text
|
93 |
+
DeepGaze/heatmaps/faces/1346.mat filter=lfs diff=lfs merge=lfs -text
|
94 |
+
DeepGaze/heatmaps/faces/1351.mat filter=lfs diff=lfs merge=lfs -text
|
95 |
+
DeepGaze/heatmaps/faces/1352.mat filter=lfs diff=lfs merge=lfs -text
|
96 |
+
DeepGaze/heatmaps/faces/1358.mat filter=lfs diff=lfs merge=lfs -text
|
97 |
+
DeepGaze/heatmaps/faces/1360.mat filter=lfs diff=lfs merge=lfs -text
|
98 |
+
DeepGaze/heatmaps/faces/1365.mat filter=lfs diff=lfs merge=lfs -text
|
99 |
+
DeepGaze/heatmaps/faces/1367.mat filter=lfs diff=lfs merge=lfs -text
|
100 |
+
DeepGaze/heatmaps/objects/1001.mat filter=lfs diff=lfs merge=lfs -text
|
101 |
+
DeepGaze/heatmaps/objects/1015.mat filter=lfs diff=lfs merge=lfs -text
|
102 |
+
DeepGaze/heatmaps/objects/1016.mat filter=lfs diff=lfs merge=lfs -text
|
103 |
+
DeepGaze/heatmaps/objects/1029.mat filter=lfs diff=lfs merge=lfs -text
|
104 |
+
DeepGaze/heatmaps/objects/1040.mat filter=lfs diff=lfs merge=lfs -text
|
105 |
+
DeepGaze/heatmaps/objects/1043.mat filter=lfs diff=lfs merge=lfs -text
|
106 |
+
DeepGaze/heatmaps/objects/1049.mat filter=lfs diff=lfs merge=lfs -text
|
107 |
+
DeepGaze/heatmaps/objects/1062.mat filter=lfs diff=lfs merge=lfs -text
|
108 |
+
DeepGaze/heatmaps/objects/1065.mat filter=lfs diff=lfs merge=lfs -text
|
109 |
+
DeepGaze/heatmaps/objects/1067.mat filter=lfs diff=lfs merge=lfs -text
|
110 |
+
DeepGaze/heatmaps/objects/1079.mat filter=lfs diff=lfs merge=lfs -text
|
111 |
+
DeepGaze/heatmaps/objects/1087.mat filter=lfs diff=lfs merge=lfs -text
|
112 |
+
DeepGaze/heatmaps/objects/1092.mat filter=lfs diff=lfs merge=lfs -text
|
113 |
+
DeepGaze/heatmaps/objects/1093.mat filter=lfs diff=lfs merge=lfs -text
|
114 |
+
DeepGaze/heatmaps/objects/1105.mat filter=lfs diff=lfs merge=lfs -text
|
115 |
+
DeepGaze/heatmaps/objects/1109.mat filter=lfs diff=lfs merge=lfs -text
|
116 |
+
DeepGaze/heatmaps/objects/1118.mat filter=lfs diff=lfs merge=lfs -text
|
117 |
+
DeepGaze/heatmaps/objects/1120.mat filter=lfs diff=lfs merge=lfs -text
|
118 |
+
DeepGaze/heatmaps/objects/1143.mat filter=lfs diff=lfs merge=lfs -text
|
119 |
+
DeepGaze/heatmaps/objects/1144.mat filter=lfs diff=lfs merge=lfs -text
|
120 |
+
DeepGaze/heatmaps/objects/1149.mat filter=lfs diff=lfs merge=lfs -text
|
121 |
+
DeepGaze/heatmaps/objects/1151.mat filter=lfs diff=lfs merge=lfs -text
|
122 |
+
DeepGaze/heatmaps/objects/1153.mat filter=lfs diff=lfs merge=lfs -text
|
123 |
+
DeepGaze/heatmaps/objects/1192.mat filter=lfs diff=lfs merge=lfs -text
|
124 |
+
DeepGaze/heatmaps/objects/1209.mat filter=lfs diff=lfs merge=lfs -text
|
125 |
+
DeepGaze/heatmaps/objects/1210.mat filter=lfs diff=lfs merge=lfs -text
|
126 |
+
DeepGaze/heatmaps/objects/1234.mat filter=lfs diff=lfs merge=lfs -text
|
127 |
+
DeepGaze/heatmaps/objects/1239.mat filter=lfs diff=lfs merge=lfs -text
|
128 |
+
DeepGaze/heatmaps/objects/1245.mat filter=lfs diff=lfs merge=lfs -text
|
129 |
+
DeepGaze/heatmaps/objects/1262.mat filter=lfs diff=lfs merge=lfs -text
|
130 |
+
DeepGaze/heatmaps/objects/1266.mat filter=lfs diff=lfs merge=lfs -text
|
131 |
+
DeepGaze/heatmaps/objects/1275.mat filter=lfs diff=lfs merge=lfs -text
|
132 |
+
DeepGaze/heatmaps/objects/1281.mat filter=lfs diff=lfs merge=lfs -text
|
133 |
+
DeepGaze/heatmaps/objects/1288.mat filter=lfs diff=lfs merge=lfs -text
|
134 |
+
DeepGaze/heatmaps/objects/1293.mat filter=lfs diff=lfs merge=lfs -text
|
135 |
+
DeepGaze/heatmaps/objects/1306.mat filter=lfs diff=lfs merge=lfs -text
|
136 |
+
DeepGaze/heatmaps/objects/1314.mat filter=lfs diff=lfs merge=lfs -text
|
137 |
+
DeepGaze/heatmaps/objects/1316.mat filter=lfs diff=lfs merge=lfs -text
|
138 |
+
DeepGaze/heatmaps/objects/1317.mat filter=lfs diff=lfs merge=lfs -text
|
139 |
+
DeepGaze/heatmaps/objects/1324.mat filter=lfs diff=lfs merge=lfs -text
|
140 |
+
DeepGaze/heatmaps/objects/1337.mat filter=lfs diff=lfs merge=lfs -text
|
141 |
+
DeepGaze/heatmaps/objects/1347.mat filter=lfs diff=lfs merge=lfs -text
|
142 |
+
DeepGaze/heatmaps/objects/1353.mat filter=lfs diff=lfs merge=lfs -text
|
143 |
+
DeepGaze/heatmaps/objects/1363.mat filter=lfs diff=lfs merge=lfs -text
|
144 |
+
DeepGaze/heatmaps/objects/1369.mat filter=lfs diff=lfs merge=lfs -text
|
145 |
+
DeepGaze/heatmaps/objects/1383.mat filter=lfs diff=lfs merge=lfs -text
|
146 |
+
DeepGaze/heatmaps/objects/1387.mat filter=lfs diff=lfs merge=lfs -text
|
147 |
+
DeepGaze/heatmaps/objects/1393.mat filter=lfs diff=lfs merge=lfs -text
|
148 |
+
DeepGaze/heatmaps/objects/1400.mat filter=lfs diff=lfs merge=lfs -text
|
149 |
+
DeepGaze/heatmaps/objects/1410.mat filter=lfs diff=lfs merge=lfs -text
|
150 |
+
DeepGaze/heatmaps/pareidolia/1.mat filter=lfs diff=lfs merge=lfs -text
|
151 |
+
DeepGaze/heatmaps/pareidolia/1001.mat filter=lfs diff=lfs merge=lfs -text
|
152 |
+
DeepGaze/heatmaps/pareidolia/102.mat filter=lfs diff=lfs merge=lfs -text
|
153 |
+
DeepGaze/heatmaps/pareidolia/103.mat filter=lfs diff=lfs merge=lfs -text
|
154 |
+
DeepGaze/heatmaps/pareidolia/106.mat filter=lfs diff=lfs merge=lfs -text
|
155 |
+
DeepGaze/heatmaps/pareidolia/108.mat filter=lfs diff=lfs merge=lfs -text
|
156 |
+
DeepGaze/heatmaps/pareidolia/109.mat filter=lfs diff=lfs merge=lfs -text
|
157 |
+
DeepGaze/heatmaps/pareidolia/11.mat filter=lfs diff=lfs merge=lfs -text
|
158 |
+
DeepGaze/heatmaps/pareidolia/110.mat filter=lfs diff=lfs merge=lfs -text
|
159 |
+
DeepGaze/heatmaps/pareidolia/111.mat filter=lfs diff=lfs merge=lfs -text
|
160 |
+
DeepGaze/heatmaps/pareidolia/112.mat filter=lfs diff=lfs merge=lfs -text
|
161 |
+
DeepGaze/heatmaps/pareidolia/113.mat filter=lfs diff=lfs merge=lfs -text
|
162 |
+
DeepGaze/heatmaps/pareidolia/115.mat filter=lfs diff=lfs merge=lfs -text
|
163 |
+
DeepGaze/heatmaps/pareidolia/116.mat filter=lfs diff=lfs merge=lfs -text
|
164 |
+
DeepGaze/heatmaps/pareidolia/117.mat filter=lfs diff=lfs merge=lfs -text
|
165 |
+
DeepGaze/heatmaps/pareidolia/118.mat filter=lfs diff=lfs merge=lfs -text
|
166 |
+
DeepGaze/heatmaps/pareidolia/119.mat filter=lfs diff=lfs merge=lfs -text
|
167 |
+
DeepGaze/heatmaps/pareidolia/120.mat filter=lfs diff=lfs merge=lfs -text
|
168 |
+
DeepGaze/heatmaps/pareidolia/121.mat filter=lfs diff=lfs merge=lfs -text
|
169 |
+
DeepGaze/heatmaps/pareidolia/122.mat filter=lfs diff=lfs merge=lfs -text
|
170 |
+
DeepGaze/heatmaps/pareidolia/123.mat filter=lfs diff=lfs merge=lfs -text
|
171 |
+
DeepGaze/heatmaps/pareidolia/125.mat filter=lfs diff=lfs merge=lfs -text
|
172 |
+
DeepGaze/heatmaps/pareidolia/126.mat filter=lfs diff=lfs merge=lfs -text
|
173 |
+
DeepGaze/heatmaps/pareidolia/127.mat filter=lfs diff=lfs merge=lfs -text
|
174 |
+
DeepGaze/heatmaps/pareidolia/128.mat filter=lfs diff=lfs merge=lfs -text
|
175 |
+
DeepGaze/heatmaps/pareidolia/131.mat filter=lfs diff=lfs merge=lfs -text
|
176 |
+
DeepGaze/heatmaps/pareidolia/132.mat filter=lfs diff=lfs merge=lfs -text
|
177 |
+
DeepGaze/heatmaps/pareidolia/133.mat filter=lfs diff=lfs merge=lfs -text
|
178 |
+
DeepGaze/heatmaps/pareidolia/137.mat filter=lfs diff=lfs merge=lfs -text
|
179 |
+
DeepGaze/heatmaps/pareidolia/138.mat filter=lfs diff=lfs merge=lfs -text
|
180 |
+
DeepGaze/heatmaps/pareidolia/139.mat filter=lfs diff=lfs merge=lfs -text
|
181 |
+
DeepGaze/heatmaps/pareidolia/140.mat filter=lfs diff=lfs merge=lfs -text
|
182 |
+
DeepGaze/heatmaps/pareidolia/141.mat filter=lfs diff=lfs merge=lfs -text
|
183 |
+
DeepGaze/heatmaps/pareidolia/143.mat filter=lfs diff=lfs merge=lfs -text
|
184 |
+
DeepGaze/heatmaps/pareidolia/144.mat filter=lfs diff=lfs merge=lfs -text
|
185 |
+
DeepGaze/heatmaps/pareidolia/145.mat filter=lfs diff=lfs merge=lfs -text
|
186 |
+
DeepGaze/heatmaps/pareidolia/146.mat filter=lfs diff=lfs merge=lfs -text
|
187 |
+
DeepGaze/heatmaps/pareidolia/147.mat filter=lfs diff=lfs merge=lfs -text
|
188 |
+
DeepGaze/heatmaps/pareidolia/148.mat filter=lfs diff=lfs merge=lfs -text
|
189 |
+
DeepGaze/heatmaps/pareidolia/149.mat filter=lfs diff=lfs merge=lfs -text
|
190 |
+
DeepGaze/heatmaps/pareidolia/15.mat filter=lfs diff=lfs merge=lfs -text
|
191 |
+
DeepGaze/heatmaps/pareidolia/150.mat filter=lfs diff=lfs merge=lfs -text
|
192 |
+
DeepGaze/heatmaps/pareidolia/151.mat filter=lfs diff=lfs merge=lfs -text
|
193 |
+
DeepGaze/heatmaps/pareidolia/152.mat filter=lfs diff=lfs merge=lfs -text
|
194 |
+
DeepGaze/heatmaps/pareidolia/153.mat filter=lfs diff=lfs merge=lfs -text
|
195 |
+
DeepGaze/heatmaps/pareidolia/154.mat filter=lfs diff=lfs merge=lfs -text
|
196 |
+
DeepGaze/heatmaps/pareidolia/156.mat filter=lfs diff=lfs merge=lfs -text
|
197 |
+
DeepGaze/heatmaps/pareidolia/157.mat filter=lfs diff=lfs merge=lfs -text
|
198 |
+
DeepGaze/heatmaps/pareidolia/159.mat filter=lfs diff=lfs merge=lfs -text
|
199 |
+
DeepGaze/images_for_Katharina/no_eyes/no_eyes_8.png filter=lfs diff=lfs merge=lfs -text
|
DeepGaze/(inverse)_inverse_effect.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
*.pyc
|
2 |
+
__pycache__
|
DeepGaze/.ipynb_checkpoints/(inverse)_inverse_effect-checkpoint.ipynb
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [],
|
3 |
+
"metadata": {},
|
4 |
+
"nbformat": 4,
|
5 |
+
"nbformat_minor": 5
|
6 |
+
}
|
DeepGaze/.ipynb_checkpoints/activation-Copy1-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/.ipynb_checkpoints/agent_test-checkpoint.ipynb
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [],
|
3 |
+
"metadata": {},
|
4 |
+
"nbformat": 4,
|
5 |
+
"nbformat_minor": 5
|
6 |
+
}
|
DeepGaze/.ipynb_checkpoints/christine_data-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/.ipynb_checkpoints/christine_data_complete-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/.ipynb_checkpoints/dg1_act-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/.ipynb_checkpoints/dg1_filter_lesion_c-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/.ipynb_checkpoints/dg1_filter_lesion_h-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/.ipynb_checkpoints/dg2E_act-checkpoint.ipynb
ADDED
@@ -0,0 +1,596 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": null,
|
6 |
+
"id": "c809ceed",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [
|
9 |
+
{
|
10 |
+
"name": "stderr",
|
11 |
+
"output_type": "stream",
|
12 |
+
"text": [
|
13 |
+
"Using cache found in /home/pranjul/.cache/torch/hub/pytorch_vision_v0.6.0\n"
|
14 |
+
]
|
15 |
+
}
|
16 |
+
],
|
17 |
+
"source": [
|
18 |
+
"import matplotlib.pyplot as plt\n",
|
19 |
+
"import numpy as np\n",
|
20 |
+
"from scipy.misc import face\n",
|
21 |
+
"from scipy.ndimage import zoom\n",
|
22 |
+
"from scipy.special import logsumexp\n",
|
23 |
+
"import torch\n",
|
24 |
+
"\n",
|
25 |
+
"import deepgaze_pytorch\n",
|
26 |
+
"\n",
|
27 |
+
"DEVICE = 'cuda'\n",
|
28 |
+
"\n",
|
29 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
30 |
+
"model_dg1 = deepgaze_pytorch.DeepGazeI(pretrained=True).to(DEVICE)\n",
|
31 |
+
"\n",
|
32 |
+
"image = face()\n",
|
33 |
+
"\n",
|
34 |
+
"# load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
35 |
+
"# you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
36 |
+
"# alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
37 |
+
"centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
38 |
+
"# rescale to match image size\n",
|
39 |
+
"centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
40 |
+
"# renormalize log density\n",
|
41 |
+
"centerbias -= logsumexp(centerbias)\n",
|
42 |
+
"\n",
|
43 |
+
"image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
44 |
+
"centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
45 |
+
"\n",
|
46 |
+
"log_density_prediction = model_dg1(image_tensor, centerbias_tensor)\n",
|
47 |
+
"\n",
|
48 |
+
"f, axs = plt.subplots(nrows=1, ncols=2, figsize=(8, 3))\n",
|
49 |
+
"axs[0].imshow(image)\n",
|
50 |
+
"#axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
51 |
+
"#axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
52 |
+
"axs[0].set_axis_off()\n",
|
53 |
+
"axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0]) # first image in batch, first (and only) channel\n",
|
54 |
+
"#axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
55 |
+
"#axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
56 |
+
"axs[1].set_axis_off()"
|
57 |
+
]
|
58 |
+
},
|
59 |
+
{
|
60 |
+
"cell_type": "code",
|
61 |
+
"execution_count": null,
|
62 |
+
"id": "c0a46c9d",
|
63 |
+
"metadata": {},
|
64 |
+
"outputs": [],
|
65 |
+
"source": [
|
66 |
+
"import torch\n",
|
67 |
+
"import numpy as np\n",
|
68 |
+
"import helper_consol as helper\n",
|
69 |
+
"import pandas as pd\n",
|
70 |
+
"import pingouin as pg\n",
|
71 |
+
"import rsatoolbox\n",
|
72 |
+
"import torchvision\n",
|
73 |
+
"import rsatoolbox.data as rsd # abbreviation to deal with dataset\n",
|
74 |
+
"import rsatoolbox.rdm as rsr\n",
|
75 |
+
"from sklearn import preprocessing\n",
|
76 |
+
"import matplotlib.pyplot as plt\n",
|
77 |
+
"\n"
|
78 |
+
]
|
79 |
+
},
|
80 |
+
{
|
81 |
+
"cell_type": "code",
|
82 |
+
"execution_count": null,
|
83 |
+
"id": "11c42ad4",
|
84 |
+
"metadata": {},
|
85 |
+
"outputs": [],
|
86 |
+
"source": [
|
87 |
+
"# pareidolia hypothesis - faces and pareidolia are same\n",
|
88 |
+
"# all distances are 0 between and within faces and pareidolia, but 1 between faces/pareidolia and objects\n",
|
89 |
+
"a = np.zeros((32,32))\n",
|
90 |
+
"b = np.zeros((32,32))\n",
|
91 |
+
"c = np.ones((32,32))\n",
|
92 |
+
"d = np.zeros((32,32))\n",
|
93 |
+
"e = np.zeros((32,32))\n",
|
94 |
+
"f = np.ones((32,32))\n",
|
95 |
+
"g = np.ones((32,32))\n",
|
96 |
+
"h = np.ones((32,32))\n",
|
97 |
+
"i = np.zeros((32,32))\n",
|
98 |
+
"hypo_1 = np.bmat([[a, b, c], [d, e, f], [g, h, i]])\n",
|
99 |
+
"plt.imshow(hypo_1)"
|
100 |
+
]
|
101 |
+
},
|
102 |
+
{
|
103 |
+
"cell_type": "code",
|
104 |
+
"execution_count": null,
|
105 |
+
"id": "0858982f",
|
106 |
+
"metadata": {},
|
107 |
+
"outputs": [],
|
108 |
+
"source": [
|
109 |
+
"# face hypothesis - objects and pareidolia are same\n",
|
110 |
+
"# all distances are 0 between and within objects and pareidolia, but 1 between objects/pareidolia and faces\n",
|
111 |
+
"a = np.zeros((32,32))\n",
|
112 |
+
"b = np.ones((32,32))\n",
|
113 |
+
"c = np.ones((32,32))\n",
|
114 |
+
"d = np.ones((32,32))\n",
|
115 |
+
"e = np.zeros((32,32))\n",
|
116 |
+
"f = np.zeros((32,32))\n",
|
117 |
+
"g = np.ones((32,32))\n",
|
118 |
+
"h = np.zeros((32,32))\n",
|
119 |
+
"i = np.zeros((32,32))\n",
|
120 |
+
"hypo_2 = np.bmat([[a, b, c], [d, e, f], [g, h, i]])\n",
|
121 |
+
"plt.imshow(hypo_2)"
|
122 |
+
]
|
123 |
+
},
|
124 |
+
{
|
125 |
+
"cell_type": "code",
|
126 |
+
"execution_count": null,
|
127 |
+
"id": "614acbaa",
|
128 |
+
"metadata": {},
|
129 |
+
"outputs": [],
|
130 |
+
"source": [
|
131 |
+
"network_name = 'face_inanimate_400k_facesconsolidated'\n",
|
132 |
+
"config = helper.Config(config_file='./configs/vgg/' + network_name + '.yaml')\n",
|
133 |
+
"model, ckpt_data = config.get_model(pretrained=True, ngpus=1, dataParallel=False, epoch=110, consol=True)\n",
|
134 |
+
"# model, ckpt_data = config.get_model(pretrained=True, ngpus=1, dataParallel=True, epoch=-1)\n",
|
135 |
+
"model = model.cuda()"
|
136 |
+
]
|
137 |
+
},
|
138 |
+
{
|
139 |
+
"cell_type": "code",
|
140 |
+
"execution_count": null,
|
141 |
+
"id": "8173f9bc",
|
142 |
+
"metadata": {},
|
143 |
+
"outputs": [],
|
144 |
+
"source": [
|
145 |
+
"#network_name = 'face_inanimate_400k_facesconsolidated'\n",
|
146 |
+
"#config = helper.Config(config_file='./configs/vgg/' + network_name + '.yaml')\n",
|
147 |
+
"#model, ckpt_data = config.get_model(pretrained=True, ngpus=1, dataParallel=False, epoch=110, consol=True)\n",
|
148 |
+
"# model, ckpt_data = config.get_model(pretrained=True, ngpus=1, dataParallel=True, epoch=-1)\n",
|
149 |
+
"model_dg1 = model_dg1.cuda()\n",
|
150 |
+
"\n",
|
151 |
+
"'''\n",
|
152 |
+
"# Define the layer(s) you want to extract activations from\n",
|
153 |
+
"layers = [model.module.features[1], model.module.features[3], model.module.features[6],\n",
|
154 |
+
" model.module.features[8], model.module.features[11], model.module.features[13],\n",
|
155 |
+
" model.module.features[15], model.module.features[18], model.module.features[20],\n",
|
156 |
+
" model.module.features[22], model.module.features[25], model.module.features[27],\n",
|
157 |
+
" model.module.features[29], model.module.classifier[1], model.module.classifier[4]]\n",
|
158 |
+
"\n",
|
159 |
+
"\n",
|
160 |
+
"layers = [model.features[1], model.features[3], model.features[6],\n",
|
161 |
+
" model.features[8], model.features[11], model.features[13],\n",
|
162 |
+
" model.features[15], model.features[18], model.features[20],\n",
|
163 |
+
" model.features[22], model.features[25], model.features[27],\n",
|
164 |
+
" model.features[29], model.classifier[1], model.classifier[4]]\n",
|
165 |
+
"'''\n",
|
166 |
+
"\n",
|
167 |
+
"layers = [model_dg1.features.features[1].features[1], model_dg1.features.features[1].features[4],\n",
|
168 |
+
" model_dg1.features.features[1].features[7], model_dg1.features.features[1].features[9],\n",
|
169 |
+
" model_dg1.features.features[1].features[11], model_dg1.features.features[1].classifier[2],\n",
|
170 |
+
" model_dg1.features.features[1].classifier[5], model_dg1.readout_network.conv0,\n",
|
171 |
+
" model_dg1.finalizer.gauss]\n",
|
172 |
+
"\n",
|
173 |
+
"\n",
|
174 |
+
"# Register forward hooks to the selected layers\n",
|
175 |
+
"activation = {}\n",
|
176 |
+
"\n",
|
177 |
+
"def get_activation(name):\n",
|
178 |
+
" def hook(model_dg1, input, output):\n",
|
179 |
+
" activation[name] = output.detach()\n",
|
180 |
+
" return hook\n",
|
181 |
+
"\n",
|
182 |
+
"for i, layer in enumerate(layers):\n",
|
183 |
+
" layer.register_forward_hook(get_activation(f'layer_{i+1}'))"
|
184 |
+
]
|
185 |
+
},
|
186 |
+
{
|
187 |
+
"cell_type": "code",
|
188 |
+
"execution_count": null,
|
189 |
+
"id": "35566e1a",
|
190 |
+
"metadata": {
|
191 |
+
"scrolled": true
|
192 |
+
},
|
193 |
+
"outputs": [],
|
194 |
+
"source": [
|
195 |
+
"bts_no = 1000\n",
|
196 |
+
"folder_dir = ['/home/pranjul/DeepGaze/all_images_net_input/']\n",
|
197 |
+
"\n",
|
198 |
+
"validator = helper.Validator(name='things_validator',\n",
|
199 |
+
" model=model,\n",
|
200 |
+
" batch_size=10,\n",
|
201 |
+
" data_dir=folder_dir,\n",
|
202 |
+
" ngpus=1,\n",
|
203 |
+
" workers=4,\n",
|
204 |
+
" task=None,\n",
|
205 |
+
" max_samples={'all_images_net_input': 32},\n",
|
206 |
+
" maxout=True,\n",
|
207 |
+
" read_seed=0,\n",
|
208 |
+
" shuffle=False,\n",
|
209 |
+
" data_subdir='test',\n",
|
210 |
+
" includePaths=True)\n",
|
211 |
+
"\n",
|
212 |
+
"num_imgs = len(validator.dataset)\n",
|
213 |
+
"centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
214 |
+
"\n",
|
215 |
+
"img_act = []\n",
|
216 |
+
"spearmanr_values_hypo_1_bts, spearmanr_values_hypo_2_bts = [], []\n",
|
217 |
+
"\n",
|
218 |
+
"for i, image in enumerate(validator.dataset):\n",
|
219 |
+
" \n",
|
220 |
+
" filename = image[-1].split('/')[-1]\n",
|
221 |
+
" image = image[0].unsqueeze(0).cuda()\n",
|
222 |
+
" \n",
|
223 |
+
" \n",
|
224 |
+
" # rescale to match image size\n",
|
225 |
+
" centerbias = zoom(centerbias_template, (image.shape[2]/centerbias_template.shape[0], image.shape[3]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
226 |
+
" # renormalize log density\n",
|
227 |
+
" centerbias -= logsumexp(centerbias)\n",
|
228 |
+
"\n",
|
229 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
230 |
+
"\n",
|
231 |
+
" # Forward pass the image through the model\n",
|
232 |
+
" output = model_dg1(image, centerbias_tensor)\n",
|
233 |
+
"\n",
|
234 |
+
" # Retrieve the extracted activations\n",
|
235 |
+
" activations = [activation[f'layer_{i+1}'] for i in range(len(layers))]\n",
|
236 |
+
"\n",
|
237 |
+
" # Print out the extracted activations\n",
|
238 |
+
" for j, act in enumerate(activations):\n",
|
239 |
+
" print(f\"Layer {j+1} activation shape for {filename}: {act.shape}\")\n",
|
240 |
+
" act = act.cpu().detach().numpy().squeeze()\n",
|
241 |
+
" act = np.reshape(act, (np.prod(act.shape[0:])))\n",
|
242 |
+
" img_act.append(np.array(act))\n",
|
243 |
+
"\n",
|
244 |
+
"\n",
|
245 |
+
"for boot_itr in range(bts_no):\n",
|
246 |
+
" \n",
|
247 |
+
" print(\"boot_itr: \", boot_itr + 1)\n",
|
248 |
+
" \n",
|
249 |
+
" np.random.seed(boot_itr)\n",
|
250 |
+
"\n",
|
251 |
+
" randomRows_0 = []\n",
|
252 |
+
" randomRows_1 = []\n",
|
253 |
+
" randomRows_2 = []\n",
|
254 |
+
"\n",
|
255 |
+
" randomRows_0 = np.random.choice(np.arange(0, 32), size=np.arange(32).shape, replace=True)\n",
|
256 |
+
" randomRows_1 = np.random.choice(np.arange(32, 64), size=np.arange(32).shape, replace=True)\n",
|
257 |
+
" randomRows_2 = np.random.choice(np.arange(64, 96), size=np.arange(32).shape, replace=True)\n",
|
258 |
+
" #print(randomRows)\n",
|
259 |
+
"\n",
|
260 |
+
" bootstrap_idx = [*randomRows_0, *randomRows_1, *randomRows_2]\n",
|
261 |
+
" # print(bootstrap_idx)\n",
|
262 |
+
"\n",
|
263 |
+
" \n",
|
264 |
+
" img_act_layer = []\n",
|
265 |
+
" dist_metric_layers_dual_task_fc = []\n",
|
266 |
+
" \n",
|
267 |
+
" for i in range(len(layers)):\n",
|
268 |
+
" for j in bootstrap_idx:\n",
|
269 |
+
" img_act_layer.append(img_act[i + (j*len(layers))])\n",
|
270 |
+
"\n",
|
271 |
+
" for i in range(len(layers)):\n",
|
272 |
+
" dist_metric = 1 - np.corrcoef(np.array(img_act_layer[i*96:(i+1)*96]))\n",
|
273 |
+
" dist_metric_layers_dual_task_fc.append(dist_metric[np.triu_indices(96, k = 1)])\n",
|
274 |
+
"\n",
|
275 |
+
"\n",
|
276 |
+
" data = np.vstack([dist_metric_layers_dual_task_fc, \n",
|
277 |
+
" np.array(hypo_1[np.triu_indices(96, k = 1)]),\n",
|
278 |
+
" np.array(hypo_2[np.triu_indices(96, k = 1)])\n",
|
279 |
+
" ])\n",
|
280 |
+
"\n",
|
281 |
+
" # print(np.shape(data))\n",
|
282 |
+
" df = pd.DataFrame(data=data.T)\n",
|
283 |
+
"\n",
|
284 |
+
" col_names = []\n",
|
285 |
+
"\n",
|
286 |
+
" for i in range(len(layers)):\n",
|
287 |
+
" col_names.append('layer_' + str(i + 1))\n",
|
288 |
+
"\n",
|
289 |
+
" col_names.extend(('hypo_1', 'hypo_2'))\n",
|
290 |
+
" df.columns = col_names\n",
|
291 |
+
"\n",
|
292 |
+
" spearmanr_values_hypo_1, spearmanr_values_hypo_2 = [], []\n",
|
293 |
+
" layer_no = np.arange(1, len(layers)+1)\n",
|
294 |
+
"\n",
|
295 |
+
" for i in range(len(layers)):\n",
|
296 |
+
"\n",
|
297 |
+
" zero_indices = df.loc[df['layer_'+ str(i + 1)] == 0].index \n",
|
298 |
+
" df_0_removed = df.drop(zero_indices)\n",
|
299 |
+
" \n",
|
300 |
+
" spearmanr_values_hypo_1.append(pg.partial_corr(data=df_0_removed, x='layer_' + str(i + 1), y='hypo_1', covar=['hypo_2'], method='spearman').round(3)['r'][0])\n",
|
301 |
+
" spearmanr_values_hypo_2.append(pg.partial_corr(data=df_0_removed, x='layer_' + str(i + 1), y='hypo_2', covar=['hypo_1'], method='spearman').round(3)['r'][0])\n",
|
302 |
+
" \n",
|
303 |
+
" spearmanr_values_hypo_1_bts.append(np.array(spearmanr_values_hypo_1))\n",
|
304 |
+
" spearmanr_values_hypo_2_bts.append(np.array(spearmanr_values_hypo_2))\n",
|
305 |
+
" \n",
|
306 |
+
"#np.save('spearmanr_values_hypo_1_FC_bootstrap_new_2hypos.npy', np.array(spearmanr_values_hypo_1_bts))\n",
|
307 |
+
"#np.save('spearmanr_values_hypo_2_FC_bootstrap_new_2hypos.npy', np.array(spearmanr_values_hypo_2_bts))\n",
|
308 |
+
"\n",
|
309 |
+
"'''\n",
|
310 |
+
"# Plotting\n",
|
311 |
+
"fig = plt.figure(figsize=(14, 8))\n",
|
312 |
+
"ax = fig.add_subplot(111)\n",
|
313 |
+
"plt.plot(layer_no, spearmanr_values_hypo_1, '-o', label='Faces~Pareidolia', markersize=10)\n",
|
314 |
+
"plt.plot(layer_no, spearmanr_values_hypo_2, '-o', label='Pareidolia~Objects', markersize=10)\n",
|
315 |
+
"plt.plot(layer_no, spearmanr_values_hypo_3, '-o', label='Faces~Objects', markersize=10)\n",
|
316 |
+
"\n",
|
317 |
+
"plt.xticks(layer_no, fontsize=18)\n",
|
318 |
+
"plt.yticks(fontsize=18)\n",
|
319 |
+
"ax.set_xticklabels(layer_no)\n",
|
320 |
+
"plt.ylabel('Partial spearmanr (rho)', fontsize=18)\n",
|
321 |
+
"plt.yticks(np.arange(-0.15, 0.65, 0.05))\n",
|
322 |
+
"leg = plt.legend(loc = 2, prop={'size': 15})\n",
|
323 |
+
"leg.get_frame().set_edgecolor('k')\n",
|
324 |
+
"fig.set_size_inches(14.,8.)\n",
|
325 |
+
"#plt.savefig('3_hypos_partial_spearman.png', dpi=600)\n",
|
326 |
+
"\n",
|
327 |
+
"plt.show()\n",
|
328 |
+
"'''"
|
329 |
+
]
|
330 |
+
},
|
331 |
+
{
|
332 |
+
"cell_type": "code",
|
333 |
+
"execution_count": null,
|
334 |
+
"id": "f4ab47a3",
|
335 |
+
"metadata": {},
|
336 |
+
"outputs": [],
|
337 |
+
"source": [
|
338 |
+
"num_imgs = len(validator.dataset)\n",
|
339 |
+
"\n",
|
340 |
+
"img_act = []\n",
|
341 |
+
"\n",
|
342 |
+
"for i, image in enumerate(validator.dataset):\n",
|
343 |
+
" \n",
|
344 |
+
" filename = image[-1].split('/')[-1]\n",
|
345 |
+
" image = image[0].unsqueeze(0).cuda()\n",
|
346 |
+
"\n",
|
347 |
+
" # rescale to match image size\n",
|
348 |
+
" centerbias = zoom(centerbias_template, (image.shape[2]/centerbias_template.shape[0], image.shape[3]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
349 |
+
" # renormalize log density\n",
|
350 |
+
" centerbias -= logsumexp(centerbias)\n",
|
351 |
+
"\n",
|
352 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
353 |
+
"\n",
|
354 |
+
" # Forward pass the image through the model\n",
|
355 |
+
" output = model_dg1(image, centerbias_tensor)\n",
|
356 |
+
"\n",
|
357 |
+
" # Retrieve the extracted activations\n",
|
358 |
+
" activations = [activation[f'layer_{i+1}'] for i in range(len(layers))]\n",
|
359 |
+
"\n",
|
360 |
+
" # Print out the extracted activations\n",
|
361 |
+
" for j, act in enumerate(activations):\n",
|
362 |
+
" # print(f\"Layer {j+1} activation shape for {filename}: {act.shape}\")\n",
|
363 |
+
" act = act.cpu().detach().numpy().squeeze()\n",
|
364 |
+
" act = np.reshape(act, (np.prod(act.shape[0:])))\n",
|
365 |
+
" img_act.append(np.array(act))\n",
|
366 |
+
"\n",
|
367 |
+
"img_act_layer = []\n",
|
368 |
+
"dist_metric_layers_dual_task_fc = []\n",
|
369 |
+
"\n",
|
370 |
+
"\n",
|
371 |
+
"for i in range(len(layers)):\n",
|
372 |
+
" for j in range(96):\n",
|
373 |
+
" img_act_layer.append(img_act[i + (j*len(layers))])\n",
|
374 |
+
"\n",
|
375 |
+
"for i in range(len(layers)):\n",
|
376 |
+
" dist_metric = 1 - np.corrcoef(np.array(img_act_layer[i*96:(i+1)*96]))\n",
|
377 |
+
" dist_metric_layers_dual_task_fc.append(dist_metric[np.triu_indices(96, k = 1)])\n",
|
378 |
+
"\n",
|
379 |
+
"#np.save('dist_metric_layers_dual_task_fc_2_hypos.npy', np.array(dist_metric_layers_dual_task_fc))\n",
|
380 |
+
"\n",
|
381 |
+
"data = np.vstack([dist_metric_layers_dual_task_fc, \n",
|
382 |
+
" np.array(hypo_1[np.triu_indices(96, k = 1)]),\n",
|
383 |
+
" np.array(hypo_2[np.triu_indices(96, k = 1)]),\n",
|
384 |
+
" ])\n",
|
385 |
+
"\n",
|
386 |
+
"# print(np.shape(data))\n",
|
387 |
+
"df = pd.DataFrame(data=data.T)\n",
|
388 |
+
"\n",
|
389 |
+
"col_names = []\n",
|
390 |
+
"\n",
|
391 |
+
"for i in range(len(layers)):\n",
|
392 |
+
" col_names.append('layer_' + str(i + 1))\n",
|
393 |
+
"\n",
|
394 |
+
"col_names.extend(('hypo_1', 'hypo_2'))\n",
|
395 |
+
"df.columns = col_names\n",
|
396 |
+
"\n",
|
397 |
+
"spearmanr_values_hypo_1, spearmanr_values_hypo_2 = [], []\n",
|
398 |
+
"layer_no = np.arange(1, len(layers)+1)\n",
|
399 |
+
"\n",
|
400 |
+
"for i in range(len(layers)):\n",
|
401 |
+
"\n",
|
402 |
+
" spearmanr_values_hypo_1.append(pg.partial_corr(data=df, x='layer_' + str(i + 1), y='hypo_1', covar=['hypo_2'], method='spearman').round(3)['r'][0])\n",
|
403 |
+
" spearmanr_values_hypo_2.append(pg.partial_corr(data=df, x='layer_' + str(i + 1), y='hypo_2', covar=['hypo_1'], method='spearman').round(3)['r'][0])\n",
|
404 |
+
"\n",
|
405 |
+
"#np.save('inanimate_vgg_large_spearmanr_values_hypo_1_2hypos.npy', np.array(spearmanr_values_hypo_1))\n",
|
406 |
+
"#np.save('inanimate_vgg_large_spearmanr_values_hypo_2_2hypos.npy', np.array(spearmanr_values_hypo_2))\n",
|
407 |
+
"\n",
|
408 |
+
"#face_inanimate_400k_seed_spearmanr_values_hypo_1_bootstrap_new_2hypos\n",
|
409 |
+
"\n",
|
410 |
+
"# Plotting\n",
|
411 |
+
"fig = plt.figure(figsize=(14, 8))\n",
|
412 |
+
"ax = fig.add_subplot(111)\n",
|
413 |
+
"plt.plot(layer_no, spearmanr_values_hypo_1, '-o', label='Faces~Pareidolia', markersize=10)\n",
|
414 |
+
"plt.plot(layer_no, spearmanr_values_hypo_2, '-o', label='Pareidolia~Objects', markersize=10)\n",
|
415 |
+
"\n",
|
416 |
+
"plt.xticks(layer_no, fontsize=18)\n",
|
417 |
+
"plt.yticks(fontsize=18)\n",
|
418 |
+
"ax.set_xticklabels(layer_no)\n",
|
419 |
+
"plt.ylabel('Partial spearmanr (rho)', fontsize=18)\n",
|
420 |
+
"plt.yticks(np.arange(-0.15, 0.65, 0.05))\n",
|
421 |
+
"leg = plt.legend(loc = 2, prop={'size': 15})\n",
|
422 |
+
"leg.get_frame().set_edgecolor('k')\n",
|
423 |
+
"fig.set_size_inches(14.,8.)\n",
|
424 |
+
"#plt.savefig('3_hypos_partial_spearman.png', dpi=600)\n",
|
425 |
+
"\n",
|
426 |
+
"plt.show()\n"
|
427 |
+
]
|
428 |
+
},
|
429 |
+
{
|
430 |
+
"cell_type": "code",
|
431 |
+
"execution_count": null,
|
432 |
+
"id": "78693e0a",
|
433 |
+
"metadata": {},
|
434 |
+
"outputs": [],
|
435 |
+
"source": [
|
436 |
+
"face_vgg_large_spearmanr_values_hypo_1 = spearmanr_values_hypo_1_bts\n",
|
437 |
+
"face_vgg_large_spearmanr_values_hypo_1 = np.reshape(face_vgg_large_spearmanr_values_hypo_1, (bts_no, len(layers)))\n",
|
438 |
+
"face_vgg_large_spearmanr_values_hypo_2 = spearmanr_values_hypo_2_bts\n",
|
439 |
+
"face_vgg_large_spearmanr_values_hypo_2 = np.reshape(face_vgg_large_spearmanr_values_hypo_2, (bts_no, len(layers)))"
|
440 |
+
]
|
441 |
+
},
|
442 |
+
{
|
443 |
+
"cell_type": "code",
|
444 |
+
"execution_count": null,
|
445 |
+
"id": "6aa9c33e",
|
446 |
+
"metadata": {},
|
447 |
+
"outputs": [],
|
448 |
+
"source": [
|
449 |
+
"mean_1 = spearmanr_values_hypo_1\n",
|
450 |
+
"mean_2 = spearmanr_values_hypo_2\n",
|
451 |
+
"\n",
|
452 |
+
"std_1 = []\n",
|
453 |
+
"std_2 = []\n",
|
454 |
+
"\n",
|
455 |
+
"\n",
|
456 |
+
"for i in range(len(layers)):\n",
|
457 |
+
" std_1.append(np.std(face_vgg_large_spearmanr_values_hypo_1, axis = 0)[i])\n",
|
458 |
+
" std_2.append(np.std(face_vgg_large_spearmanr_values_hypo_2, axis = 0)[i])\n",
|
459 |
+
"\n",
|
460 |
+
"std_1 = np.array(std_1)\n",
|
461 |
+
"std_2 = np.array(std_2)"
|
462 |
+
]
|
463 |
+
},
|
464 |
+
{
|
465 |
+
"cell_type": "code",
|
466 |
+
"execution_count": null,
|
467 |
+
"id": "1b813dc6",
|
468 |
+
"metadata": {},
|
469 |
+
"outputs": [],
|
470 |
+
"source": [
|
471 |
+
"# Plotting\n",
|
472 |
+
"fig = plt.figure(figsize=(14, 8))\n",
|
473 |
+
"ax = fig.add_subplot(111)\n",
|
474 |
+
"#plt.axis('on')\n",
|
475 |
+
"#ax = plt.gca()\n",
|
476 |
+
"#plt.plot(layer_no, mean_1, '-o', label='Faces~Pareidolia', markersize=10)\n",
|
477 |
+
"#plt.plot(layer_no, mean_2, '-o', label='Pareidolia~Objects', markersize=10)\n",
|
478 |
+
"#plt.errorbar(layer_no, mean_1, yerr=[confidence_interval_1_0, confidence_interval_1_1], fmt='-o', color = 'tab:blue', capsize=8, label='Faces~Pareidolia', markersize=2)\n",
|
479 |
+
"#plt.errorbar(layer_no, mean_2, yerr=[confidence_interval_2_0, confidence_interval_2_1], fmt='-o', color = 'tab:orange', capsize=8, label='Pareidolia~Objects', markersize=3)\n",
|
480 |
+
"#plt.errorbar(layer_no, mean_3, yerr=[confidence_interval_3_0, confidence_interval_3_1], fmt='-o', color = 'tab:green', capsize=8, label='Objects~Faces', markersize=3)\n",
|
481 |
+
"\n",
|
482 |
+
"plt.plot(layer_no, mean_1, color = 'tab:blue', label='Faces~Pareidolia')\n",
|
483 |
+
"plt.fill_between(layer_no, mean_1-std_1, mean_1+std_1, color = 'lightblue', alpha=.3)\n",
|
484 |
+
"\n",
|
485 |
+
"plt.plot(layer_no, mean_2, color = 'tab:orange', label='Pareidolia~Objects')\n",
|
486 |
+
"plt.fill_between(layer_no, mean_2-std_2, mean_2+std_2, color = 'peachpuff', alpha=.3)\n",
|
487 |
+
"\n",
|
488 |
+
"# plt.plot(layer_no, mean_3, color = 'tab:green', label='Objects~Faces')\n",
|
489 |
+
"# plt.fill_between(layer_no, mean_3-std_3, mean_3+std_3, color = 'lightgreen', alpha=.3)\n",
|
490 |
+
"\n",
|
491 |
+
"#plt.plot(layer_no, spearmanr_values_hypo_3, '-o', label='Faces~Objects', markersize=10)\n",
|
492 |
+
"#plt.axhline(y=0.5, color='r', linestyle='--', label='Random chance')\n",
|
493 |
+
"#plt.axvline(x=4, color='k', linestyle='--')\n",
|
494 |
+
"#plt.axvline(x=13,color='k', linestyle='--')\n",
|
495 |
+
"\n",
|
496 |
+
"plt.xticks(layer_no, fontsize=30)\n",
|
497 |
+
"plt.yticks(fontsize=30)\n",
|
498 |
+
"#ax.tick_params(axis='both', which='major')\n",
|
499 |
+
"ax.set_xticklabels(layer_no)\n",
|
500 |
+
"plt.axis([0, len(layers)+1, -0.2, 0.3])\n",
|
501 |
+
"plt.xlabel('CNN layer', fontsize=30)\n",
|
502 |
+
"plt.ylabel(\"CNN idealized model correlation \\n [Partial Spearman's r]\", fontsize=30)\n",
|
503 |
+
"plt.title('DG1_RSA', fontsize=30)\n",
|
504 |
+
"#ax.grid(which='both')\n",
|
505 |
+
"#ax.grid(which='minor', alpha=0.2)\n",
|
506 |
+
"#ax.grid(which='major', alpha=0.5)\n",
|
507 |
+
"#ax.grid(color='k', alpha=1, linestyle='--')\n",
|
508 |
+
"#plt.legend(loc = 4, prop={'size': 20})\n",
|
509 |
+
"leg = plt.legend(loc = 2, prop={'size': 20})\n",
|
510 |
+
"leg.get_frame().set_edgecolor('k')\n",
|
511 |
+
"#fig.set_size_inches(14.,8.)\n",
|
512 |
+
"plt.tight_layout()\n",
|
513 |
+
"plt.savefig('DG1_RSA.png', dpi=600)\n",
|
514 |
+
"\n",
|
515 |
+
"plt.show()"
|
516 |
+
]
|
517 |
+
},
|
518 |
+
{
|
519 |
+
"cell_type": "code",
|
520 |
+
"execution_count": null,
|
521 |
+
"id": "a0eac54e",
|
522 |
+
"metadata": {},
|
523 |
+
"outputs": [],
|
524 |
+
"source": []
|
525 |
+
},
|
526 |
+
{
|
527 |
+
"cell_type": "code",
|
528 |
+
"execution_count": null,
|
529 |
+
"id": "5f71f0c7",
|
530 |
+
"metadata": {},
|
531 |
+
"outputs": [],
|
532 |
+
"source": []
|
533 |
+
},
|
534 |
+
{
|
535 |
+
"cell_type": "code",
|
536 |
+
"execution_count": null,
|
537 |
+
"id": "04f5607f",
|
538 |
+
"metadata": {},
|
539 |
+
"outputs": [],
|
540 |
+
"source": []
|
541 |
+
},
|
542 |
+
{
|
543 |
+
"cell_type": "code",
|
544 |
+
"execution_count": null,
|
545 |
+
"id": "8da34189",
|
546 |
+
"metadata": {},
|
547 |
+
"outputs": [],
|
548 |
+
"source": []
|
549 |
+
},
|
550 |
+
{
|
551 |
+
"cell_type": "code",
|
552 |
+
"execution_count": null,
|
553 |
+
"id": "82e25b3b",
|
554 |
+
"metadata": {},
|
555 |
+
"outputs": [],
|
556 |
+
"source": []
|
557 |
+
},
|
558 |
+
{
|
559 |
+
"cell_type": "code",
|
560 |
+
"execution_count": null,
|
561 |
+
"id": "f7817cbe",
|
562 |
+
"metadata": {},
|
563 |
+
"outputs": [],
|
564 |
+
"source": []
|
565 |
+
},
|
566 |
+
{
|
567 |
+
"cell_type": "code",
|
568 |
+
"execution_count": null,
|
569 |
+
"id": "d1b73b99",
|
570 |
+
"metadata": {},
|
571 |
+
"outputs": [],
|
572 |
+
"source": []
|
573 |
+
}
|
574 |
+
],
|
575 |
+
"metadata": {
|
576 |
+
"kernelspec": {
|
577 |
+
"display_name": "Python 3",
|
578 |
+
"language": "python",
|
579 |
+
"name": "python3"
|
580 |
+
},
|
581 |
+
"language_info": {
|
582 |
+
"codemirror_mode": {
|
583 |
+
"name": "ipython",
|
584 |
+
"version": 3
|
585 |
+
},
|
586 |
+
"file_extension": ".py",
|
587 |
+
"mimetype": "text/x-python",
|
588 |
+
"name": "python",
|
589 |
+
"nbconvert_exporter": "python",
|
590 |
+
"pygments_lexer": "ipython3",
|
591 |
+
"version": "3.8.5"
|
592 |
+
}
|
593 |
+
},
|
594 |
+
"nbformat": 4,
|
595 |
+
"nbformat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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": null,
|
6 |
+
"id": "2683899d",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [],
|
9 |
+
"source": [
|
10 |
+
"import numpy as np\n",
|
11 |
+
"from scipy.misc import face\n",
|
12 |
+
"from scipy.ndimage import zoom\n",
|
13 |
+
"from scipy.special import logsumexp\n",
|
14 |
+
"import torch\n",
|
15 |
+
"import matplotlib.pyplot as plt"
|
16 |
+
]
|
17 |
+
},
|
18 |
+
{
|
19 |
+
"cell_type": "code",
|
20 |
+
"execution_count": null,
|
21 |
+
"id": "9ab97d0d",
|
22 |
+
"metadata": {},
|
23 |
+
"outputs": [],
|
24 |
+
"source": []
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"cell_type": "code",
|
28 |
+
"execution_count": null,
|
29 |
+
"id": "a9c8a9e7",
|
30 |
+
"metadata": {},
|
31 |
+
"outputs": [],
|
32 |
+
"source": [
|
33 |
+
"import scipy.io"
|
34 |
+
]
|
35 |
+
},
|
36 |
+
{
|
37 |
+
"cell_type": "code",
|
38 |
+
"execution_count": null,
|
39 |
+
"id": "32bd8589",
|
40 |
+
"metadata": {
|
41 |
+
"scrolled": true
|
42 |
+
},
|
43 |
+
"outputs": [],
|
44 |
+
"source": [
|
45 |
+
"import cv2\n",
|
46 |
+
"import os\n",
|
47 |
+
"\n",
|
48 |
+
"def load_images_from_folder(folder):\n",
|
49 |
+
" images = []\n",
|
50 |
+
" img_name = []\n",
|
51 |
+
" for filename in os.listdir(folder):\n",
|
52 |
+
" img = cv2.imread(os.path.join(folder,filename))\n",
|
53 |
+
" if img is not None:\n",
|
54 |
+
" images.append(img)\n",
|
55 |
+
" img_name.append(filename)\n",
|
56 |
+
" return images, img_name"
|
57 |
+
]
|
58 |
+
},
|
59 |
+
{
|
60 |
+
"cell_type": "code",
|
61 |
+
"execution_count": null,
|
62 |
+
"id": "c5ebf6a1",
|
63 |
+
"metadata": {},
|
64 |
+
"outputs": [],
|
65 |
+
"source": [
|
66 |
+
"imgs, img_name = load_images_from_folder('fix_stimuli')"
|
67 |
+
]
|
68 |
+
},
|
69 |
+
{
|
70 |
+
"cell_type": "code",
|
71 |
+
"execution_count": null,
|
72 |
+
"id": "571c8db2",
|
73 |
+
"metadata": {},
|
74 |
+
"outputs": [],
|
75 |
+
"source": [
|
76 |
+
"img_name"
|
77 |
+
]
|
78 |
+
},
|
79 |
+
{
|
80 |
+
"cell_type": "code",
|
81 |
+
"execution_count": null,
|
82 |
+
"id": "cd911d2d",
|
83 |
+
"metadata": {},
|
84 |
+
"outputs": [],
|
85 |
+
"source": []
|
86 |
+
},
|
87 |
+
{
|
88 |
+
"cell_type": "code",
|
89 |
+
"execution_count": null,
|
90 |
+
"id": "e99e7121",
|
91 |
+
"metadata": {},
|
92 |
+
"outputs": [],
|
93 |
+
"source": [
|
94 |
+
"len(img_name)"
|
95 |
+
]
|
96 |
+
},
|
97 |
+
{
|
98 |
+
"cell_type": "code",
|
99 |
+
"execution_count": null,
|
100 |
+
"id": "6e65c80b",
|
101 |
+
"metadata": {
|
102 |
+
"scrolled": false
|
103 |
+
},
|
104 |
+
"outputs": [],
|
105 |
+
"source": [
|
106 |
+
"int(img_name[0].split('.')[0])"
|
107 |
+
]
|
108 |
+
},
|
109 |
+
{
|
110 |
+
"cell_type": "code",
|
111 |
+
"execution_count": null,
|
112 |
+
"id": "303e82af",
|
113 |
+
"metadata": {
|
114 |
+
"scrolled": false
|
115 |
+
},
|
116 |
+
"outputs": [],
|
117 |
+
"source": [
|
118 |
+
"scipy.io.loadmat('S02_fix/S02_face_1.mat')['currImData'][:,4]"
|
119 |
+
]
|
120 |
+
},
|
121 |
+
{
|
122 |
+
"cell_type": "code",
|
123 |
+
"execution_count": null,
|
124 |
+
"id": "f5b41345",
|
125 |
+
"metadata": {},
|
126 |
+
"outputs": [],
|
127 |
+
"source": [
|
128 |
+
"scipy.io.loadmat('S02_fix/S02_face_1.mat')['currImData'][:,5]"
|
129 |
+
]
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"cell_type": "code",
|
133 |
+
"execution_count": null,
|
134 |
+
"id": "e60e197d",
|
135 |
+
"metadata": {
|
136 |
+
"scrolled": true
|
137 |
+
},
|
138 |
+
"outputs": [],
|
139 |
+
"source": [
|
140 |
+
"scipy.io.loadmat('S02_fix/S02_pareidolia_64.mat')"
|
141 |
+
]
|
142 |
+
},
|
143 |
+
{
|
144 |
+
"cell_type": "code",
|
145 |
+
"execution_count": null,
|
146 |
+
"id": "a071e2e4",
|
147 |
+
"metadata": {},
|
148 |
+
"outputs": [],
|
149 |
+
"source": [
|
150 |
+
"for filename in os.listdir('S02_fix'):\n",
|
151 |
+
" print(filename)"
|
152 |
+
]
|
153 |
+
},
|
154 |
+
{
|
155 |
+
"cell_type": "code",
|
156 |
+
"execution_count": null,
|
157 |
+
"id": "0dc9ab34",
|
158 |
+
"metadata": {},
|
159 |
+
"outputs": [],
|
160 |
+
"source": [
|
161 |
+
"def load_fix_from_folder(folder):\n",
|
162 |
+
" fix_X = []\n",
|
163 |
+
" fix_Y = []\n",
|
164 |
+
" img_name = []\n",
|
165 |
+
" for filename in os.listdir(folder):\n",
|
166 |
+
" fix_X.append(scipy.io.loadmat(os.path.join(folder,filename))['currImData'][:,4])\n",
|
167 |
+
" fix_Y.append(scipy.io.loadmat(os.path.join(folder,filename))['currImData'][:,5])\n",
|
168 |
+
" img_name.append(str(scipy.io.loadmat(os.path.join(folder,filename))['currImName'][0][0]) + '.jpg')\n",
|
169 |
+
" #print(filename)\n",
|
170 |
+
" #print(img_name)\n",
|
171 |
+
" return fix_X, fix_Y, img_name"
|
172 |
+
]
|
173 |
+
},
|
174 |
+
{
|
175 |
+
"cell_type": "code",
|
176 |
+
"execution_count": null,
|
177 |
+
"id": "5ad3e153",
|
178 |
+
"metadata": {},
|
179 |
+
"outputs": [],
|
180 |
+
"source": [
|
181 |
+
"fix_X, fix_Y, img_name = load_fix_from_folder('S_fix/S13_fix')"
|
182 |
+
]
|
183 |
+
},
|
184 |
+
{
|
185 |
+
"cell_type": "code",
|
186 |
+
"execution_count": null,
|
187 |
+
"id": "43fc95a0",
|
188 |
+
"metadata": {
|
189 |
+
"scrolled": true
|
190 |
+
},
|
191 |
+
"outputs": [],
|
192 |
+
"source": [
|
193 |
+
"import glob\n",
|
194 |
+
"import os\n",
|
195 |
+
"\n",
|
196 |
+
"# Specify the directory containing the nested folder structure\n",
|
197 |
+
"root_dir = '/home/pranjul/DeepGaze/fix_stimuli/'\n",
|
198 |
+
"\n",
|
199 |
+
"# Specify the image file extensions you want to load\n",
|
200 |
+
"extensions = ['*.jpg', '*.jpeg', '*.png']\n",
|
201 |
+
"\n",
|
202 |
+
"# Create a list to store the image file paths\n",
|
203 |
+
"image_paths = []\n",
|
204 |
+
"\n",
|
205 |
+
"# Traverse through all subdirectories and search for image files\n",
|
206 |
+
"for extension in extensions:\n",
|
207 |
+
" search_pattern = os.path.join(root_dir, '**', extension)\n",
|
208 |
+
" image_paths.extend(glob.glob(search_pattern, recursive=True))\n",
|
209 |
+
"\n",
|
210 |
+
"# Print the paths of the loaded image files\n",
|
211 |
+
"for image_path in image_paths:\n",
|
212 |
+
" print(image_path)\n"
|
213 |
+
]
|
214 |
+
},
|
215 |
+
{
|
216 |
+
"cell_type": "code",
|
217 |
+
"execution_count": null,
|
218 |
+
"id": "864cb318",
|
219 |
+
"metadata": {},
|
220 |
+
"outputs": [],
|
221 |
+
"source": [
|
222 |
+
"import os\n",
|
223 |
+
"\n",
|
224 |
+
"def create_folder(folder_path):\n",
|
225 |
+
" try:\n",
|
226 |
+
" os.mkdir(folder_path)\n",
|
227 |
+
" print(f\"Folder '{folder_path}' created successfully.\")\n",
|
228 |
+
" except FileExistsError:\n",
|
229 |
+
" print(f\"Folder '{folder_path}' already exists.\")\n",
|
230 |
+
" except Exception as e:\n",
|
231 |
+
" print(f\"An error occurred: {e}\")"
|
232 |
+
]
|
233 |
+
},
|
234 |
+
{
|
235 |
+
"cell_type": "code",
|
236 |
+
"execution_count": null,
|
237 |
+
"id": "47b06581",
|
238 |
+
"metadata": {},
|
239 |
+
"outputs": [],
|
240 |
+
"source": [
|
241 |
+
"import os\n",
|
242 |
+
"\n",
|
243 |
+
"def folder_exists(folder_path):\n",
|
244 |
+
" return os.path.exists(folder_path) and os.path.isdir(folder_path)\n",
|
245 |
+
"\n"
|
246 |
+
]
|
247 |
+
},
|
248 |
+
{
|
249 |
+
"cell_type": "code",
|
250 |
+
"execution_count": null,
|
251 |
+
"id": "1d22fce3",
|
252 |
+
"metadata": {},
|
253 |
+
"outputs": [],
|
254 |
+
"source": [
|
255 |
+
"# Replace 'path/to/your/folder' with the folder path you want to check\n",
|
256 |
+
"folder_path = 'S_fix/S18_fix'\n",
|
257 |
+
"if folder_exists(folder_path):\n",
|
258 |
+
" print(f\"Folder '{folder_path}' exists.\")\n",
|
259 |
+
"else:\n",
|
260 |
+
" print(f\"Folder '{folder_path}' does not exist.\")\n"
|
261 |
+
]
|
262 |
+
},
|
263 |
+
{
|
264 |
+
"cell_type": "code",
|
265 |
+
"execution_count": null,
|
266 |
+
"id": "031c09c0",
|
267 |
+
"metadata": {},
|
268 |
+
"outputs": [],
|
269 |
+
"source": []
|
270 |
+
},
|
271 |
+
{
|
272 |
+
"cell_type": "code",
|
273 |
+
"execution_count": null,
|
274 |
+
"id": "30f2ed42",
|
275 |
+
"metadata": {
|
276 |
+
"scrolled": true
|
277 |
+
},
|
278 |
+
"outputs": [],
|
279 |
+
"source": [
|
280 |
+
"for f in range(13, 56):\n",
|
281 |
+
" print(f)\n",
|
282 |
+
" print('S_fix/S'+ str(f) +'_fix')"
|
283 |
+
]
|
284 |
+
},
|
285 |
+
{
|
286 |
+
"cell_type": "code",
|
287 |
+
"execution_count": null,
|
288 |
+
"id": "d5f1efd1",
|
289 |
+
"metadata": {
|
290 |
+
"scrolled": true
|
291 |
+
},
|
292 |
+
"outputs": [],
|
293 |
+
"source": [
|
294 |
+
"import matplotlib.pyplot as plt\n",
|
295 |
+
"import numpy as np\n",
|
296 |
+
"from scipy.misc import face\n",
|
297 |
+
"from scipy.ndimage import zoom\n",
|
298 |
+
"from scipy.special import logsumexp\n",
|
299 |
+
"import torch\n",
|
300 |
+
"\n",
|
301 |
+
"import deepgaze_pytorch\n",
|
302 |
+
"\n",
|
303 |
+
"DEVICE = 'cuda'\n",
|
304 |
+
"\n",
|
305 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
306 |
+
"model = deepgaze_pytorch.DeepGazeIII(pretrained=True).to(DEVICE)\n",
|
307 |
+
"\n",
|
308 |
+
"#image = face()\n",
|
309 |
+
"\n",
|
310 |
+
"x = {}\n",
|
311 |
+
"for q in range(1, 10):\n",
|
312 |
+
" \n",
|
313 |
+
" # Replace 'path/to/your/folder' with the folder path you want to check\n",
|
314 |
+
" folder_path = 'S_fix/S0'+ str(q) +'_fix'\n",
|
315 |
+
" if folder_exists(folder_path):\n",
|
316 |
+
" \n",
|
317 |
+
" fix_X, fix_Y, img_name = load_fix_from_folder('S_fix/S0'+ str(q) +'_fix')\n",
|
318 |
+
"\n",
|
319 |
+
" # Replace 'path/to/your/folder' with the desired folder path\n",
|
320 |
+
" folder_path = 'DG3_heatmaps/S0'+ str(q) +'_fix'\n",
|
321 |
+
" create_folder(folder_path)\n",
|
322 |
+
"\n",
|
323 |
+
"\n",
|
324 |
+
" for i in range(len(img_name)):\n",
|
325 |
+
"\n",
|
326 |
+
" image = cv2.imread('/home/pranjul/DeepGaze/fix_stimuli/' + img_name[i])\n",
|
327 |
+
"\n",
|
328 |
+
" if image is not None and len(fix_X[i]) > 3 and len(fix_Y[i] > 3):\n",
|
329 |
+
"\n",
|
330 |
+
" # location of previous scanpath fixations in x and y (pixel coordinates), starting with the initial fixation on the image.\n",
|
331 |
+
" #fixation_history_x = np.array([1024//2, 300, 500, 200, 200, 700])\n",
|
332 |
+
" #fixation_history_y = np.array([768//2, 300, 100, 300, 100, 500])\n",
|
333 |
+
"\n",
|
334 |
+
" #print(img_name[i])\n",
|
335 |
+
"\n",
|
336 |
+
" fixation_history_x = fix_X[i]/3\n",
|
337 |
+
" #print(fixation_history_x)\n",
|
338 |
+
" fixation_history_y = fix_Y[i]/3\n",
|
339 |
+
"\n",
|
340 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
341 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
342 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
343 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
344 |
+
" # rescale to match image size\n",
|
345 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
346 |
+
" # renormalize log density\n",
|
347 |
+
" centerbias -= logsumexp(centerbias)\n",
|
348 |
+
"\n",
|
349 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
350 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
351 |
+
" x_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
352 |
+
" y_hist_tensor = torch.tensor([fixation_history_y[model.included_fixations]]).to(DEVICE)\n",
|
353 |
+
"\n",
|
354 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor, x_hist_tensor, y_hist_tensor)\n",
|
355 |
+
"\n",
|
356 |
+
" # Scale factor\n",
|
357 |
+
" #scale_factor = 3\n",
|
358 |
+
"\n",
|
359 |
+
" # Calculate the new width and height\n",
|
360 |
+
" #new_width = image.shape[1] * scale_factor\n",
|
361 |
+
" #new_height = image.shape[0] * scale_factor\n",
|
362 |
+
"\n",
|
363 |
+
" # Resize the image using cv2.resize()\n",
|
364 |
+
" #image = cv2.resize(image, (new_width, new_height))\n",
|
365 |
+
"\n",
|
366 |
+
" image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n",
|
367 |
+
"\n",
|
368 |
+
"\n",
|
369 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(16, 9))\n",
|
370 |
+
" axs[0].imshow(image)\n",
|
371 |
+
" #axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
372 |
+
" #axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
373 |
+
" axs[0].set_axis_off()\n",
|
374 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
375 |
+
" #axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
376 |
+
" #axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
377 |
+
" axs[1].set_axis_off()\n",
|
378 |
+
" plt.savefig(os.path.join('DG3_heatmaps/S0'+ str(q) +'_fix', img_name[i]))\n",
|
379 |
+
" plt.close()\n",
|
380 |
+
" #break\n",
|
381 |
+
" #break\n",
|
382 |
+
" #break"
|
383 |
+
]
|
384 |
+
},
|
385 |
+
{
|
386 |
+
"cell_type": "code",
|
387 |
+
"execution_count": null,
|
388 |
+
"id": "bb2809f0",
|
389 |
+
"metadata": {},
|
390 |
+
"outputs": [],
|
391 |
+
"source": []
|
392 |
+
},
|
393 |
+
{
|
394 |
+
"cell_type": "code",
|
395 |
+
"execution_count": null,
|
396 |
+
"id": "4a041477",
|
397 |
+
"metadata": {},
|
398 |
+
"outputs": [],
|
399 |
+
"source": []
|
400 |
+
},
|
401 |
+
{
|
402 |
+
"cell_type": "code",
|
403 |
+
"execution_count": null,
|
404 |
+
"id": "a0baeecb",
|
405 |
+
"metadata": {},
|
406 |
+
"outputs": [],
|
407 |
+
"source": []
|
408 |
+
},
|
409 |
+
{
|
410 |
+
"cell_type": "code",
|
411 |
+
"execution_count": null,
|
412 |
+
"id": "70e54f03",
|
413 |
+
"metadata": {},
|
414 |
+
"outputs": [],
|
415 |
+
"source": [
|
416 |
+
"len(fixation_history_y)"
|
417 |
+
]
|
418 |
+
},
|
419 |
+
{
|
420 |
+
"cell_type": "code",
|
421 |
+
"execution_count": null,
|
422 |
+
"id": "16ec0624",
|
423 |
+
"metadata": {},
|
424 |
+
"outputs": [],
|
425 |
+
"source": [
|
426 |
+
"i"
|
427 |
+
]
|
428 |
+
},
|
429 |
+
{
|
430 |
+
"cell_type": "code",
|
431 |
+
"execution_count": null,
|
432 |
+
"id": "964e517a",
|
433 |
+
"metadata": {},
|
434 |
+
"outputs": [],
|
435 |
+
"source": [
|
436 |
+
"S02_img_name[244]"
|
437 |
+
]
|
438 |
+
},
|
439 |
+
{
|
440 |
+
"cell_type": "code",
|
441 |
+
"execution_count": null,
|
442 |
+
"id": "67397109",
|
443 |
+
"metadata": {},
|
444 |
+
"outputs": [],
|
445 |
+
"source": [
|
446 |
+
"np.where(np.array(S02_img_name) == '44.jpg')"
|
447 |
+
]
|
448 |
+
},
|
449 |
+
{
|
450 |
+
"cell_type": "code",
|
451 |
+
"execution_count": null,
|
452 |
+
"id": "02cd8a6b",
|
453 |
+
"metadata": {},
|
454 |
+
"outputs": [],
|
455 |
+
"source": [
|
456 |
+
"indices = np.where(arr == 2)[0]"
|
457 |
+
]
|
458 |
+
},
|
459 |
+
{
|
460 |
+
"cell_type": "code",
|
461 |
+
"execution_count": null,
|
462 |
+
"id": "a64314eb",
|
463 |
+
"metadata": {},
|
464 |
+
"outputs": [],
|
465 |
+
"source": []
|
466 |
+
},
|
467 |
+
{
|
468 |
+
"cell_type": "code",
|
469 |
+
"execution_count": null,
|
470 |
+
"id": "09b449d7",
|
471 |
+
"metadata": {},
|
472 |
+
"outputs": [],
|
473 |
+
"source": []
|
474 |
+
},
|
475 |
+
{
|
476 |
+
"cell_type": "code",
|
477 |
+
"execution_count": null,
|
478 |
+
"id": "f2e3afae",
|
479 |
+
"metadata": {},
|
480 |
+
"outputs": [],
|
481 |
+
"source": []
|
482 |
+
},
|
483 |
+
{
|
484 |
+
"cell_type": "code",
|
485 |
+
"execution_count": null,
|
486 |
+
"id": "f8433595",
|
487 |
+
"metadata": {},
|
488 |
+
"outputs": [],
|
489 |
+
"source": []
|
490 |
+
},
|
491 |
+
{
|
492 |
+
"cell_type": "code",
|
493 |
+
"execution_count": null,
|
494 |
+
"id": "11bb0a30",
|
495 |
+
"metadata": {},
|
496 |
+
"outputs": [],
|
497 |
+
"source": []
|
498 |
+
},
|
499 |
+
{
|
500 |
+
"cell_type": "code",
|
501 |
+
"execution_count": null,
|
502 |
+
"id": "852d1d54",
|
503 |
+
"metadata": {},
|
504 |
+
"outputs": [],
|
505 |
+
"source": []
|
506 |
+
},
|
507 |
+
{
|
508 |
+
"cell_type": "code",
|
509 |
+
"execution_count": null,
|
510 |
+
"id": "45392af9",
|
511 |
+
"metadata": {},
|
512 |
+
"outputs": [],
|
513 |
+
"source": [
|
514 |
+
"img.shape"
|
515 |
+
]
|
516 |
+
},
|
517 |
+
{
|
518 |
+
"cell_type": "code",
|
519 |
+
"execution_count": null,
|
520 |
+
"id": "93a09086",
|
521 |
+
"metadata": {
|
522 |
+
"scrolled": true
|
523 |
+
},
|
524 |
+
"outputs": [],
|
525 |
+
"source": [
|
526 |
+
"import numpy as np\n",
|
527 |
+
"from scipy.misc import face\n",
|
528 |
+
"from scipy.ndimage import zoom\n",
|
529 |
+
"from scipy.special import logsumexp\n",
|
530 |
+
"import torch\n",
|
531 |
+
"import matplotlib.pyplot as plt\n",
|
532 |
+
"\n",
|
533 |
+
"import deepgaze_pytorch\n",
|
534 |
+
"\n",
|
535 |
+
"DEVICE = 'cuda'\n",
|
536 |
+
"\n",
|
537 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
538 |
+
"model = deepgaze_pytorch.DeepGazeIIE(pretrained=True).to(DEVICE)\n",
|
539 |
+
"\n",
|
540 |
+
"# image = face()\n",
|
541 |
+
"\n",
|
542 |
+
"x = {}\n",
|
543 |
+
"\n",
|
544 |
+
"for i in range(len(image_paths)):\n",
|
545 |
+
" print(i)\n",
|
546 |
+
" \n",
|
547 |
+
" image = cv2.imread(image_paths[i])\n",
|
548 |
+
" \n",
|
549 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
550 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
551 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
552 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
553 |
+
" # rescale to match image size\n",
|
554 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
555 |
+
" # renormalize log density\n",
|
556 |
+
" centerbias -= logsumexp(centerbias)\n",
|
557 |
+
"\n",
|
558 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
559 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
560 |
+
"\n",
|
561 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor)\n",
|
562 |
+
" \n",
|
563 |
+
" #a = log_density_prediction.detach().cpu().numpy()[0, 0]\n",
|
564 |
+
" \n",
|
565 |
+
" #x[img_name[i].split('.')[0]] = a\n",
|
566 |
+
" \n",
|
567 |
+
" \n",
|
568 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(16, 9))\n",
|
569 |
+
" axs[0].imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))\n",
|
570 |
+
" # axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
571 |
+
" # axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
572 |
+
" axs[0].set_axis_off()\n",
|
573 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
574 |
+
" # axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
575 |
+
" # axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
576 |
+
" axs[1].set_axis_off()\n",
|
577 |
+
" plt.savefig(os.path.join('DG2_modified_imgs_heatmaps', '{0}.jpg'.format(i)))\n",
|
578 |
+
" \n",
|
579 |
+
" \n",
|
580 |
+
" #break"
|
581 |
+
]
|
582 |
+
},
|
583 |
+
{
|
584 |
+
"cell_type": "code",
|
585 |
+
"execution_count": null,
|
586 |
+
"id": "3e4e709a",
|
587 |
+
"metadata": {},
|
588 |
+
"outputs": [],
|
589 |
+
"source": []
|
590 |
+
},
|
591 |
+
{
|
592 |
+
"cell_type": "code",
|
593 |
+
"execution_count": null,
|
594 |
+
"id": "2bd1220a",
|
595 |
+
"metadata": {},
|
596 |
+
"outputs": [],
|
597 |
+
"source": []
|
598 |
+
},
|
599 |
+
{
|
600 |
+
"cell_type": "code",
|
601 |
+
"execution_count": null,
|
602 |
+
"id": "60141a51",
|
603 |
+
"metadata": {},
|
604 |
+
"outputs": [],
|
605 |
+
"source": []
|
606 |
+
},
|
607 |
+
{
|
608 |
+
"cell_type": "code",
|
609 |
+
"execution_count": null,
|
610 |
+
"id": "d2f42e76",
|
611 |
+
"metadata": {
|
612 |
+
"scrolled": true
|
613 |
+
},
|
614 |
+
"outputs": [],
|
615 |
+
"source": [
|
616 |
+
"import numpy as np\n",
|
617 |
+
"from scipy.misc import face\n",
|
618 |
+
"from scipy.ndimage import zoom\n",
|
619 |
+
"from scipy.special import logsumexp\n",
|
620 |
+
"import torch\n",
|
621 |
+
"import matplotlib.pyplot as plt\n",
|
622 |
+
"\n",
|
623 |
+
"import deepgaze_pytorch\n",
|
624 |
+
"\n",
|
625 |
+
"DEVICE = 'cuda'\n",
|
626 |
+
"\n",
|
627 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
628 |
+
"model = deepgaze_pytorch.DeepGazeIIE(pretrained=True).to(DEVICE)\n",
|
629 |
+
"\n",
|
630 |
+
"# image = face()\n",
|
631 |
+
"\n",
|
632 |
+
"x = {}\n",
|
633 |
+
"\n",
|
634 |
+
"for i in range(len(imgs)):\n",
|
635 |
+
" \n",
|
636 |
+
" image = imgs[i]\n",
|
637 |
+
" \n",
|
638 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
639 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
640 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
641 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
642 |
+
" # rescale to match image size\n",
|
643 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
644 |
+
" # renormalize log density\n",
|
645 |
+
" centerbias -= logsumexp(centerbias)\n",
|
646 |
+
"\n",
|
647 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
648 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
649 |
+
"\n",
|
650 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor)\n",
|
651 |
+
" \n",
|
652 |
+
" a = log_density_prediction.detach().cpu().numpy()[0, 0]\n",
|
653 |
+
" \n",
|
654 |
+
" x[img_name[i].split('.')[0]] = a\n",
|
655 |
+
" \n",
|
656 |
+
" '''\n",
|
657 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(16, 9))\n",
|
658 |
+
" axs[0].imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))\n",
|
659 |
+
" # axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
660 |
+
" # axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
661 |
+
" axs[0].set_axis_off()\n",
|
662 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
663 |
+
" # axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
664 |
+
" # axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
665 |
+
" axs[1].set_axis_off()\n",
|
666 |
+
" # plt.savefig(os.path.join('DG2_heatmaps', '{0}.jpg'.format(i)))\n",
|
667 |
+
" '''\n",
|
668 |
+
" \n",
|
669 |
+
" #break"
|
670 |
+
]
|
671 |
+
},
|
672 |
+
{
|
673 |
+
"cell_type": "code",
|
674 |
+
"execution_count": null,
|
675 |
+
"id": "ca4ab04b",
|
676 |
+
"metadata": {},
|
677 |
+
"outputs": [],
|
678 |
+
"source": [
|
679 |
+
"for k in x:\n",
|
680 |
+
" print(k)"
|
681 |
+
]
|
682 |
+
},
|
683 |
+
{
|
684 |
+
"cell_type": "code",
|
685 |
+
"execution_count": null,
|
686 |
+
"id": "26527272",
|
687 |
+
"metadata": {},
|
688 |
+
"outputs": [],
|
689 |
+
"source": [
|
690 |
+
"import glob\n",
|
691 |
+
"from scipy.io import loadmat\n",
|
692 |
+
"from scipy.stats import pearsonr, spearmanr\n",
|
693 |
+
"from sklearn.preprocessing import MinMaxScaler\n",
|
694 |
+
"\n",
|
695 |
+
"scaler = MinMaxScaler()"
|
696 |
+
]
|
697 |
+
},
|
698 |
+
{
|
699 |
+
"cell_type": "code",
|
700 |
+
"execution_count": null,
|
701 |
+
"id": "3938f5cb",
|
702 |
+
"metadata": {},
|
703 |
+
"outputs": [],
|
704 |
+
"source": [
|
705 |
+
"\n",
|
706 |
+
"y_faces = {}\n",
|
707 |
+
"\n",
|
708 |
+
"for filename in glob.glob('/home/pranjul/DeepGaze/heatmaps/faces/*.mat'): #assuming gif\n",
|
709 |
+
" \n",
|
710 |
+
" fn=loadmat(filename)\n",
|
711 |
+
" y_faces[filename.split('/')[-1].split('.')[0]] = fn\n",
|
712 |
+
" #break"
|
713 |
+
]
|
714 |
+
},
|
715 |
+
{
|
716 |
+
"cell_type": "code",
|
717 |
+
"execution_count": null,
|
718 |
+
"id": "c5902106",
|
719 |
+
"metadata": {},
|
720 |
+
"outputs": [],
|
721 |
+
"source": [
|
722 |
+
"\n",
|
723 |
+
"y_objects = {}\n",
|
724 |
+
"\n",
|
725 |
+
"for filename in glob.glob('/home/pranjul/DeepGaze/heatmaps/objects/*.mat'): #assuming gif\n",
|
726 |
+
" \n",
|
727 |
+
" fn=loadmat(filename)\n",
|
728 |
+
" y_objects[filename.split('/')[-1].split('.')[0]] = fn\n",
|
729 |
+
" #break"
|
730 |
+
]
|
731 |
+
},
|
732 |
+
{
|
733 |
+
"cell_type": "code",
|
734 |
+
"execution_count": null,
|
735 |
+
"id": "e6fa7c47",
|
736 |
+
"metadata": {},
|
737 |
+
"outputs": [],
|
738 |
+
"source": [
|
739 |
+
"\n",
|
740 |
+
"y_pareidolia = {}\n",
|
741 |
+
"\n",
|
742 |
+
"for filename in glob.glob('/home/pranjul/DeepGaze/heatmaps/pareidolia/*.mat'): #assuming gif\n",
|
743 |
+
" \n",
|
744 |
+
" fn=loadmat(filename)\n",
|
745 |
+
" y_pareidolia[filename.split('/')[-1].split('.')[0]] = fn\n",
|
746 |
+
" #break"
|
747 |
+
]
|
748 |
+
},
|
749 |
+
{
|
750 |
+
"cell_type": "code",
|
751 |
+
"execution_count": null,
|
752 |
+
"id": "a2166932",
|
753 |
+
"metadata": {
|
754 |
+
"scrolled": true
|
755 |
+
},
|
756 |
+
"outputs": [],
|
757 |
+
"source": [
|
758 |
+
"dg_faces = []\n",
|
759 |
+
"eg_faces = []\n",
|
760 |
+
"ke = []\n",
|
761 |
+
"for k in x:\n",
|
762 |
+
" if k in y_faces:\n",
|
763 |
+
" print(k)\n",
|
764 |
+
" ke.append(k)\n",
|
765 |
+
" #print(np.shape(x[k]))\n",
|
766 |
+
" #print(y_faces[k])\n",
|
767 |
+
" dg_faces.append(scaler.fit_transform(np.array(x[k])).flatten())\n",
|
768 |
+
" eg_faces.append(scaler.fit_transform(np.array(y_faces[k]['a'])).flatten())\n",
|
769 |
+
" #break\n",
|
770 |
+
"\n",
|
771 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_faces).flatten(), np.array(eg_faces).flatten())\n",
|
772 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
773 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
774 |
+
"print(\"p-value:\", p_value)"
|
775 |
+
]
|
776 |
+
},
|
777 |
+
{
|
778 |
+
"cell_type": "code",
|
779 |
+
"execution_count": null,
|
780 |
+
"id": "77266844",
|
781 |
+
"metadata": {
|
782 |
+
"scrolled": true
|
783 |
+
},
|
784 |
+
"outputs": [],
|
785 |
+
"source": [
|
786 |
+
"dg_objects = []\n",
|
787 |
+
"eg_objects = []\n",
|
788 |
+
"ke = []\n",
|
789 |
+
"for k in x:\n",
|
790 |
+
" if k in y_objects:\n",
|
791 |
+
" print(k)\n",
|
792 |
+
" ke.append(k)\n",
|
793 |
+
" #print(np.shape(x[k]))\n",
|
794 |
+
" #print(y_faces[k])\n",
|
795 |
+
" dg_objects.append(scaler.fit_transform(np.array(x[k])).flatten())\n",
|
796 |
+
" eg_objects.append(scaler.fit_transform(np.array(y_objects[k]['a'])).flatten())\n",
|
797 |
+
" #break\n",
|
798 |
+
"\n",
|
799 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_objects).flatten(), np.array(eg_objects).flatten())\n",
|
800 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
801 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
802 |
+
"print(\"p-value:\", p_value)"
|
803 |
+
]
|
804 |
+
},
|
805 |
+
{
|
806 |
+
"cell_type": "code",
|
807 |
+
"execution_count": null,
|
808 |
+
"id": "0403de67",
|
809 |
+
"metadata": {
|
810 |
+
"scrolled": true
|
811 |
+
},
|
812 |
+
"outputs": [],
|
813 |
+
"source": [
|
814 |
+
"dg_pareidolia = []\n",
|
815 |
+
"eg_pareidolia = []\n",
|
816 |
+
"ke = []\n",
|
817 |
+
"for k in x:\n",
|
818 |
+
" if k in y_pareidolia:\n",
|
819 |
+
" print(k)\n",
|
820 |
+
" ke.append(k)\n",
|
821 |
+
" #print(np.shape(x[k]))\n",
|
822 |
+
" #print(y_faces[k])\n",
|
823 |
+
" dg_pareidolia.append(scaler.fit_transform(np.array(x[k])).flatten())\n",
|
824 |
+
" eg_pareidolia.append(scaler.fit_transform(np.array(y_pareidolia[k]['a'])).flatten())\n",
|
825 |
+
" #break\n",
|
826 |
+
"\n",
|
827 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_pareidolia).flatten(), np.array(eg_pareidolia).flatten())\n",
|
828 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
829 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
830 |
+
"print(\"p-value:\", p_value)"
|
831 |
+
]
|
832 |
+
},
|
833 |
+
{
|
834 |
+
"cell_type": "code",
|
835 |
+
"execution_count": null,
|
836 |
+
"id": "c297d11a",
|
837 |
+
"metadata": {},
|
838 |
+
"outputs": [],
|
839 |
+
"source": [
|
840 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_faces).flatten(), np.array(eg_faces).flatten())\n",
|
841 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
842 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
843 |
+
"print(\"p-value:\", p_value)"
|
844 |
+
]
|
845 |
+
},
|
846 |
+
{
|
847 |
+
"cell_type": "code",
|
848 |
+
"execution_count": null,
|
849 |
+
"id": "85e5edb2",
|
850 |
+
"metadata": {},
|
851 |
+
"outputs": [],
|
852 |
+
"source": [
|
853 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_objects).flatten(), np.array(eg_objects).flatten())\n",
|
854 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
855 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
856 |
+
"print(\"p-value:\", p_value)"
|
857 |
+
]
|
858 |
+
},
|
859 |
+
{
|
860 |
+
"cell_type": "code",
|
861 |
+
"execution_count": null,
|
862 |
+
"id": "d99c7309",
|
863 |
+
"metadata": {},
|
864 |
+
"outputs": [],
|
865 |
+
"source": [
|
866 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_pareidolia).flatten(), np.array(eg_pareidolia).flatten())\n",
|
867 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
868 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
869 |
+
"print(\"p-value:\", p_value)"
|
870 |
+
]
|
871 |
+
},
|
872 |
+
{
|
873 |
+
"cell_type": "code",
|
874 |
+
"execution_count": null,
|
875 |
+
"id": "e9702314",
|
876 |
+
"metadata": {},
|
877 |
+
"outputs": [],
|
878 |
+
"source": [
|
879 |
+
"len(dg_pareidolia)"
|
880 |
+
]
|
881 |
+
},
|
882 |
+
{
|
883 |
+
"cell_type": "code",
|
884 |
+
"execution_count": null,
|
885 |
+
"id": "c319f00b",
|
886 |
+
"metadata": {},
|
887 |
+
"outputs": [],
|
888 |
+
"source": [
|
889 |
+
"len(dg_faces[:83])"
|
890 |
+
]
|
891 |
+
},
|
892 |
+
{
|
893 |
+
"cell_type": "code",
|
894 |
+
"execution_count": null,
|
895 |
+
"id": "1fa45e93",
|
896 |
+
"metadata": {},
|
897 |
+
"outputs": [],
|
898 |
+
"source": [
|
899 |
+
"len(dg_objects[:83])"
|
900 |
+
]
|
901 |
+
},
|
902 |
+
{
|
903 |
+
"cell_type": "code",
|
904 |
+
"execution_count": null,
|
905 |
+
"id": "5e9fd2b6",
|
906 |
+
"metadata": {},
|
907 |
+
"outputs": [],
|
908 |
+
"source": [
|
909 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_faces[:83]).flatten(), np.array(dg_objects[:83]).flatten())\n",
|
910 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
911 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
912 |
+
"print(\"p-value:\", p_value)"
|
913 |
+
]
|
914 |
+
},
|
915 |
+
{
|
916 |
+
"cell_type": "code",
|
917 |
+
"execution_count": null,
|
918 |
+
"id": "a9357f4f",
|
919 |
+
"metadata": {},
|
920 |
+
"outputs": [],
|
921 |
+
"source": [
|
922 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_faces[:83]).flatten(), np.array(dg_pareidolia[:83]).flatten())\n",
|
923 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
924 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
925 |
+
"print(\"p-value:\", p_value)"
|
926 |
+
]
|
927 |
+
},
|
928 |
+
{
|
929 |
+
"cell_type": "code",
|
930 |
+
"execution_count": null,
|
931 |
+
"id": "f70021f3",
|
932 |
+
"metadata": {},
|
933 |
+
"outputs": [],
|
934 |
+
"source": [
|
935 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_pareidolia[:83]).flatten(), np.array(dg_objects[:83]).flatten())\n",
|
936 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
937 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
938 |
+
"print(\"p-value:\", p_value)"
|
939 |
+
]
|
940 |
+
},
|
941 |
+
{
|
942 |
+
"cell_type": "code",
|
943 |
+
"execution_count": null,
|
944 |
+
"id": "0df004a4",
|
945 |
+
"metadata": {},
|
946 |
+
"outputs": [],
|
947 |
+
"source": [
|
948 |
+
"correlation_coef, p_value = spearmanr(np.array(eg_pareidolia[:83]).flatten(), np.array(eg_objects[:83]).flatten())\n",
|
949 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
950 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
951 |
+
"print(\"p-value:\", p_value)"
|
952 |
+
]
|
953 |
+
},
|
954 |
+
{
|
955 |
+
"cell_type": "code",
|
956 |
+
"execution_count": null,
|
957 |
+
"id": "1742ecb1",
|
958 |
+
"metadata": {},
|
959 |
+
"outputs": [],
|
960 |
+
"source": [
|
961 |
+
"correlation_coef, p_value = spearmanr(np.array(eg_pareidolia[:83]).flatten(), np.array(eg_faces[:83]).flatten())\n",
|
962 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
963 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
964 |
+
"print(\"p-value:\", p_value)"
|
965 |
+
]
|
966 |
+
},
|
967 |
+
{
|
968 |
+
"cell_type": "code",
|
969 |
+
"execution_count": null,
|
970 |
+
"id": "0a02bf88",
|
971 |
+
"metadata": {},
|
972 |
+
"outputs": [],
|
973 |
+
"source": [
|
974 |
+
"correlation_coef, p_value = spearmanr(np.array(eg_faces[:83]).flatten(), np.array(eg_objects[:83]).flatten())\n",
|
975 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
976 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
977 |
+
"print(\"p-value:\", p_value)"
|
978 |
+
]
|
979 |
+
},
|
980 |
+
{
|
981 |
+
"cell_type": "code",
|
982 |
+
"execution_count": null,
|
983 |
+
"id": "b7ccd13e",
|
984 |
+
"metadata": {},
|
985 |
+
"outputs": [],
|
986 |
+
"source": []
|
987 |
+
},
|
988 |
+
{
|
989 |
+
"cell_type": "code",
|
990 |
+
"execution_count": null,
|
991 |
+
"id": "fdeb2fc5",
|
992 |
+
"metadata": {},
|
993 |
+
"outputs": [],
|
994 |
+
"source": []
|
995 |
+
},
|
996 |
+
{
|
997 |
+
"cell_type": "code",
|
998 |
+
"execution_count": null,
|
999 |
+
"id": "7faa17c1",
|
1000 |
+
"metadata": {},
|
1001 |
+
"outputs": [],
|
1002 |
+
"source": []
|
1003 |
+
},
|
1004 |
+
{
|
1005 |
+
"cell_type": "code",
|
1006 |
+
"execution_count": null,
|
1007 |
+
"id": "f9af3d41",
|
1008 |
+
"metadata": {},
|
1009 |
+
"outputs": [],
|
1010 |
+
"source": [
|
1011 |
+
"import numpy as np\n",
|
1012 |
+
"from scipy.stats import spearmanr\n",
|
1013 |
+
"\n",
|
1014 |
+
"# Generate two arrays with random data\n",
|
1015 |
+
"array1 = np.random.rand(100)\n",
|
1016 |
+
"array2 = np.random.rand(100)\n",
|
1017 |
+
"\n",
|
1018 |
+
"# Calculate Spearman's correlation coefficient and p-value\n",
|
1019 |
+
"correlation, p_value = spearmanr(array1, array2)\n",
|
1020 |
+
"\n",
|
1021 |
+
"print(\"Spearman's correlation coefficient:\", correlation)\n",
|
1022 |
+
"print(\"p-value:\", p_value)\n"
|
1023 |
+
]
|
1024 |
+
},
|
1025 |
+
{
|
1026 |
+
"cell_type": "code",
|
1027 |
+
"execution_count": null,
|
1028 |
+
"id": "f7cd0d61",
|
1029 |
+
"metadata": {},
|
1030 |
+
"outputs": [],
|
1031 |
+
"source": []
|
1032 |
+
},
|
1033 |
+
{
|
1034 |
+
"cell_type": "code",
|
1035 |
+
"execution_count": null,
|
1036 |
+
"id": "3570f454",
|
1037 |
+
"metadata": {},
|
1038 |
+
"outputs": [],
|
1039 |
+
"source": []
|
1040 |
+
},
|
1041 |
+
{
|
1042 |
+
"cell_type": "code",
|
1043 |
+
"execution_count": null,
|
1044 |
+
"id": "3a0a92be",
|
1045 |
+
"metadata": {},
|
1046 |
+
"outputs": [],
|
1047 |
+
"source": [
|
1048 |
+
"import numpy as np\n",
|
1049 |
+
"from scipy.stats import pearsonr\n",
|
1050 |
+
"\n",
|
1051 |
+
"# define two eye gaze heatmaps\n",
|
1052 |
+
"heatmap1 = np.array([[0.2, 0.3, 0.1],\n",
|
1053 |
+
" [0.1, 0.4, 0.3],\n",
|
1054 |
+
" [0.3, 0.2, 0.1]])\n",
|
1055 |
+
"\n",
|
1056 |
+
"heatmap2 = np.array([[0.1, 0.2, 0.3],\n",
|
1057 |
+
" [0.2, 0.3, 0.2],\n",
|
1058 |
+
" [0.3, 0.1, 0.1]])\n",
|
1059 |
+
"\n",
|
1060 |
+
"# flatten the heatmaps into 1D arrays\n",
|
1061 |
+
"flat_heatmap1 = heatmap1.flatten()\n",
|
1062 |
+
"flat_heatmap2 = heatmap2.flatten()\n",
|
1063 |
+
"\n",
|
1064 |
+
"# calculate the Pearson correlation coefficient and p-value\n",
|
1065 |
+
"corr, p_value = pearsonr(flat_heatmap1, flat_heatmap2)\n",
|
1066 |
+
"\n",
|
1067 |
+
"print(\"Correlation coefficient:\", corr)\n",
|
1068 |
+
"print(\"p-value:\", p_value)\n"
|
1069 |
+
]
|
1070 |
+
},
|
1071 |
+
{
|
1072 |
+
"cell_type": "code",
|
1073 |
+
"execution_count": null,
|
1074 |
+
"id": "98a8e3c1",
|
1075 |
+
"metadata": {},
|
1076 |
+
"outputs": [],
|
1077 |
+
"source": [
|
1078 |
+
"np.shape(b)"
|
1079 |
+
]
|
1080 |
+
},
|
1081 |
+
{
|
1082 |
+
"cell_type": "code",
|
1083 |
+
"execution_count": null,
|
1084 |
+
"id": "55b352bd",
|
1085 |
+
"metadata": {},
|
1086 |
+
"outputs": [],
|
1087 |
+
"source": [
|
1088 |
+
"np.shape(a)"
|
1089 |
+
]
|
1090 |
+
},
|
1091 |
+
{
|
1092 |
+
"cell_type": "code",
|
1093 |
+
"execution_count": null,
|
1094 |
+
"id": "3fe648aa",
|
1095 |
+
"metadata": {},
|
1096 |
+
"outputs": [],
|
1097 |
+
"source": [
|
1098 |
+
"np.shape(correlation_coef)"
|
1099 |
+
]
|
1100 |
+
},
|
1101 |
+
{
|
1102 |
+
"cell_type": "code",
|
1103 |
+
"execution_count": null,
|
1104 |
+
"id": "cd8e091b",
|
1105 |
+
"metadata": {},
|
1106 |
+
"outputs": [],
|
1107 |
+
"source": [
|
1108 |
+
"plt.imshow(correlation_coef)"
|
1109 |
+
]
|
1110 |
+
},
|
1111 |
+
{
|
1112 |
+
"cell_type": "code",
|
1113 |
+
"execution_count": null,
|
1114 |
+
"id": "884bf73a",
|
1115 |
+
"metadata": {},
|
1116 |
+
"outputs": [],
|
1117 |
+
"source": [
|
1118 |
+
"correlation_coef[83:, :83]"
|
1119 |
+
]
|
1120 |
+
},
|
1121 |
+
{
|
1122 |
+
"cell_type": "code",
|
1123 |
+
"execution_count": null,
|
1124 |
+
"id": "4a540fa9",
|
1125 |
+
"metadata": {
|
1126 |
+
"scrolled": true
|
1127 |
+
},
|
1128 |
+
"outputs": [],
|
1129 |
+
"source": [
|
1130 |
+
"plt.imshow(correlation_coef[83:, :83])"
|
1131 |
+
]
|
1132 |
+
},
|
1133 |
+
{
|
1134 |
+
"cell_type": "code",
|
1135 |
+
"execution_count": null,
|
1136 |
+
"id": "62cadea8",
|
1137 |
+
"metadata": {},
|
1138 |
+
"outputs": [],
|
1139 |
+
"source": [
|
1140 |
+
"plt.plot(np.diagonal(correlation_coef[100:, :100]), 'o') #faces"
|
1141 |
+
]
|
1142 |
+
},
|
1143 |
+
{
|
1144 |
+
"cell_type": "code",
|
1145 |
+
"execution_count": null,
|
1146 |
+
"id": "f05bd895",
|
1147 |
+
"metadata": {},
|
1148 |
+
"outputs": [],
|
1149 |
+
"source": [
|
1150 |
+
"np.mean(np.diagonal(correlation_coef[100:, :100]))"
|
1151 |
+
]
|
1152 |
+
},
|
1153 |
+
{
|
1154 |
+
"cell_type": "code",
|
1155 |
+
"execution_count": null,
|
1156 |
+
"id": "6e227007",
|
1157 |
+
"metadata": {},
|
1158 |
+
"outputs": [],
|
1159 |
+
"source": [
|
1160 |
+
"plt.plot(np.diagonal(correlation_coef[100:, :100]), 'o') #obj"
|
1161 |
+
]
|
1162 |
+
},
|
1163 |
+
{
|
1164 |
+
"cell_type": "code",
|
1165 |
+
"execution_count": null,
|
1166 |
+
"id": "12ed25e7",
|
1167 |
+
"metadata": {},
|
1168 |
+
"outputs": [],
|
1169 |
+
"source": [
|
1170 |
+
"np.mean(np.diagonal(correlation_coef[86:, :86]))"
|
1171 |
+
]
|
1172 |
+
},
|
1173 |
+
{
|
1174 |
+
"cell_type": "code",
|
1175 |
+
"execution_count": null,
|
1176 |
+
"id": "ccf0a569",
|
1177 |
+
"metadata": {},
|
1178 |
+
"outputs": [],
|
1179 |
+
"source": [
|
1180 |
+
"plt.plot(np.diagonal(correlation_coef[83:, :83]), 'o') #pare"
|
1181 |
+
]
|
1182 |
+
},
|
1183 |
+
{
|
1184 |
+
"cell_type": "code",
|
1185 |
+
"execution_count": null,
|
1186 |
+
"id": "923ed911",
|
1187 |
+
"metadata": {},
|
1188 |
+
"outputs": [],
|
1189 |
+
"source": [
|
1190 |
+
"np.mean(np.diagonal(correlation_coef[83:, :83]))"
|
1191 |
+
]
|
1192 |
+
},
|
1193 |
+
{
|
1194 |
+
"cell_type": "code",
|
1195 |
+
"execution_count": null,
|
1196 |
+
"id": "27bac165",
|
1197 |
+
"metadata": {},
|
1198 |
+
"outputs": [],
|
1199 |
+
"source": []
|
1200 |
+
},
|
1201 |
+
{
|
1202 |
+
"cell_type": "code",
|
1203 |
+
"execution_count": null,
|
1204 |
+
"id": "f751bc29",
|
1205 |
+
"metadata": {},
|
1206 |
+
"outputs": [],
|
1207 |
+
"source": [
|
1208 |
+
"plt.imshow(y_objects['1153']['a'])"
|
1209 |
+
]
|
1210 |
+
},
|
1211 |
+
{
|
1212 |
+
"cell_type": "code",
|
1213 |
+
"execution_count": null,
|
1214 |
+
"id": "0c6a4bb4",
|
1215 |
+
"metadata": {},
|
1216 |
+
"outputs": [],
|
1217 |
+
"source": [
|
1218 |
+
"y_faces"
|
1219 |
+
]
|
1220 |
+
},
|
1221 |
+
{
|
1222 |
+
"cell_type": "code",
|
1223 |
+
"execution_count": null,
|
1224 |
+
"id": "40a93053",
|
1225 |
+
"metadata": {},
|
1226 |
+
"outputs": [],
|
1227 |
+
"source": []
|
1228 |
+
},
|
1229 |
+
{
|
1230 |
+
"cell_type": "code",
|
1231 |
+
"execution_count": null,
|
1232 |
+
"id": "4a9b5849",
|
1233 |
+
"metadata": {},
|
1234 |
+
"outputs": [],
|
1235 |
+
"source": []
|
1236 |
+
},
|
1237 |
+
{
|
1238 |
+
"cell_type": "code",
|
1239 |
+
"execution_count": null,
|
1240 |
+
"id": "76eee42b",
|
1241 |
+
"metadata": {},
|
1242 |
+
"outputs": [],
|
1243 |
+
"source": [
|
1244 |
+
"np.shape(imgs)"
|
1245 |
+
]
|
1246 |
+
},
|
1247 |
+
{
|
1248 |
+
"cell_type": "code",
|
1249 |
+
"execution_count": null,
|
1250 |
+
"id": "1cc44e0e",
|
1251 |
+
"metadata": {},
|
1252 |
+
"outputs": [],
|
1253 |
+
"source": []
|
1254 |
+
},
|
1255 |
+
{
|
1256 |
+
"cell_type": "code",
|
1257 |
+
"execution_count": null,
|
1258 |
+
"id": "1d14b8ad",
|
1259 |
+
"metadata": {},
|
1260 |
+
"outputs": [],
|
1261 |
+
"source": []
|
1262 |
+
},
|
1263 |
+
{
|
1264 |
+
"cell_type": "code",
|
1265 |
+
"execution_count": null,
|
1266 |
+
"id": "feddeb52",
|
1267 |
+
"metadata": {},
|
1268 |
+
"outputs": [],
|
1269 |
+
"source": [
|
1270 |
+
"import matplotlib.pyplot as plt\n",
|
1271 |
+
"import numpy as np\n",
|
1272 |
+
"from scipy.misc import face\n",
|
1273 |
+
"from scipy.ndimage import zoom\n",
|
1274 |
+
"from scipy.special import logsumexp\n",
|
1275 |
+
"import torch\n",
|
1276 |
+
"\n",
|
1277 |
+
"import deepgaze_pytorch\n",
|
1278 |
+
"\n",
|
1279 |
+
"DEVICE = 'cuda'\n",
|
1280 |
+
"\n",
|
1281 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
1282 |
+
"model = deepgaze_pytorch.DeepGazeIII(pretrained=True).to(DEVICE)\n",
|
1283 |
+
"\n",
|
1284 |
+
"image = face()\n",
|
1285 |
+
"\n",
|
1286 |
+
"# location of previous scanpath fixations in x and y (pixel coordinates), starting with the initial fixation on the image.\n",
|
1287 |
+
"fixation_history_x = np.array([1024//2, 300, 500, 200, 200, 700])\n",
|
1288 |
+
"fixation_history_y = np.array([768//2, 300, 100, 300, 100, 500])\n",
|
1289 |
+
"\n",
|
1290 |
+
"# load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
1291 |
+
"# you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
1292 |
+
"# alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
1293 |
+
"centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
1294 |
+
"# rescale to match image size\n",
|
1295 |
+
"centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
1296 |
+
"# renormalize log density\n",
|
1297 |
+
"centerbias -= logsumexp(centerbias)\n",
|
1298 |
+
"\n",
|
1299 |
+
"image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
1300 |
+
"centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
1301 |
+
"x_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
1302 |
+
"y_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
1303 |
+
"\n",
|
1304 |
+
"log_density_prediction = model(image_tensor, centerbias_tensor, x_hist_tensor, y_hist_tensor)\n",
|
1305 |
+
"\n",
|
1306 |
+
"f, axs = plt.subplots(nrows=1, ncols=2, figsize=(8, 3))\n",
|
1307 |
+
"axs[0].imshow(image)\n",
|
1308 |
+
"axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1309 |
+
"axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1310 |
+
"axs[0].set_axis_off()\n",
|
1311 |
+
"axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
1312 |
+
"axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1313 |
+
"axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1314 |
+
"axs[1].set_axis_off()"
|
1315 |
+
]
|
1316 |
+
},
|
1317 |
+
{
|
1318 |
+
"cell_type": "code",
|
1319 |
+
"execution_count": null,
|
1320 |
+
"id": "2b512963",
|
1321 |
+
"metadata": {},
|
1322 |
+
"outputs": [],
|
1323 |
+
"source": [
|
1324 |
+
"model.included_fixations"
|
1325 |
+
]
|
1326 |
+
},
|
1327 |
+
{
|
1328 |
+
"cell_type": "code",
|
1329 |
+
"execution_count": null,
|
1330 |
+
"id": "33d6872d",
|
1331 |
+
"metadata": {},
|
1332 |
+
"outputs": [],
|
1333 |
+
"source": [
|
1334 |
+
"fixation_history_x"
|
1335 |
+
]
|
1336 |
+
},
|
1337 |
+
{
|
1338 |
+
"cell_type": "code",
|
1339 |
+
"execution_count": null,
|
1340 |
+
"id": "8bce1d25",
|
1341 |
+
"metadata": {},
|
1342 |
+
"outputs": [],
|
1343 |
+
"source": [
|
1344 |
+
"fixation_history_x[model.included_fixations]"
|
1345 |
+
]
|
1346 |
+
},
|
1347 |
+
{
|
1348 |
+
"cell_type": "code",
|
1349 |
+
"execution_count": null,
|
1350 |
+
"id": "751cb04e",
|
1351 |
+
"metadata": {},
|
1352 |
+
"outputs": [],
|
1353 |
+
"source": []
|
1354 |
+
},
|
1355 |
+
{
|
1356 |
+
"cell_type": "code",
|
1357 |
+
"execution_count": null,
|
1358 |
+
"id": "b3160caa",
|
1359 |
+
"metadata": {},
|
1360 |
+
"outputs": [],
|
1361 |
+
"source": [
|
1362 |
+
"import matplotlib.pyplot as plt\n",
|
1363 |
+
"import numpy as np\n",
|
1364 |
+
"from scipy.misc import face\n",
|
1365 |
+
"from scipy.ndimage import zoom\n",
|
1366 |
+
"from scipy.special import logsumexp\n",
|
1367 |
+
"import torch\n",
|
1368 |
+
"\n",
|
1369 |
+
"import deepgaze_pytorch\n",
|
1370 |
+
"\n",
|
1371 |
+
"DEVICE = 'cuda'\n",
|
1372 |
+
"\n",
|
1373 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
1374 |
+
"model = deepgaze_pytorch.DeepGazeIII(pretrained=True).to(DEVICE)\n",
|
1375 |
+
"\n",
|
1376 |
+
"#image = face()\n",
|
1377 |
+
"\n",
|
1378 |
+
"x = {}\n",
|
1379 |
+
"\n",
|
1380 |
+
"for i in range(len(imgs)):\n",
|
1381 |
+
" \n",
|
1382 |
+
" image = imgs[i]\n",
|
1383 |
+
" \n",
|
1384 |
+
" # location of previous scanpath fixations in x and y (pixel coordinates), starting with the initial fixation on the image.\n",
|
1385 |
+
" fixation_history_x = np.array([1024//2, 300, 500, 200, 200, 700])\n",
|
1386 |
+
" fixation_history_y = np.array([768//2, 300, 100, 300, 100, 500])\n",
|
1387 |
+
"\n",
|
1388 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
1389 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
1390 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
1391 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
1392 |
+
" # rescale to match image size\n",
|
1393 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
1394 |
+
" # renormalize log density\n",
|
1395 |
+
" centerbias -= logsumexp(centerbias)\n",
|
1396 |
+
"\n",
|
1397 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
1398 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
1399 |
+
" x_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
1400 |
+
" y_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
1401 |
+
"\n",
|
1402 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor, x_hist_tensor, y_hist_tensor)\n",
|
1403 |
+
"\n",
|
1404 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(8, 3))\n",
|
1405 |
+
" axs[0].imshow(image)\n",
|
1406 |
+
" axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1407 |
+
" axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1408 |
+
" axs[0].set_axis_off()\n",
|
1409 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
1410 |
+
" axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1411 |
+
" axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1412 |
+
" axs[1].set_axis_off()"
|
1413 |
+
]
|
1414 |
+
},
|
1415 |
+
{
|
1416 |
+
"cell_type": "code",
|
1417 |
+
"execution_count": null,
|
1418 |
+
"id": "aa2d7d4e",
|
1419 |
+
"metadata": {},
|
1420 |
+
"outputs": [],
|
1421 |
+
"source": []
|
1422 |
+
},
|
1423 |
+
{
|
1424 |
+
"cell_type": "code",
|
1425 |
+
"execution_count": null,
|
1426 |
+
"id": "274b461a",
|
1427 |
+
"metadata": {},
|
1428 |
+
"outputs": [],
|
1429 |
+
"source": []
|
1430 |
+
},
|
1431 |
+
{
|
1432 |
+
"cell_type": "code",
|
1433 |
+
"execution_count": null,
|
1434 |
+
"id": "f71d7915",
|
1435 |
+
"metadata": {},
|
1436 |
+
"outputs": [],
|
1437 |
+
"source": []
|
1438 |
+
},
|
1439 |
+
{
|
1440 |
+
"cell_type": "code",
|
1441 |
+
"execution_count": null,
|
1442 |
+
"id": "6c4adce6",
|
1443 |
+
"metadata": {},
|
1444 |
+
"outputs": [],
|
1445 |
+
"source": [
|
1446 |
+
"import numpy as np\n",
|
1447 |
+
"from scipy.misc import face\n",
|
1448 |
+
"from scipy.ndimage import zoom\n",
|
1449 |
+
"from scipy.special import logsumexp\n",
|
1450 |
+
"import torch\n",
|
1451 |
+
"import matplotlib.pyplot as plt\n",
|
1452 |
+
"\n",
|
1453 |
+
"import deepgaze_pytorch\n",
|
1454 |
+
"\n",
|
1455 |
+
"DEVICE = 'cuda'\n",
|
1456 |
+
"\n",
|
1457 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
1458 |
+
"model = deepgaze_pytorch.DeepGazeIIE(pretrained=True).to(DEVICE)\n",
|
1459 |
+
"\n",
|
1460 |
+
"# image = face()\n",
|
1461 |
+
"\n",
|
1462 |
+
"x = {}\n",
|
1463 |
+
"\n",
|
1464 |
+
"for i in range(len(imgs)):\n",
|
1465 |
+
" \n",
|
1466 |
+
" image = imgs[i]\n",
|
1467 |
+
" \n",
|
1468 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
1469 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
1470 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
1471 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
1472 |
+
" # rescale to match image size\n",
|
1473 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
1474 |
+
" # renormalize log density\n",
|
1475 |
+
" centerbias -= logsumexp(centerbias)\n",
|
1476 |
+
"\n",
|
1477 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
1478 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
1479 |
+
"\n",
|
1480 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor)\n",
|
1481 |
+
" \n",
|
1482 |
+
" a = log_density_prediction.detach().cpu().numpy()[0, 0]\n",
|
1483 |
+
" \n",
|
1484 |
+
" x[img_name[i].split('.')[0]] = a\n",
|
1485 |
+
" \n",
|
1486 |
+
" '''\n",
|
1487 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(16, 9))\n",
|
1488 |
+
" axs[0].imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))\n",
|
1489 |
+
" # axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1490 |
+
" # axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1491 |
+
" axs[0].set_axis_off()\n",
|
1492 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
1493 |
+
" # axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1494 |
+
" # axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1495 |
+
" axs[1].set_axis_off()\n",
|
1496 |
+
" # plt.savefig(os.path.join('DG2_heatmaps', '{0}.jpg'.format(i)))\n",
|
1497 |
+
" '''\n",
|
1498 |
+
" \n",
|
1499 |
+
" #break"
|
1500 |
+
]
|
1501 |
+
},
|
1502 |
+
{
|
1503 |
+
"cell_type": "code",
|
1504 |
+
"execution_count": null,
|
1505 |
+
"id": "d69ce384",
|
1506 |
+
"metadata": {},
|
1507 |
+
"outputs": [],
|
1508 |
+
"source": []
|
1509 |
+
},
|
1510 |
+
{
|
1511 |
+
"cell_type": "code",
|
1512 |
+
"execution_count": null,
|
1513 |
+
"id": "14d2b609",
|
1514 |
+
"metadata": {},
|
1515 |
+
"outputs": [],
|
1516 |
+
"source": []
|
1517 |
+
},
|
1518 |
+
{
|
1519 |
+
"cell_type": "code",
|
1520 |
+
"execution_count": null,
|
1521 |
+
"id": "80a068d8",
|
1522 |
+
"metadata": {},
|
1523 |
+
"outputs": [],
|
1524 |
+
"source": []
|
1525 |
+
},
|
1526 |
+
{
|
1527 |
+
"cell_type": "code",
|
1528 |
+
"execution_count": null,
|
1529 |
+
"id": "ceddabde",
|
1530 |
+
"metadata": {},
|
1531 |
+
"outputs": [],
|
1532 |
+
"source": []
|
1533 |
+
},
|
1534 |
+
{
|
1535 |
+
"cell_type": "code",
|
1536 |
+
"execution_count": null,
|
1537 |
+
"id": "c8207585",
|
1538 |
+
"metadata": {},
|
1539 |
+
"outputs": [],
|
1540 |
+
"source": []
|
1541 |
+
},
|
1542 |
+
{
|
1543 |
+
"cell_type": "code",
|
1544 |
+
"execution_count": null,
|
1545 |
+
"id": "984c0e9c",
|
1546 |
+
"metadata": {},
|
1547 |
+
"outputs": [],
|
1548 |
+
"source": []
|
1549 |
+
},
|
1550 |
+
{
|
1551 |
+
"cell_type": "code",
|
1552 |
+
"execution_count": null,
|
1553 |
+
"id": "7196ebb9",
|
1554 |
+
"metadata": {},
|
1555 |
+
"outputs": [],
|
1556 |
+
"source": []
|
1557 |
+
},
|
1558 |
+
{
|
1559 |
+
"cell_type": "code",
|
1560 |
+
"execution_count": null,
|
1561 |
+
"id": "dc722528",
|
1562 |
+
"metadata": {},
|
1563 |
+
"outputs": [],
|
1564 |
+
"source": []
|
1565 |
+
},
|
1566 |
+
{
|
1567 |
+
"cell_type": "code",
|
1568 |
+
"execution_count": null,
|
1569 |
+
"id": "20dd8746",
|
1570 |
+
"metadata": {},
|
1571 |
+
"outputs": [],
|
1572 |
+
"source": []
|
1573 |
+
}
|
1574 |
+
],
|
1575 |
+
"metadata": {
|
1576 |
+
"kernelspec": {
|
1577 |
+
"display_name": "Python 3",
|
1578 |
+
"language": "python",
|
1579 |
+
"name": "python3"
|
1580 |
+
},
|
1581 |
+
"language_info": {
|
1582 |
+
"codemirror_mode": {
|
1583 |
+
"name": "ipython",
|
1584 |
+
"version": 3
|
1585 |
+
},
|
1586 |
+
"file_extension": ".py",
|
1587 |
+
"mimetype": "text/x-python",
|
1588 |
+
"name": "python",
|
1589 |
+
"nbconvert_exporter": "python",
|
1590 |
+
"pygments_lexer": "ipython3",
|
1591 |
+
"version": "3.8.5"
|
1592 |
+
}
|
1593 |
+
},
|
1594 |
+
"nbformat": 4,
|
1595 |
+
"nbformat_minor": 5
|
1596 |
+
}
|
DeepGaze/.ipynb_checkpoints/dg2e_hg_inv-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/.ipynb_checkpoints/dg2e_hg_mask-checkpoint.ipynb
ADDED
@@ -0,0 +1,2106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"id": "2683899d",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [],
|
9 |
+
"source": [
|
10 |
+
"import numpy as np\n",
|
11 |
+
"from scipy.misc import face\n",
|
12 |
+
"from scipy.ndimage import zoom\n",
|
13 |
+
"from scipy.special import logsumexp\n",
|
14 |
+
"import torch\n",
|
15 |
+
"import matplotlib.pyplot as plt"
|
16 |
+
]
|
17 |
+
},
|
18 |
+
{
|
19 |
+
"cell_type": "code",
|
20 |
+
"execution_count": 2,
|
21 |
+
"id": "a9c8a9e7",
|
22 |
+
"metadata": {},
|
23 |
+
"outputs": [],
|
24 |
+
"source": [
|
25 |
+
"import scipy.io"
|
26 |
+
]
|
27 |
+
},
|
28 |
+
{
|
29 |
+
"cell_type": "code",
|
30 |
+
"execution_count": 3,
|
31 |
+
"id": "32bd8589",
|
32 |
+
"metadata": {
|
33 |
+
"scrolled": true
|
34 |
+
},
|
35 |
+
"outputs": [],
|
36 |
+
"source": [
|
37 |
+
"import cv2\n",
|
38 |
+
"import os\n",
|
39 |
+
"\n",
|
40 |
+
"def load_images_from_folder(folder):\n",
|
41 |
+
" images = []\n",
|
42 |
+
" img_name = []\n",
|
43 |
+
" for filename in os.listdir(folder):\n",
|
44 |
+
" img = cv2.imread(os.path.join(folder,filename))\n",
|
45 |
+
" if img is not None:\n",
|
46 |
+
" images.append(img)\n",
|
47 |
+
" img_name.append(filename)\n",
|
48 |
+
" return images, img_name"
|
49 |
+
]
|
50 |
+
},
|
51 |
+
{
|
52 |
+
"cell_type": "code",
|
53 |
+
"execution_count": 4,
|
54 |
+
"id": "c5ebf6a1",
|
55 |
+
"metadata": {},
|
56 |
+
"outputs": [],
|
57 |
+
"source": [
|
58 |
+
"imgs, img_name = load_images_from_folder('/home/pranjul/Bachelorarbeit Pareidolie/stimuli/Bilder Original/Bilder mit Maske/')\n"
|
59 |
+
]
|
60 |
+
},
|
61 |
+
{
|
62 |
+
"cell_type": "code",
|
63 |
+
"execution_count": 5,
|
64 |
+
"id": "571c8db2",
|
65 |
+
"metadata": {
|
66 |
+
"scrolled": true
|
67 |
+
},
|
68 |
+
"outputs": [
|
69 |
+
{
|
70 |
+
"data": {
|
71 |
+
"text/plain": [
|
72 |
+
"['95.png',\n",
|
73 |
+
" '85.png',\n",
|
74 |
+
" '91.jpg',\n",
|
75 |
+
" '75.png',\n",
|
76 |
+
" '2.jpg',\n",
|
77 |
+
" '70.png',\n",
|
78 |
+
" '22.jpg',\n",
|
79 |
+
" '122.png',\n",
|
80 |
+
" '128.jpg',\n",
|
81 |
+
" '117.jpg',\n",
|
82 |
+
" '147.jpg',\n",
|
83 |
+
" '11.jpg',\n",
|
84 |
+
" '151.jpg',\n",
|
85 |
+
" '36.jpg',\n",
|
86 |
+
" '17.jpg',\n",
|
87 |
+
" '97.png',\n",
|
88 |
+
" '139.jpg',\n",
|
89 |
+
" '74.png',\n",
|
90 |
+
" '82.png',\n",
|
91 |
+
" '152.jpg',\n",
|
92 |
+
" '60.png',\n",
|
93 |
+
" '27.jpg',\n",
|
94 |
+
" '49.png',\n",
|
95 |
+
" '103.png',\n",
|
96 |
+
" '44.jpg',\n",
|
97 |
+
" '111.jpg',\n",
|
98 |
+
" '76.png',\n",
|
99 |
+
" '78.png',\n",
|
100 |
+
" '146.jpg',\n",
|
101 |
+
" '98.png',\n",
|
102 |
+
" '48.jpg',\n",
|
103 |
+
" '81.png',\n",
|
104 |
+
" '38.jpg',\n",
|
105 |
+
" '57.png',\n",
|
106 |
+
" '141.jpg',\n",
|
107 |
+
" '106.png',\n",
|
108 |
+
" '66.png',\n",
|
109 |
+
" '67.png',\n",
|
110 |
+
" '25.jpg',\n",
|
111 |
+
" '149.jpg',\n",
|
112 |
+
" '121.png',\n",
|
113 |
+
" '150.jpg',\n",
|
114 |
+
" '148.jpg',\n",
|
115 |
+
" '42.jpg',\n",
|
116 |
+
" '127.jpg',\n",
|
117 |
+
" '132.jpg',\n",
|
118 |
+
" '157.jpg',\n",
|
119 |
+
" '112.jpg',\n",
|
120 |
+
" '102.png',\n",
|
121 |
+
" '154.jpg',\n",
|
122 |
+
" '84.png',\n",
|
123 |
+
" '80.png',\n",
|
124 |
+
" '119.png',\n",
|
125 |
+
" '159.jpg',\n",
|
126 |
+
" '125.png',\n",
|
127 |
+
" '89.png',\n",
|
128 |
+
" '123.png',\n",
|
129 |
+
" '21.jpg',\n",
|
130 |
+
" '58.png',\n",
|
131 |
+
" '50.png',\n",
|
132 |
+
" '3.jpg',\n",
|
133 |
+
" '30.jpg',\n",
|
134 |
+
" '108.jpg',\n",
|
135 |
+
" '131.jpg',\n",
|
136 |
+
" '113.jpg',\n",
|
137 |
+
" '55.png',\n",
|
138 |
+
" '64.png',\n",
|
139 |
+
" '156.jpg',\n",
|
140 |
+
" '72.png',\n",
|
141 |
+
" '39.jpg',\n",
|
142 |
+
" '79.png',\n",
|
143 |
+
" '133.jpg',\n",
|
144 |
+
" '144.jpg',\n",
|
145 |
+
" '110.jpg',\n",
|
146 |
+
" '145.jpg',\n",
|
147 |
+
" '7.jpg',\n",
|
148 |
+
" '35.jpg',\n",
|
149 |
+
" '56.png',\n",
|
150 |
+
" '116.jpg',\n",
|
151 |
+
" '126.jpg',\n",
|
152 |
+
" '109.jpg',\n",
|
153 |
+
" '137.jpg',\n",
|
154 |
+
" '69.png']"
|
155 |
+
]
|
156 |
+
},
|
157 |
+
"execution_count": 5,
|
158 |
+
"metadata": {},
|
159 |
+
"output_type": "execute_result"
|
160 |
+
}
|
161 |
+
],
|
162 |
+
"source": [
|
163 |
+
"img_name"
|
164 |
+
]
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"cell_type": "code",
|
168 |
+
"execution_count": null,
|
169 |
+
"id": "cd911d2d",
|
170 |
+
"metadata": {},
|
171 |
+
"outputs": [],
|
172 |
+
"source": []
|
173 |
+
},
|
174 |
+
{
|
175 |
+
"cell_type": "code",
|
176 |
+
"execution_count": 6,
|
177 |
+
"id": "e99e7121",
|
178 |
+
"metadata": {},
|
179 |
+
"outputs": [
|
180 |
+
{
|
181 |
+
"data": {
|
182 |
+
"text/plain": [
|
183 |
+
"83"
|
184 |
+
]
|
185 |
+
},
|
186 |
+
"execution_count": 6,
|
187 |
+
"metadata": {},
|
188 |
+
"output_type": "execute_result"
|
189 |
+
}
|
190 |
+
],
|
191 |
+
"source": [
|
192 |
+
"len(img_name)"
|
193 |
+
]
|
194 |
+
},
|
195 |
+
{
|
196 |
+
"cell_type": "code",
|
197 |
+
"execution_count": 7,
|
198 |
+
"id": "6e65c80b",
|
199 |
+
"metadata": {
|
200 |
+
"scrolled": false
|
201 |
+
},
|
202 |
+
"outputs": [
|
203 |
+
{
|
204 |
+
"data": {
|
205 |
+
"text/plain": [
|
206 |
+
"95"
|
207 |
+
]
|
208 |
+
},
|
209 |
+
"execution_count": 7,
|
210 |
+
"metadata": {},
|
211 |
+
"output_type": "execute_result"
|
212 |
+
}
|
213 |
+
],
|
214 |
+
"source": [
|
215 |
+
"int(img_name[0].split('.')[0])"
|
216 |
+
]
|
217 |
+
},
|
218 |
+
{
|
219 |
+
"cell_type": "code",
|
220 |
+
"execution_count": 11,
|
221 |
+
"id": "303e82af",
|
222 |
+
"metadata": {
|
223 |
+
"scrolled": false
|
224 |
+
},
|
225 |
+
"outputs": [
|
226 |
+
{
|
227 |
+
"data": {
|
228 |
+
"text/plain": [
|
229 |
+
"48"
|
230 |
+
]
|
231 |
+
},
|
232 |
+
"execution_count": 11,
|
233 |
+
"metadata": {},
|
234 |
+
"output_type": "execute_result"
|
235 |
+
}
|
236 |
+
],
|
237 |
+
"source": [
|
238 |
+
"len(scipy.io.loadmat('par_dur.mat')['par_dur'][0])"
|
239 |
+
]
|
240 |
+
},
|
241 |
+
{
|
242 |
+
"cell_type": "code",
|
243 |
+
"execution_count": 12,
|
244 |
+
"id": "9cfe473e",
|
245 |
+
"metadata": {},
|
246 |
+
"outputs": [
|
247 |
+
{
|
248 |
+
"data": {
|
249 |
+
"text/plain": [
|
250 |
+
"48"
|
251 |
+
]
|
252 |
+
},
|
253 |
+
"execution_count": 12,
|
254 |
+
"metadata": {},
|
255 |
+
"output_type": "execute_result"
|
256 |
+
}
|
257 |
+
],
|
258 |
+
"source": [
|
259 |
+
"len(scipy.io.loadmat('par_first_onset.mat')['par_first_onset'][0])"
|
260 |
+
]
|
261 |
+
},
|
262 |
+
{
|
263 |
+
"cell_type": "code",
|
264 |
+
"execution_count": null,
|
265 |
+
"id": "f5b41345",
|
266 |
+
"metadata": {},
|
267 |
+
"outputs": [],
|
268 |
+
"source": [
|
269 |
+
"scipy.io.loadmat('S02_fix/S02_face_1.mat')['currImData'][:,5]"
|
270 |
+
]
|
271 |
+
},
|
272 |
+
{
|
273 |
+
"cell_type": "code",
|
274 |
+
"execution_count": null,
|
275 |
+
"id": "e60e197d",
|
276 |
+
"metadata": {
|
277 |
+
"scrolled": true
|
278 |
+
},
|
279 |
+
"outputs": [],
|
280 |
+
"source": [
|
281 |
+
"scipy.io.loadmat('S02_fix/S02_pareidolia_64.mat')"
|
282 |
+
]
|
283 |
+
},
|
284 |
+
{
|
285 |
+
"cell_type": "code",
|
286 |
+
"execution_count": null,
|
287 |
+
"id": "a071e2e4",
|
288 |
+
"metadata": {},
|
289 |
+
"outputs": [],
|
290 |
+
"source": [
|
291 |
+
"for filename in os.listdir('S02_fix'):\n",
|
292 |
+
" print(filename)"
|
293 |
+
]
|
294 |
+
},
|
295 |
+
{
|
296 |
+
"cell_type": "code",
|
297 |
+
"execution_count": null,
|
298 |
+
"id": "0dc9ab34",
|
299 |
+
"metadata": {},
|
300 |
+
"outputs": [],
|
301 |
+
"source": [
|
302 |
+
"def load_fix_from_folder(folder):\n",
|
303 |
+
" fix_X = []\n",
|
304 |
+
" fix_Y = []\n",
|
305 |
+
" img_name = []\n",
|
306 |
+
" for filename in os.listdir(folder):\n",
|
307 |
+
" fix_X.append(scipy.io.loadmat(os.path.join(folder,filename))['currImData'][:,4])\n",
|
308 |
+
" fix_Y.append(scipy.io.loadmat(os.path.join(folder,filename))['currImData'][:,5])\n",
|
309 |
+
" img_name.append(str(scipy.io.loadmat(os.path.join(folder,filename))['currImName'][0][0]) + '.jpg')\n",
|
310 |
+
" #print(filename)\n",
|
311 |
+
" #print(img_name)\n",
|
312 |
+
" return fix_X, fix_Y, img_name"
|
313 |
+
]
|
314 |
+
},
|
315 |
+
{
|
316 |
+
"cell_type": "code",
|
317 |
+
"execution_count": null,
|
318 |
+
"id": "5ad3e153",
|
319 |
+
"metadata": {},
|
320 |
+
"outputs": [],
|
321 |
+
"source": [
|
322 |
+
"fix_X, fix_Y, img_name = load_fix_from_folder('S_fix/S13_fix')"
|
323 |
+
]
|
324 |
+
},
|
325 |
+
{
|
326 |
+
"cell_type": "code",
|
327 |
+
"execution_count": null,
|
328 |
+
"id": "43fc95a0",
|
329 |
+
"metadata": {
|
330 |
+
"scrolled": true
|
331 |
+
},
|
332 |
+
"outputs": [],
|
333 |
+
"source": [
|
334 |
+
"import glob\n",
|
335 |
+
"import os\n",
|
336 |
+
"\n",
|
337 |
+
"# Specify the directory containing the nested folder structure\n",
|
338 |
+
"root_dir = '/home/pranjul/DeepGaze/fix_stimuli/'\n",
|
339 |
+
"\n",
|
340 |
+
"# Specify the image file extensions you want to load\n",
|
341 |
+
"extensions = ['*.jpg', '*.jpeg', '*.png']\n",
|
342 |
+
"\n",
|
343 |
+
"# Create a list to store the image file paths\n",
|
344 |
+
"image_paths = []\n",
|
345 |
+
"\n",
|
346 |
+
"# Traverse through all subdirectories and search for image files\n",
|
347 |
+
"for extension in extensions:\n",
|
348 |
+
" search_pattern = os.path.join(root_dir, '**', extension)\n",
|
349 |
+
" image_paths.extend(glob.glob(search_pattern, recursive=True))\n",
|
350 |
+
"\n",
|
351 |
+
"# Print the paths of the loaded image files\n",
|
352 |
+
"for image_path in image_paths:\n",
|
353 |
+
" print(image_path)\n"
|
354 |
+
]
|
355 |
+
},
|
356 |
+
{
|
357 |
+
"cell_type": "code",
|
358 |
+
"execution_count": null,
|
359 |
+
"id": "864cb318",
|
360 |
+
"metadata": {},
|
361 |
+
"outputs": [],
|
362 |
+
"source": [
|
363 |
+
"import os\n",
|
364 |
+
"\n",
|
365 |
+
"def create_folder(folder_path):\n",
|
366 |
+
" try:\n",
|
367 |
+
" os.mkdir(folder_path)\n",
|
368 |
+
" print(f\"Folder '{folder_path}' created successfully.\")\n",
|
369 |
+
" except FileExistsError:\n",
|
370 |
+
" print(f\"Folder '{folder_path}' already exists.\")\n",
|
371 |
+
" except Exception as e:\n",
|
372 |
+
" print(f\"An error occurred: {e}\")"
|
373 |
+
]
|
374 |
+
},
|
375 |
+
{
|
376 |
+
"cell_type": "code",
|
377 |
+
"execution_count": null,
|
378 |
+
"id": "47b06581",
|
379 |
+
"metadata": {},
|
380 |
+
"outputs": [],
|
381 |
+
"source": [
|
382 |
+
"import os\n",
|
383 |
+
"\n",
|
384 |
+
"def folder_exists(folder_path):\n",
|
385 |
+
" return os.path.exists(folder_path) and os.path.isdir(folder_path)\n",
|
386 |
+
"\n"
|
387 |
+
]
|
388 |
+
},
|
389 |
+
{
|
390 |
+
"cell_type": "code",
|
391 |
+
"execution_count": null,
|
392 |
+
"id": "1d22fce3",
|
393 |
+
"metadata": {},
|
394 |
+
"outputs": [],
|
395 |
+
"source": [
|
396 |
+
"# Replace 'path/to/your/folder' with the folder path you want to check\n",
|
397 |
+
"folder_path = 'S_fix/S18_fix'\n",
|
398 |
+
"if folder_exists(folder_path):\n",
|
399 |
+
" print(f\"Folder '{folder_path}' exists.\")\n",
|
400 |
+
"else:\n",
|
401 |
+
" print(f\"Folder '{folder_path}' does not exist.\")\n"
|
402 |
+
]
|
403 |
+
},
|
404 |
+
{
|
405 |
+
"cell_type": "code",
|
406 |
+
"execution_count": null,
|
407 |
+
"id": "031c09c0",
|
408 |
+
"metadata": {},
|
409 |
+
"outputs": [],
|
410 |
+
"source": []
|
411 |
+
},
|
412 |
+
{
|
413 |
+
"cell_type": "code",
|
414 |
+
"execution_count": null,
|
415 |
+
"id": "30f2ed42",
|
416 |
+
"metadata": {
|
417 |
+
"scrolled": true
|
418 |
+
},
|
419 |
+
"outputs": [],
|
420 |
+
"source": [
|
421 |
+
"for f in range(13, 56):\n",
|
422 |
+
" print(f)\n",
|
423 |
+
" print('S_fix/S'+ str(f) +'_fix')"
|
424 |
+
]
|
425 |
+
},
|
426 |
+
{
|
427 |
+
"cell_type": "code",
|
428 |
+
"execution_count": null,
|
429 |
+
"id": "d5f1efd1",
|
430 |
+
"metadata": {
|
431 |
+
"scrolled": true
|
432 |
+
},
|
433 |
+
"outputs": [],
|
434 |
+
"source": [
|
435 |
+
"import matplotlib.pyplot as plt\n",
|
436 |
+
"import numpy as np\n",
|
437 |
+
"from scipy.misc import face\n",
|
438 |
+
"from scipy.ndimage import zoom\n",
|
439 |
+
"from scipy.special import logsumexp\n",
|
440 |
+
"import torch\n",
|
441 |
+
"\n",
|
442 |
+
"import deepgaze_pytorch\n",
|
443 |
+
"\n",
|
444 |
+
"DEVICE = 'cuda'\n",
|
445 |
+
"\n",
|
446 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
447 |
+
"model = deepgaze_pytorch.DeepGazeIII(pretrained=True).to(DEVICE)\n",
|
448 |
+
"\n",
|
449 |
+
"#image = face()\n",
|
450 |
+
"\n",
|
451 |
+
"x = {}\n",
|
452 |
+
"for q in range(1, 10):\n",
|
453 |
+
" \n",
|
454 |
+
" # Replace 'path/to/your/folder' with the folder path you want to check\n",
|
455 |
+
" folder_path = 'S_fix/S0'+ str(q) +'_fix'\n",
|
456 |
+
" if folder_exists(folder_path):\n",
|
457 |
+
" \n",
|
458 |
+
" fix_X, fix_Y, img_name = load_fix_from_folder('S_fix/S0'+ str(q) +'_fix')\n",
|
459 |
+
"\n",
|
460 |
+
" # Replace 'path/to/your/folder' with the desired folder path\n",
|
461 |
+
" folder_path = 'DG3_heatmaps/S0'+ str(q) +'_fix'\n",
|
462 |
+
" create_folder(folder_path)\n",
|
463 |
+
"\n",
|
464 |
+
"\n",
|
465 |
+
" for i in range(len(img_name)):\n",
|
466 |
+
"\n",
|
467 |
+
" image = cv2.imread('/home/pranjul/DeepGaze/fix_stimuli/' + img_name[i])\n",
|
468 |
+
"\n",
|
469 |
+
" if image is not None and len(fix_X[i]) > 3 and len(fix_Y[i] > 3):\n",
|
470 |
+
"\n",
|
471 |
+
" # location of previous scanpath fixations in x and y (pixel coordinates), starting with the initial fixation on the image.\n",
|
472 |
+
" #fixation_history_x = np.array([1024//2, 300, 500, 200, 200, 700])\n",
|
473 |
+
" #fixation_history_y = np.array([768//2, 300, 100, 300, 100, 500])\n",
|
474 |
+
"\n",
|
475 |
+
" #print(img_name[i])\n",
|
476 |
+
"\n",
|
477 |
+
" fixation_history_x = fix_X[i]/3\n",
|
478 |
+
" #print(fixation_history_x)\n",
|
479 |
+
" fixation_history_y = fix_Y[i]/3\n",
|
480 |
+
"\n",
|
481 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
482 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
483 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
484 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
485 |
+
" \n",
|
486 |
+
" # rescale to match image size\n",
|
487 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
488 |
+
" # renormalize log density\n",
|
489 |
+
" centerbias -= logsumexp(centerbias)\n",
|
490 |
+
"\n",
|
491 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
492 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
493 |
+
" x_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
494 |
+
" y_hist_tensor = torch.tensor([fixation_history_y[model.included_fixations]]).to(DEVICE)\n",
|
495 |
+
"\n",
|
496 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor, x_hist_tensor, y_hist_tensor)\n",
|
497 |
+
"\n",
|
498 |
+
" # Scale factor\n",
|
499 |
+
" #scale_factor = 3\n",
|
500 |
+
"\n",
|
501 |
+
" # Calculate the new width and height\n",
|
502 |
+
" #new_width = image.shape[1] * scale_factor\n",
|
503 |
+
" #new_height = image.shape[0] * scale_factor\n",
|
504 |
+
"\n",
|
505 |
+
" # Resize the image using cv2.resize()\n",
|
506 |
+
" #image = cv2.resize(image, (new_width, new_height))\n",
|
507 |
+
"\n",
|
508 |
+
" image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n",
|
509 |
+
"\n",
|
510 |
+
"\n",
|
511 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(16, 9))\n",
|
512 |
+
" axs[0].imshow(image)\n",
|
513 |
+
" #axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
514 |
+
" #axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
515 |
+
" axs[0].set_axis_off()\n",
|
516 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
517 |
+
" #axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
518 |
+
" #axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
519 |
+
" axs[1].set_axis_off()\n",
|
520 |
+
" plt.savefig(os.path.join('DG3_heatmaps/S0'+ str(q) +'_fix', img_name[i]))\n",
|
521 |
+
" plt.close()\n",
|
522 |
+
" #break\n",
|
523 |
+
" #break\n",
|
524 |
+
" #break"
|
525 |
+
]
|
526 |
+
},
|
527 |
+
{
|
528 |
+
"cell_type": "code",
|
529 |
+
"execution_count": null,
|
530 |
+
"id": "bb2809f0",
|
531 |
+
"metadata": {},
|
532 |
+
"outputs": [],
|
533 |
+
"source": []
|
534 |
+
},
|
535 |
+
{
|
536 |
+
"cell_type": "code",
|
537 |
+
"execution_count": null,
|
538 |
+
"id": "4a041477",
|
539 |
+
"metadata": {},
|
540 |
+
"outputs": [],
|
541 |
+
"source": []
|
542 |
+
},
|
543 |
+
{
|
544 |
+
"cell_type": "code",
|
545 |
+
"execution_count": null,
|
546 |
+
"id": "a0baeecb",
|
547 |
+
"metadata": {},
|
548 |
+
"outputs": [],
|
549 |
+
"source": []
|
550 |
+
},
|
551 |
+
{
|
552 |
+
"cell_type": "code",
|
553 |
+
"execution_count": null,
|
554 |
+
"id": "70e54f03",
|
555 |
+
"metadata": {},
|
556 |
+
"outputs": [],
|
557 |
+
"source": [
|
558 |
+
"len(fixation_history_y)"
|
559 |
+
]
|
560 |
+
},
|
561 |
+
{
|
562 |
+
"cell_type": "code",
|
563 |
+
"execution_count": null,
|
564 |
+
"id": "16ec0624",
|
565 |
+
"metadata": {},
|
566 |
+
"outputs": [],
|
567 |
+
"source": [
|
568 |
+
"i"
|
569 |
+
]
|
570 |
+
},
|
571 |
+
{
|
572 |
+
"cell_type": "code",
|
573 |
+
"execution_count": null,
|
574 |
+
"id": "964e517a",
|
575 |
+
"metadata": {},
|
576 |
+
"outputs": [],
|
577 |
+
"source": [
|
578 |
+
"S02_img_name[244]"
|
579 |
+
]
|
580 |
+
},
|
581 |
+
{
|
582 |
+
"cell_type": "code",
|
583 |
+
"execution_count": null,
|
584 |
+
"id": "67397109",
|
585 |
+
"metadata": {},
|
586 |
+
"outputs": [],
|
587 |
+
"source": [
|
588 |
+
"np.where(np.array(S02_img_name) == '44.jpg')"
|
589 |
+
]
|
590 |
+
},
|
591 |
+
{
|
592 |
+
"cell_type": "code",
|
593 |
+
"execution_count": null,
|
594 |
+
"id": "02cd8a6b",
|
595 |
+
"metadata": {},
|
596 |
+
"outputs": [],
|
597 |
+
"source": [
|
598 |
+
"indices = np.where(arr == 2)[0]"
|
599 |
+
]
|
600 |
+
},
|
601 |
+
{
|
602 |
+
"cell_type": "code",
|
603 |
+
"execution_count": null,
|
604 |
+
"id": "a64314eb",
|
605 |
+
"metadata": {},
|
606 |
+
"outputs": [],
|
607 |
+
"source": []
|
608 |
+
},
|
609 |
+
{
|
610 |
+
"cell_type": "code",
|
611 |
+
"execution_count": null,
|
612 |
+
"id": "09b449d7",
|
613 |
+
"metadata": {},
|
614 |
+
"outputs": [],
|
615 |
+
"source": []
|
616 |
+
},
|
617 |
+
{
|
618 |
+
"cell_type": "code",
|
619 |
+
"execution_count": null,
|
620 |
+
"id": "f2e3afae",
|
621 |
+
"metadata": {},
|
622 |
+
"outputs": [],
|
623 |
+
"source": []
|
624 |
+
},
|
625 |
+
{
|
626 |
+
"cell_type": "code",
|
627 |
+
"execution_count": null,
|
628 |
+
"id": "f8433595",
|
629 |
+
"metadata": {},
|
630 |
+
"outputs": [],
|
631 |
+
"source": []
|
632 |
+
},
|
633 |
+
{
|
634 |
+
"cell_type": "code",
|
635 |
+
"execution_count": null,
|
636 |
+
"id": "11bb0a30",
|
637 |
+
"metadata": {},
|
638 |
+
"outputs": [],
|
639 |
+
"source": []
|
640 |
+
},
|
641 |
+
{
|
642 |
+
"cell_type": "code",
|
643 |
+
"execution_count": null,
|
644 |
+
"id": "852d1d54",
|
645 |
+
"metadata": {},
|
646 |
+
"outputs": [],
|
647 |
+
"source": []
|
648 |
+
},
|
649 |
+
{
|
650 |
+
"cell_type": "code",
|
651 |
+
"execution_count": null,
|
652 |
+
"id": "45392af9",
|
653 |
+
"metadata": {},
|
654 |
+
"outputs": [],
|
655 |
+
"source": [
|
656 |
+
"img.shape"
|
657 |
+
]
|
658 |
+
},
|
659 |
+
{
|
660 |
+
"cell_type": "code",
|
661 |
+
"execution_count": null,
|
662 |
+
"id": "93a09086",
|
663 |
+
"metadata": {
|
664 |
+
"scrolled": true
|
665 |
+
},
|
666 |
+
"outputs": [],
|
667 |
+
"source": [
|
668 |
+
"import numpy as np\n",
|
669 |
+
"from scipy.misc import face\n",
|
670 |
+
"from scipy.ndimage import zoom\n",
|
671 |
+
"from scipy.special import logsumexp\n",
|
672 |
+
"import torch\n",
|
673 |
+
"import matplotlib.pyplot as plt\n",
|
674 |
+
"\n",
|
675 |
+
"import deepgaze_pytorch\n",
|
676 |
+
"\n",
|
677 |
+
"DEVICE = 'cuda'\n",
|
678 |
+
"\n",
|
679 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
680 |
+
"model = deepgaze_pytorch.DeepGazeI(pretrained=True).to(DEVICE)\n",
|
681 |
+
"\n",
|
682 |
+
"# image = face()\n",
|
683 |
+
"\n",
|
684 |
+
"x = {}\n",
|
685 |
+
"\n",
|
686 |
+
"for i in range(len(image_paths)):\n",
|
687 |
+
" print(i)\n",
|
688 |
+
" \n",
|
689 |
+
" image = cv2.imread(image_paths[i])\n",
|
690 |
+
" \n",
|
691 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
692 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
693 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
694 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
695 |
+
" # rescale to match image size\n",
|
696 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
697 |
+
" # renormalize log density\n",
|
698 |
+
" centerbias -= logsumexp(centerbias)\n",
|
699 |
+
"\n",
|
700 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
701 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
702 |
+
"\n",
|
703 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor)\n",
|
704 |
+
" \n",
|
705 |
+
" #a = log_density_prediction.detach().cpu().numpy()[0, 0]\n",
|
706 |
+
" \n",
|
707 |
+
" #x[img_name[i].split('.')[0]] = a\n",
|
708 |
+
" \n",
|
709 |
+
" \n",
|
710 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(16, 9))\n",
|
711 |
+
" axs[0].imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))\n",
|
712 |
+
" # axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
713 |
+
" # axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
714 |
+
" axs[0].set_axis_off()\n",
|
715 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
716 |
+
" # axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
717 |
+
" # axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
718 |
+
" axs[1].set_axis_off()\n",
|
719 |
+
" plt.savefig(os.path.join('DG2_modified_imgs_heatmaps', '{0}.jpg'.format(i)))\n",
|
720 |
+
" \n",
|
721 |
+
" \n",
|
722 |
+
" #break"
|
723 |
+
]
|
724 |
+
},
|
725 |
+
{
|
726 |
+
"cell_type": "code",
|
727 |
+
"execution_count": null,
|
728 |
+
"id": "3e4e709a",
|
729 |
+
"metadata": {},
|
730 |
+
"outputs": [],
|
731 |
+
"source": []
|
732 |
+
},
|
733 |
+
{
|
734 |
+
"cell_type": "code",
|
735 |
+
"execution_count": null,
|
736 |
+
"id": "2bd1220a",
|
737 |
+
"metadata": {},
|
738 |
+
"outputs": [],
|
739 |
+
"source": []
|
740 |
+
},
|
741 |
+
{
|
742 |
+
"cell_type": "code",
|
743 |
+
"execution_count": null,
|
744 |
+
"id": "60141a51",
|
745 |
+
"metadata": {},
|
746 |
+
"outputs": [],
|
747 |
+
"source": []
|
748 |
+
},
|
749 |
+
{
|
750 |
+
"cell_type": "code",
|
751 |
+
"execution_count": null,
|
752 |
+
"id": "d2f42e76",
|
753 |
+
"metadata": {
|
754 |
+
"scrolled": false
|
755 |
+
},
|
756 |
+
"outputs": [
|
757 |
+
{
|
758 |
+
"name": "stdout",
|
759 |
+
"output_type": "stream",
|
760 |
+
"text": [
|
761 |
+
"Loaded pretrained weights for efficientnet-b5\n"
|
762 |
+
]
|
763 |
+
},
|
764 |
+
{
|
765 |
+
"name": "stderr",
|
766 |
+
"output_type": "stream",
|
767 |
+
"text": [
|
768 |
+
"Using cache found in /home/pranjul/.cache/torch/hub/pytorch_vision_v0.6.0\n",
|
769 |
+
"Using cache found in /home/pranjul/.cache/torch/hub/pytorch_vision_v0.6.0\n"
|
770 |
+
]
|
771 |
+
}
|
772 |
+
],
|
773 |
+
"source": [
|
774 |
+
"import numpy as np\n",
|
775 |
+
"from scipy.misc import face\n",
|
776 |
+
"from scipy.ndimage import zoom\n",
|
777 |
+
"from scipy.special import logsumexp\n",
|
778 |
+
"import torch\n",
|
779 |
+
"import matplotlib.pyplot as plt\n",
|
780 |
+
"\n",
|
781 |
+
"import deepgaze_pytorch\n",
|
782 |
+
"\n",
|
783 |
+
"DEVICE = 'cuda'\n",
|
784 |
+
"\n",
|
785 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
786 |
+
"model = deepgaze_pytorch.DeepGazeIIE(pretrained=True).to(DEVICE)\n",
|
787 |
+
"\n",
|
788 |
+
"# image = face()\n",
|
789 |
+
"\n",
|
790 |
+
"x = {}\n",
|
791 |
+
"\n",
|
792 |
+
"for i in range(len(imgs)):\n",
|
793 |
+
" \n",
|
794 |
+
" image = imgs[i]\n",
|
795 |
+
" \n",
|
796 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
797 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
798 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
799 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
800 |
+
" # centerbias_template = np.zeros((1024, 1024))\n",
|
801 |
+
" # rescale to match image size\n",
|
802 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
803 |
+
" # renormalize log density\n",
|
804 |
+
" centerbias -= logsumexp(centerbias)\n",
|
805 |
+
"\n",
|
806 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
807 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
808 |
+
"\n",
|
809 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor)\n",
|
810 |
+
" \n",
|
811 |
+
" a = log_density_prediction.detach().cpu().numpy()[0,0]\n",
|
812 |
+
" \n",
|
813 |
+
" x[img_name[i].split('.')[0]] = a\n",
|
814 |
+
" \n",
|
815 |
+
" \n",
|
816 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(16, 9))\n",
|
817 |
+
" axs[0].imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))\n",
|
818 |
+
" # axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
819 |
+
" # axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
820 |
+
" axs[0].set_axis_off()\n",
|
821 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
822 |
+
" # axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
823 |
+
" # axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
824 |
+
" axs[1].set_axis_off()\n",
|
825 |
+
" plt.savefig(os.path.join('DG2_heatmaps_mask', '{0}.jpg'.format(i)))\n",
|
826 |
+
" plt.close()\n",
|
827 |
+
" \n",
|
828 |
+
" #break"
|
829 |
+
]
|
830 |
+
},
|
831 |
+
{
|
832 |
+
"cell_type": "code",
|
833 |
+
"execution_count": null,
|
834 |
+
"id": "f5db452d",
|
835 |
+
"metadata": {},
|
836 |
+
"outputs": [],
|
837 |
+
"source": []
|
838 |
+
},
|
839 |
+
{
|
840 |
+
"cell_type": "code",
|
841 |
+
"execution_count": null,
|
842 |
+
"id": "83bf9be6",
|
843 |
+
"metadata": {},
|
844 |
+
"outputs": [],
|
845 |
+
"source": []
|
846 |
+
},
|
847 |
+
{
|
848 |
+
"cell_type": "code",
|
849 |
+
"execution_count": null,
|
850 |
+
"id": "26527272",
|
851 |
+
"metadata": {},
|
852 |
+
"outputs": [],
|
853 |
+
"source": [
|
854 |
+
"import glob\n",
|
855 |
+
"from scipy.io import loadmat\n",
|
856 |
+
"from scipy.stats import pearsonr, spearmanr\n",
|
857 |
+
"from sklearn.preprocessing import MinMaxScaler\n",
|
858 |
+
"\n",
|
859 |
+
"scaler = MinMaxScaler()"
|
860 |
+
]
|
861 |
+
},
|
862 |
+
{
|
863 |
+
"cell_type": "code",
|
864 |
+
"execution_count": null,
|
865 |
+
"id": "3938f5cb",
|
866 |
+
"metadata": {},
|
867 |
+
"outputs": [],
|
868 |
+
"source": [
|
869 |
+
"\n",
|
870 |
+
"y_faces = {}\n",
|
871 |
+
"\n",
|
872 |
+
"for filename in glob.glob('/home/pranjul/DeepGaze/heatmaps/faces/*.mat'): #assuming gif\n",
|
873 |
+
" \n",
|
874 |
+
" fn=loadmat(filename)\n",
|
875 |
+
" y_faces[filename.split('/')[-1].split('.')[0]] = fn\n",
|
876 |
+
" #break"
|
877 |
+
]
|
878 |
+
},
|
879 |
+
{
|
880 |
+
"cell_type": "code",
|
881 |
+
"execution_count": null,
|
882 |
+
"id": "c5902106",
|
883 |
+
"metadata": {},
|
884 |
+
"outputs": [],
|
885 |
+
"source": [
|
886 |
+
"\n",
|
887 |
+
"y_objects = {}\n",
|
888 |
+
"\n",
|
889 |
+
"for filename in glob.glob('/home/pranjul/DeepGaze/heatmaps/objects/*.mat'): #assuming gif\n",
|
890 |
+
" \n",
|
891 |
+
" fn=loadmat(filename)\n",
|
892 |
+
" y_objects[filename.split('/')[-1].split('.')[0]] = fn\n",
|
893 |
+
" #break"
|
894 |
+
]
|
895 |
+
},
|
896 |
+
{
|
897 |
+
"cell_type": "code",
|
898 |
+
"execution_count": null,
|
899 |
+
"id": "e6fa7c47",
|
900 |
+
"metadata": {},
|
901 |
+
"outputs": [],
|
902 |
+
"source": [
|
903 |
+
"\n",
|
904 |
+
"y_pareidolia = {}\n",
|
905 |
+
"\n",
|
906 |
+
"for filename in glob.glob('/home/pranjul/DeepGaze/heatmaps/pareidolia/*.mat'): #assuming gif\n",
|
907 |
+
" \n",
|
908 |
+
" fn=loadmat(filename)\n",
|
909 |
+
" y_pareidolia[filename.split('/')[-1].split('.')[0]] = fn\n",
|
910 |
+
" #break"
|
911 |
+
]
|
912 |
+
},
|
913 |
+
{
|
914 |
+
"cell_type": "code",
|
915 |
+
"execution_count": null,
|
916 |
+
"id": "90d31035",
|
917 |
+
"metadata": {},
|
918 |
+
"outputs": [],
|
919 |
+
"source": [
|
920 |
+
"y_pareidolia['2']['a']"
|
921 |
+
]
|
922 |
+
},
|
923 |
+
{
|
924 |
+
"cell_type": "code",
|
925 |
+
"execution_count": null,
|
926 |
+
"id": "c416a753",
|
927 |
+
"metadata": {},
|
928 |
+
"outputs": [],
|
929 |
+
"source": [
|
930 |
+
"plt.imshow(y_pareidolia['2']['a'])\n",
|
931 |
+
"plt.axis('off')\n",
|
932 |
+
"plt.tight_layout()\n",
|
933 |
+
"plt.savefig('HG_mars_face.png', dpi=600)"
|
934 |
+
]
|
935 |
+
},
|
936 |
+
{
|
937 |
+
"cell_type": "code",
|
938 |
+
"execution_count": null,
|
939 |
+
"id": "f0a6bda6",
|
940 |
+
"metadata": {},
|
941 |
+
"outputs": [],
|
942 |
+
"source": []
|
943 |
+
},
|
944 |
+
{
|
945 |
+
"cell_type": "code",
|
946 |
+
"execution_count": null,
|
947 |
+
"id": "a2166932",
|
948 |
+
"metadata": {
|
949 |
+
"scrolled": true
|
950 |
+
},
|
951 |
+
"outputs": [],
|
952 |
+
"source": [
|
953 |
+
"dg_faces = []\n",
|
954 |
+
"eg_faces = []\n",
|
955 |
+
"ke = []\n",
|
956 |
+
"correlation_coef_faces = []\n",
|
957 |
+
"\n",
|
958 |
+
"for k in x:\n",
|
959 |
+
" if k in y_faces:\n",
|
960 |
+
" print(k)\n",
|
961 |
+
" ke.append(k)\n",
|
962 |
+
" #print(np.shape(x[k]))\n",
|
963 |
+
" #print(y_faces[k])\n",
|
964 |
+
" #dg_faces.append(scaler.fit_transform(np.array(x[k])).flatten())\n",
|
965 |
+
" #eg_faces.append(scaler.fit_transform(np.array(y_faces[k]['a'])).flatten())\n",
|
966 |
+
" correlation_coef_faces.append(spearmanr(np.array(x[k]).flatten(),\n",
|
967 |
+
" np.array(y_faces[k]['a']).flatten())[0])\n",
|
968 |
+
" #correlation_coef = spearmanr(np.array(dg_faces).flatten(), np.array(eg_faces).flatten())\n",
|
969 |
+
"\n",
|
970 |
+
" #break\n",
|
971 |
+
"\n",
|
972 |
+
"#spearmanr(scaler.fit_transform(cv2.resize(x['1397'], (800, 600))).flatten(), scaler.fit_transform(y_faces['1397']['a']).flatten())[0]\n",
|
973 |
+
"\n",
|
974 |
+
" \n",
|
975 |
+
"# correlation_coef, p_value = spearmanr(np.array(dg_faces).flatten(), np.array(eg_faces).flatten())\n",
|
976 |
+
"# correlation_coef = np.corrcoef(np.array(dg_faces).flatten(), np.array(eg_faces).flatten())\n",
|
977 |
+
"# print(\"Correlation coefficient:\", correlation_coef)\n",
|
978 |
+
"# print(\"p-value:\", p_value)"
|
979 |
+
]
|
980 |
+
},
|
981 |
+
{
|
982 |
+
"cell_type": "code",
|
983 |
+
"execution_count": null,
|
984 |
+
"id": "c0881d58",
|
985 |
+
"metadata": {
|
986 |
+
"scrolled": true
|
987 |
+
},
|
988 |
+
"outputs": [],
|
989 |
+
"source": [
|
990 |
+
"correlation_coef_faces"
|
991 |
+
]
|
992 |
+
},
|
993 |
+
{
|
994 |
+
"cell_type": "code",
|
995 |
+
"execution_count": null,
|
996 |
+
"id": "723cc7fe",
|
997 |
+
"metadata": {},
|
998 |
+
"outputs": [],
|
999 |
+
"source": [
|
1000 |
+
"np.mean(correlation_coef_faces)"
|
1001 |
+
]
|
1002 |
+
},
|
1003 |
+
{
|
1004 |
+
"cell_type": "code",
|
1005 |
+
"execution_count": null,
|
1006 |
+
"id": "52e9c3ac",
|
1007 |
+
"metadata": {},
|
1008 |
+
"outputs": [],
|
1009 |
+
"source": [
|
1010 |
+
"np.std(correlation_coef_faces)"
|
1011 |
+
]
|
1012 |
+
},
|
1013 |
+
{
|
1014 |
+
"cell_type": "code",
|
1015 |
+
"execution_count": null,
|
1016 |
+
"id": "c187f3a1",
|
1017 |
+
"metadata": {
|
1018 |
+
"scrolled": true
|
1019 |
+
},
|
1020 |
+
"outputs": [],
|
1021 |
+
"source": [
|
1022 |
+
"plt.plot(correlation_coef_faces, 'o')"
|
1023 |
+
]
|
1024 |
+
},
|
1025 |
+
{
|
1026 |
+
"cell_type": "code",
|
1027 |
+
"execution_count": null,
|
1028 |
+
"id": "3ae14f24",
|
1029 |
+
"metadata": {},
|
1030 |
+
"outputs": [],
|
1031 |
+
"source": []
|
1032 |
+
},
|
1033 |
+
{
|
1034 |
+
"cell_type": "code",
|
1035 |
+
"execution_count": null,
|
1036 |
+
"id": "5e8ad2bb",
|
1037 |
+
"metadata": {},
|
1038 |
+
"outputs": [],
|
1039 |
+
"source": []
|
1040 |
+
},
|
1041 |
+
{
|
1042 |
+
"cell_type": "code",
|
1043 |
+
"execution_count": null,
|
1044 |
+
"id": "70a4ecfb",
|
1045 |
+
"metadata": {
|
1046 |
+
"scrolled": true
|
1047 |
+
},
|
1048 |
+
"outputs": [],
|
1049 |
+
"source": [
|
1050 |
+
"len(correlation_coef_faces)"
|
1051 |
+
]
|
1052 |
+
},
|
1053 |
+
{
|
1054 |
+
"cell_type": "code",
|
1055 |
+
"execution_count": null,
|
1056 |
+
"id": "77266844",
|
1057 |
+
"metadata": {
|
1058 |
+
"scrolled": true
|
1059 |
+
},
|
1060 |
+
"outputs": [],
|
1061 |
+
"source": [
|
1062 |
+
"dg_objects = []\n",
|
1063 |
+
"eg_objects = []\n",
|
1064 |
+
"ke = []\n",
|
1065 |
+
"correlation_coef_objects = []\n",
|
1066 |
+
"\n",
|
1067 |
+
"for k in x:\n",
|
1068 |
+
" if k in y_objects:\n",
|
1069 |
+
" print(k)\n",
|
1070 |
+
" ke.append(k)\n",
|
1071 |
+
" #print(np.shape(x[k]))\n",
|
1072 |
+
" #print(y_faces[k])\n",
|
1073 |
+
" #dg_objects.append(np.array(x[k]).flatten())\n",
|
1074 |
+
" #eg_objects.append(np.array(y_objects[k]['a']).flatten())\n",
|
1075 |
+
" correlation_coef_objects.append(spearmanr(np.array(x[k]).flatten(), np.array(y_objects[k]['a']).flatten())[0])\n",
|
1076 |
+
"\n",
|
1077 |
+
" #break\n",
|
1078 |
+
"\n",
|
1079 |
+
"#correlation_coef, p_value = spearmanr(np.array(dg_objects).flatten(), np.array(eg_objects).flatten())\n",
|
1080 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1081 |
+
"# print(\"Correlation coefficient:\", correlation_coef)\n",
|
1082 |
+
"# print(\"p-value:\", p_value)"
|
1083 |
+
]
|
1084 |
+
},
|
1085 |
+
{
|
1086 |
+
"cell_type": "code",
|
1087 |
+
"execution_count": null,
|
1088 |
+
"id": "d5f30f29",
|
1089 |
+
"metadata": {},
|
1090 |
+
"outputs": [],
|
1091 |
+
"source": []
|
1092 |
+
},
|
1093 |
+
{
|
1094 |
+
"cell_type": "code",
|
1095 |
+
"execution_count": null,
|
1096 |
+
"id": "df8da20e",
|
1097 |
+
"metadata": {},
|
1098 |
+
"outputs": [],
|
1099 |
+
"source": [
|
1100 |
+
"np.mean(correlation_coef_objects)"
|
1101 |
+
]
|
1102 |
+
},
|
1103 |
+
{
|
1104 |
+
"cell_type": "code",
|
1105 |
+
"execution_count": null,
|
1106 |
+
"id": "f4c9834d",
|
1107 |
+
"metadata": {
|
1108 |
+
"scrolled": true
|
1109 |
+
},
|
1110 |
+
"outputs": [],
|
1111 |
+
"source": [
|
1112 |
+
"np.std(correlation_coef_objects)"
|
1113 |
+
]
|
1114 |
+
},
|
1115 |
+
{
|
1116 |
+
"cell_type": "code",
|
1117 |
+
"execution_count": null,
|
1118 |
+
"id": "9465aa0e",
|
1119 |
+
"metadata": {},
|
1120 |
+
"outputs": [],
|
1121 |
+
"source": [
|
1122 |
+
"plt.plot(correlation_coef_objects, 'o')"
|
1123 |
+
]
|
1124 |
+
},
|
1125 |
+
{
|
1126 |
+
"cell_type": "code",
|
1127 |
+
"execution_count": null,
|
1128 |
+
"id": "beb428b2",
|
1129 |
+
"metadata": {
|
1130 |
+
"scrolled": true
|
1131 |
+
},
|
1132 |
+
"outputs": [],
|
1133 |
+
"source": [
|
1134 |
+
"correlation_coef_objects"
|
1135 |
+
]
|
1136 |
+
},
|
1137 |
+
{
|
1138 |
+
"cell_type": "code",
|
1139 |
+
"execution_count": null,
|
1140 |
+
"id": "802ebc6d",
|
1141 |
+
"metadata": {},
|
1142 |
+
"outputs": [],
|
1143 |
+
"source": [
|
1144 |
+
"len(correlation_coef_objects)"
|
1145 |
+
]
|
1146 |
+
},
|
1147 |
+
{
|
1148 |
+
"cell_type": "code",
|
1149 |
+
"execution_count": null,
|
1150 |
+
"id": "0403de67",
|
1151 |
+
"metadata": {
|
1152 |
+
"scrolled": true
|
1153 |
+
},
|
1154 |
+
"outputs": [],
|
1155 |
+
"source": [
|
1156 |
+
"dg_pareidolia = []\n",
|
1157 |
+
"eg_pareidolia = []\n",
|
1158 |
+
"ke = []\n",
|
1159 |
+
"correlation_coef_pareidolia = []\n",
|
1160 |
+
"\n",
|
1161 |
+
"for k in x:\n",
|
1162 |
+
" if k in y_pareidolia:\n",
|
1163 |
+
" print(k)\n",
|
1164 |
+
" ke.append(k)\n",
|
1165 |
+
" # print(np.shape(x[k]))\n",
|
1166 |
+
" # print(y_faces[k])\n",
|
1167 |
+
" # dg_pareidolia.append(scaler.fit_transform(np.array(x[k])).flatten())\n",
|
1168 |
+
" # eg_pareidolia.append(scaler.fit_transform(np.array(y_pareidolia[k]['a'])).flatten())\n",
|
1169 |
+
" correlation_coef_pareidolia.append(spearmanr(np.array(x[k]).flatten(), \n",
|
1170 |
+
" np.array(y_pareidolia[k]['a']).flatten())[0])\n",
|
1171 |
+
" \n",
|
1172 |
+
" #break\n",
|
1173 |
+
"\n",
|
1174 |
+
"# correlation_coef, p_value = spearmanr(np.array(dg_pareidolia).flatten(), np.array(eg_pareidolia).flatten())\n",
|
1175 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1176 |
+
"# print(\"Correlation coefficient:\", correlation_coef)\n",
|
1177 |
+
"# print(\"p-value:\", p_value)"
|
1178 |
+
]
|
1179 |
+
},
|
1180 |
+
{
|
1181 |
+
"cell_type": "code",
|
1182 |
+
"execution_count": null,
|
1183 |
+
"id": "14e6d358",
|
1184 |
+
"metadata": {},
|
1185 |
+
"outputs": [],
|
1186 |
+
"source": [
|
1187 |
+
"np.mean(correlation_coef_pareidolia)"
|
1188 |
+
]
|
1189 |
+
},
|
1190 |
+
{
|
1191 |
+
"cell_type": "code",
|
1192 |
+
"execution_count": null,
|
1193 |
+
"id": "30812b76",
|
1194 |
+
"metadata": {},
|
1195 |
+
"outputs": [],
|
1196 |
+
"source": [
|
1197 |
+
"np.std(correlation_coef_pareidolia)"
|
1198 |
+
]
|
1199 |
+
},
|
1200 |
+
{
|
1201 |
+
"cell_type": "code",
|
1202 |
+
"execution_count": null,
|
1203 |
+
"id": "ab74cd89",
|
1204 |
+
"metadata": {},
|
1205 |
+
"outputs": [],
|
1206 |
+
"source": [
|
1207 |
+
"plt.plot(correlation_coef_pareidolia, 'o')"
|
1208 |
+
]
|
1209 |
+
},
|
1210 |
+
{
|
1211 |
+
"cell_type": "code",
|
1212 |
+
"execution_count": null,
|
1213 |
+
"id": "c4980b11",
|
1214 |
+
"metadata": {},
|
1215 |
+
"outputs": [],
|
1216 |
+
"source": [
|
1217 |
+
"len(correlation_coef_pareidolia)"
|
1218 |
+
]
|
1219 |
+
},
|
1220 |
+
{
|
1221 |
+
"cell_type": "code",
|
1222 |
+
"execution_count": null,
|
1223 |
+
"id": "10f01cdd",
|
1224 |
+
"metadata": {},
|
1225 |
+
"outputs": [],
|
1226 |
+
"source": []
|
1227 |
+
},
|
1228 |
+
{
|
1229 |
+
"cell_type": "code",
|
1230 |
+
"execution_count": null,
|
1231 |
+
"id": "98aa156c",
|
1232 |
+
"metadata": {
|
1233 |
+
"scrolled": false
|
1234 |
+
},
|
1235 |
+
"outputs": [],
|
1236 |
+
"source": [
|
1237 |
+
"import pandas as pd\n",
|
1238 |
+
"\n",
|
1239 |
+
"# Sample data with different lengths\n",
|
1240 |
+
"#correlation_coef_faces = [0.5, 0.6, 0.7]\n",
|
1241 |
+
"#correlation_coef_objects = [0.3, 0.4]\n",
|
1242 |
+
"#correlation_coef_pareidolia = [0.2, 0.3, 0.1, 0.4]\n",
|
1243 |
+
"\n",
|
1244 |
+
"# Create a DataFrame with a common index\n",
|
1245 |
+
"index = range(max(len(correlation_coef_faces), len(correlation_coef_objects), len(correlation_coef_pareidolia)))\n",
|
1246 |
+
"\n",
|
1247 |
+
"data = {\n",
|
1248 |
+
" 'sr_f': correlation_coef_faces + [None] * (len(index) - len(correlation_coef_faces)),\n",
|
1249 |
+
" 'sr_o': correlation_coef_objects + [None] * (len(index) - len(correlation_coef_objects)),\n",
|
1250 |
+
" 'sr_p': correlation_coef_pareidolia + [None] * (len(index) - len(correlation_coef_pareidolia))\n",
|
1251 |
+
"}\n",
|
1252 |
+
"\n",
|
1253 |
+
"df = pd.DataFrame(data, index=index)\n",
|
1254 |
+
"\n",
|
1255 |
+
"# Specify the file name\n",
|
1256 |
+
"csv_file = 'data.csv'\n",
|
1257 |
+
"\n",
|
1258 |
+
"# Save DataFrame to CSV file\n",
|
1259 |
+
"df.to_csv(csv_file)\n",
|
1260 |
+
"\n",
|
1261 |
+
"print(f'Data saved to {csv_file}')\n"
|
1262 |
+
]
|
1263 |
+
},
|
1264 |
+
{
|
1265 |
+
"cell_type": "code",
|
1266 |
+
"execution_count": null,
|
1267 |
+
"id": "37692ab8",
|
1268 |
+
"metadata": {},
|
1269 |
+
"outputs": [],
|
1270 |
+
"source": [
|
1271 |
+
"import csv\n",
|
1272 |
+
"\n",
|
1273 |
+
"# Sample data\n",
|
1274 |
+
"data = [\n",
|
1275 |
+
" ['Name', 'Age', 'City'],\n",
|
1276 |
+
" ['Alice', 28, 'New York'],\n",
|
1277 |
+
" ['Bob', 35, 'Los Angeles'],\n",
|
1278 |
+
" ['Charlie', 22, 'Chicago']\n",
|
1279 |
+
"]\n",
|
1280 |
+
"\n",
|
1281 |
+
"# Specify the file name\n",
|
1282 |
+
"csv_file = 'data.csv'\n",
|
1283 |
+
"\n",
|
1284 |
+
"# Write data to CSV file\n",
|
1285 |
+
"with open(csv_file, mode='w', newline='') as file:\n",
|
1286 |
+
" writer = csv.writer(file)\n",
|
1287 |
+
" writer.writerows(data)\n",
|
1288 |
+
"\n",
|
1289 |
+
"print(f'Data saved to {csv_file}')\n"
|
1290 |
+
]
|
1291 |
+
},
|
1292 |
+
{
|
1293 |
+
"cell_type": "code",
|
1294 |
+
"execution_count": null,
|
1295 |
+
"id": "f8816fcc",
|
1296 |
+
"metadata": {},
|
1297 |
+
"outputs": [],
|
1298 |
+
"source": []
|
1299 |
+
},
|
1300 |
+
{
|
1301 |
+
"cell_type": "code",
|
1302 |
+
"execution_count": null,
|
1303 |
+
"id": "1d73414c",
|
1304 |
+
"metadata": {},
|
1305 |
+
"outputs": [],
|
1306 |
+
"source": []
|
1307 |
+
},
|
1308 |
+
{
|
1309 |
+
"cell_type": "code",
|
1310 |
+
"execution_count": null,
|
1311 |
+
"id": "0e53bda0",
|
1312 |
+
"metadata": {},
|
1313 |
+
"outputs": [],
|
1314 |
+
"source": []
|
1315 |
+
},
|
1316 |
+
{
|
1317 |
+
"cell_type": "code",
|
1318 |
+
"execution_count": null,
|
1319 |
+
"id": "7fe39537",
|
1320 |
+
"metadata": {},
|
1321 |
+
"outputs": [],
|
1322 |
+
"source": []
|
1323 |
+
},
|
1324 |
+
{
|
1325 |
+
"cell_type": "code",
|
1326 |
+
"execution_count": null,
|
1327 |
+
"id": "6a51040d",
|
1328 |
+
"metadata": {},
|
1329 |
+
"outputs": [],
|
1330 |
+
"source": []
|
1331 |
+
},
|
1332 |
+
{
|
1333 |
+
"cell_type": "code",
|
1334 |
+
"execution_count": null,
|
1335 |
+
"id": "89a93508",
|
1336 |
+
"metadata": {},
|
1337 |
+
"outputs": [],
|
1338 |
+
"source": []
|
1339 |
+
},
|
1340 |
+
{
|
1341 |
+
"cell_type": "code",
|
1342 |
+
"execution_count": null,
|
1343 |
+
"id": "c297d11a",
|
1344 |
+
"metadata": {},
|
1345 |
+
"outputs": [],
|
1346 |
+
"source": [
|
1347 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_faces).flatten(), np.array(eg_faces).flatten())\n",
|
1348 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1349 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1350 |
+
"print(\"p-value:\", p_value)"
|
1351 |
+
]
|
1352 |
+
},
|
1353 |
+
{
|
1354 |
+
"cell_type": "code",
|
1355 |
+
"execution_count": null,
|
1356 |
+
"id": "85e5edb2",
|
1357 |
+
"metadata": {},
|
1358 |
+
"outputs": [],
|
1359 |
+
"source": [
|
1360 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_objects).flatten(), np.array(eg_objects).flatten())\n",
|
1361 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1362 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1363 |
+
"print(\"p-value:\", p_value)"
|
1364 |
+
]
|
1365 |
+
},
|
1366 |
+
{
|
1367 |
+
"cell_type": "code",
|
1368 |
+
"execution_count": null,
|
1369 |
+
"id": "d99c7309",
|
1370 |
+
"metadata": {},
|
1371 |
+
"outputs": [],
|
1372 |
+
"source": [
|
1373 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_pareidolia).flatten(), np.array(eg_pareidolia).flatten())\n",
|
1374 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1375 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1376 |
+
"print(\"p-value:\", p_value)"
|
1377 |
+
]
|
1378 |
+
},
|
1379 |
+
{
|
1380 |
+
"cell_type": "code",
|
1381 |
+
"execution_count": null,
|
1382 |
+
"id": "e9702314",
|
1383 |
+
"metadata": {},
|
1384 |
+
"outputs": [],
|
1385 |
+
"source": [
|
1386 |
+
"len(dg_pareidolia)"
|
1387 |
+
]
|
1388 |
+
},
|
1389 |
+
{
|
1390 |
+
"cell_type": "code",
|
1391 |
+
"execution_count": null,
|
1392 |
+
"id": "c319f00b",
|
1393 |
+
"metadata": {},
|
1394 |
+
"outputs": [],
|
1395 |
+
"source": [
|
1396 |
+
"len(dg_faces[:83])"
|
1397 |
+
]
|
1398 |
+
},
|
1399 |
+
{
|
1400 |
+
"cell_type": "code",
|
1401 |
+
"execution_count": null,
|
1402 |
+
"id": "1fa45e93",
|
1403 |
+
"metadata": {},
|
1404 |
+
"outputs": [],
|
1405 |
+
"source": [
|
1406 |
+
"len(dg_objects[:83])"
|
1407 |
+
]
|
1408 |
+
},
|
1409 |
+
{
|
1410 |
+
"cell_type": "code",
|
1411 |
+
"execution_count": null,
|
1412 |
+
"id": "5e9fd2b6",
|
1413 |
+
"metadata": {},
|
1414 |
+
"outputs": [],
|
1415 |
+
"source": [
|
1416 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_faces[:83]).flatten(), np.array(dg_objects[:83]).flatten())\n",
|
1417 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1418 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1419 |
+
"print(\"p-value:\", p_value)"
|
1420 |
+
]
|
1421 |
+
},
|
1422 |
+
{
|
1423 |
+
"cell_type": "code",
|
1424 |
+
"execution_count": null,
|
1425 |
+
"id": "a9357f4f",
|
1426 |
+
"metadata": {},
|
1427 |
+
"outputs": [],
|
1428 |
+
"source": [
|
1429 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_faces[:83]).flatten(), np.array(dg_pareidolia[:83]).flatten())\n",
|
1430 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1431 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1432 |
+
"print(\"p-value:\", p_value)"
|
1433 |
+
]
|
1434 |
+
},
|
1435 |
+
{
|
1436 |
+
"cell_type": "code",
|
1437 |
+
"execution_count": null,
|
1438 |
+
"id": "f70021f3",
|
1439 |
+
"metadata": {},
|
1440 |
+
"outputs": [],
|
1441 |
+
"source": [
|
1442 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_pareidolia[:83]).flatten(), np.array(dg_objects[:83]).flatten())\n",
|
1443 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1444 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1445 |
+
"print(\"p-value:\", p_value)"
|
1446 |
+
]
|
1447 |
+
},
|
1448 |
+
{
|
1449 |
+
"cell_type": "code",
|
1450 |
+
"execution_count": null,
|
1451 |
+
"id": "0df004a4",
|
1452 |
+
"metadata": {},
|
1453 |
+
"outputs": [],
|
1454 |
+
"source": [
|
1455 |
+
"correlation_coef, p_value = spearmanr(np.array(eg_pareidolia[:83]).flatten(), np.array(eg_objects[:83]).flatten())\n",
|
1456 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1457 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1458 |
+
"print(\"p-value:\", p_value)"
|
1459 |
+
]
|
1460 |
+
},
|
1461 |
+
{
|
1462 |
+
"cell_type": "code",
|
1463 |
+
"execution_count": null,
|
1464 |
+
"id": "1742ecb1",
|
1465 |
+
"metadata": {},
|
1466 |
+
"outputs": [],
|
1467 |
+
"source": [
|
1468 |
+
"correlation_coef, p_value = spearmanr(np.array(eg_pareidolia[:83]).flatten(), np.array(eg_faces[:83]).flatten())\n",
|
1469 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1470 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1471 |
+
"print(\"p-value:\", p_value)"
|
1472 |
+
]
|
1473 |
+
},
|
1474 |
+
{
|
1475 |
+
"cell_type": "code",
|
1476 |
+
"execution_count": null,
|
1477 |
+
"id": "0a02bf88",
|
1478 |
+
"metadata": {},
|
1479 |
+
"outputs": [],
|
1480 |
+
"source": [
|
1481 |
+
"correlation_coef, p_value = spearmanr(np.array(eg_faces[:83]).flatten(), np.array(eg_objects[:83]).flatten())\n",
|
1482 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1483 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1484 |
+
"print(\"p-value:\", p_value)"
|
1485 |
+
]
|
1486 |
+
},
|
1487 |
+
{
|
1488 |
+
"cell_type": "code",
|
1489 |
+
"execution_count": null,
|
1490 |
+
"id": "b7ccd13e",
|
1491 |
+
"metadata": {},
|
1492 |
+
"outputs": [],
|
1493 |
+
"source": []
|
1494 |
+
},
|
1495 |
+
{
|
1496 |
+
"cell_type": "code",
|
1497 |
+
"execution_count": null,
|
1498 |
+
"id": "fdeb2fc5",
|
1499 |
+
"metadata": {},
|
1500 |
+
"outputs": [],
|
1501 |
+
"source": []
|
1502 |
+
},
|
1503 |
+
{
|
1504 |
+
"cell_type": "code",
|
1505 |
+
"execution_count": null,
|
1506 |
+
"id": "7faa17c1",
|
1507 |
+
"metadata": {},
|
1508 |
+
"outputs": [],
|
1509 |
+
"source": []
|
1510 |
+
},
|
1511 |
+
{
|
1512 |
+
"cell_type": "code",
|
1513 |
+
"execution_count": null,
|
1514 |
+
"id": "f9af3d41",
|
1515 |
+
"metadata": {},
|
1516 |
+
"outputs": [],
|
1517 |
+
"source": [
|
1518 |
+
"import numpy as np\n",
|
1519 |
+
"from scipy.stats import spearmanr\n",
|
1520 |
+
"\n",
|
1521 |
+
"# Generate two arrays with random data\n",
|
1522 |
+
"array1 = np.random.rand(100)\n",
|
1523 |
+
"array2 = np.random.rand(100)\n",
|
1524 |
+
"\n",
|
1525 |
+
"# Calculate Spearman's correlation coefficient and p-value\n",
|
1526 |
+
"correlation, p_value = spearmanr(array1, array2)\n",
|
1527 |
+
"\n",
|
1528 |
+
"print(\"Spearman's correlation coefficient:\", correlation)\n",
|
1529 |
+
"print(\"p-value:\", p_value)\n"
|
1530 |
+
]
|
1531 |
+
},
|
1532 |
+
{
|
1533 |
+
"cell_type": "code",
|
1534 |
+
"execution_count": null,
|
1535 |
+
"id": "f7cd0d61",
|
1536 |
+
"metadata": {},
|
1537 |
+
"outputs": [],
|
1538 |
+
"source": []
|
1539 |
+
},
|
1540 |
+
{
|
1541 |
+
"cell_type": "code",
|
1542 |
+
"execution_count": null,
|
1543 |
+
"id": "3570f454",
|
1544 |
+
"metadata": {},
|
1545 |
+
"outputs": [],
|
1546 |
+
"source": []
|
1547 |
+
},
|
1548 |
+
{
|
1549 |
+
"cell_type": "code",
|
1550 |
+
"execution_count": null,
|
1551 |
+
"id": "3a0a92be",
|
1552 |
+
"metadata": {},
|
1553 |
+
"outputs": [],
|
1554 |
+
"source": [
|
1555 |
+
"import numpy as np\n",
|
1556 |
+
"from scipy.stats import pearsonr\n",
|
1557 |
+
"\n",
|
1558 |
+
"# define two eye gaze heatmaps\n",
|
1559 |
+
"heatmap1 = np.array([[0.2, 0.3, 0.1],\n",
|
1560 |
+
" [0.1, 0.4, 0.3],\n",
|
1561 |
+
" [0.3, 0.2, 0.1]])\n",
|
1562 |
+
"\n",
|
1563 |
+
"heatmap2 = np.array([[0.1, 0.2, 0.3],\n",
|
1564 |
+
" [0.2, 0.3, 0.2],\n",
|
1565 |
+
" [0.3, 0.1, 0.1]])\n",
|
1566 |
+
"\n",
|
1567 |
+
"# flatten the heatmaps into 1D arrays\n",
|
1568 |
+
"flat_heatmap1 = heatmap1.flatten()\n",
|
1569 |
+
"flat_heatmap2 = heatmap2.flatten()\n",
|
1570 |
+
"\n",
|
1571 |
+
"# calculate the Pearson correlation coefficient and p-value\n",
|
1572 |
+
"corr, p_value = pearsonr(flat_heatmap1, flat_heatmap2)\n",
|
1573 |
+
"\n",
|
1574 |
+
"print(\"Correlation coefficient:\", corr)\n",
|
1575 |
+
"print(\"p-value:\", p_value)\n"
|
1576 |
+
]
|
1577 |
+
},
|
1578 |
+
{
|
1579 |
+
"cell_type": "code",
|
1580 |
+
"execution_count": null,
|
1581 |
+
"id": "98a8e3c1",
|
1582 |
+
"metadata": {},
|
1583 |
+
"outputs": [],
|
1584 |
+
"source": [
|
1585 |
+
"np.shape(b)"
|
1586 |
+
]
|
1587 |
+
},
|
1588 |
+
{
|
1589 |
+
"cell_type": "code",
|
1590 |
+
"execution_count": null,
|
1591 |
+
"id": "55b352bd",
|
1592 |
+
"metadata": {},
|
1593 |
+
"outputs": [],
|
1594 |
+
"source": [
|
1595 |
+
"np.shape(a)"
|
1596 |
+
]
|
1597 |
+
},
|
1598 |
+
{
|
1599 |
+
"cell_type": "code",
|
1600 |
+
"execution_count": null,
|
1601 |
+
"id": "3fe648aa",
|
1602 |
+
"metadata": {},
|
1603 |
+
"outputs": [],
|
1604 |
+
"source": [
|
1605 |
+
"np.shape(correlation_coef)"
|
1606 |
+
]
|
1607 |
+
},
|
1608 |
+
{
|
1609 |
+
"cell_type": "code",
|
1610 |
+
"execution_count": null,
|
1611 |
+
"id": "cd8e091b",
|
1612 |
+
"metadata": {},
|
1613 |
+
"outputs": [],
|
1614 |
+
"source": [
|
1615 |
+
"plt.imshow(correlation_coef)"
|
1616 |
+
]
|
1617 |
+
},
|
1618 |
+
{
|
1619 |
+
"cell_type": "code",
|
1620 |
+
"execution_count": null,
|
1621 |
+
"id": "884bf73a",
|
1622 |
+
"metadata": {},
|
1623 |
+
"outputs": [],
|
1624 |
+
"source": [
|
1625 |
+
"correlation_coef[83:, :83]"
|
1626 |
+
]
|
1627 |
+
},
|
1628 |
+
{
|
1629 |
+
"cell_type": "code",
|
1630 |
+
"execution_count": null,
|
1631 |
+
"id": "4a540fa9",
|
1632 |
+
"metadata": {
|
1633 |
+
"scrolled": true
|
1634 |
+
},
|
1635 |
+
"outputs": [],
|
1636 |
+
"source": [
|
1637 |
+
"plt.imshow(correlation_coef[83:, :83])"
|
1638 |
+
]
|
1639 |
+
},
|
1640 |
+
{
|
1641 |
+
"cell_type": "code",
|
1642 |
+
"execution_count": null,
|
1643 |
+
"id": "62cadea8",
|
1644 |
+
"metadata": {},
|
1645 |
+
"outputs": [],
|
1646 |
+
"source": [
|
1647 |
+
"plt.plot(np.diagonal(correlation_coef[100:, :100]), 'o') #faces"
|
1648 |
+
]
|
1649 |
+
},
|
1650 |
+
{
|
1651 |
+
"cell_type": "code",
|
1652 |
+
"execution_count": null,
|
1653 |
+
"id": "f05bd895",
|
1654 |
+
"metadata": {},
|
1655 |
+
"outputs": [],
|
1656 |
+
"source": [
|
1657 |
+
"np.mean(np.diagonal(correlation_coef[100:, :100]))"
|
1658 |
+
]
|
1659 |
+
},
|
1660 |
+
{
|
1661 |
+
"cell_type": "code",
|
1662 |
+
"execution_count": null,
|
1663 |
+
"id": "6e227007",
|
1664 |
+
"metadata": {},
|
1665 |
+
"outputs": [],
|
1666 |
+
"source": [
|
1667 |
+
"plt.plot(np.diagonal(correlation_coef[100:, :100]), 'o') #obj"
|
1668 |
+
]
|
1669 |
+
},
|
1670 |
+
{
|
1671 |
+
"cell_type": "code",
|
1672 |
+
"execution_count": null,
|
1673 |
+
"id": "12ed25e7",
|
1674 |
+
"metadata": {},
|
1675 |
+
"outputs": [],
|
1676 |
+
"source": [
|
1677 |
+
"np.mean(np.diagonal(correlation_coef[86:, :86]))"
|
1678 |
+
]
|
1679 |
+
},
|
1680 |
+
{
|
1681 |
+
"cell_type": "code",
|
1682 |
+
"execution_count": null,
|
1683 |
+
"id": "ccf0a569",
|
1684 |
+
"metadata": {},
|
1685 |
+
"outputs": [],
|
1686 |
+
"source": [
|
1687 |
+
"plt.plot(np.diagonal(correlation_coef[83:, :83]), 'o') #pare"
|
1688 |
+
]
|
1689 |
+
},
|
1690 |
+
{
|
1691 |
+
"cell_type": "code",
|
1692 |
+
"execution_count": null,
|
1693 |
+
"id": "923ed911",
|
1694 |
+
"metadata": {},
|
1695 |
+
"outputs": [],
|
1696 |
+
"source": [
|
1697 |
+
"np.mean(np.diagonal(correlation_coef[83:, :83]))"
|
1698 |
+
]
|
1699 |
+
},
|
1700 |
+
{
|
1701 |
+
"cell_type": "code",
|
1702 |
+
"execution_count": null,
|
1703 |
+
"id": "27bac165",
|
1704 |
+
"metadata": {},
|
1705 |
+
"outputs": [],
|
1706 |
+
"source": []
|
1707 |
+
},
|
1708 |
+
{
|
1709 |
+
"cell_type": "code",
|
1710 |
+
"execution_count": null,
|
1711 |
+
"id": "f751bc29",
|
1712 |
+
"metadata": {},
|
1713 |
+
"outputs": [],
|
1714 |
+
"source": [
|
1715 |
+
"plt.imshow(y_objects['1153']['a'])"
|
1716 |
+
]
|
1717 |
+
},
|
1718 |
+
{
|
1719 |
+
"cell_type": "code",
|
1720 |
+
"execution_count": null,
|
1721 |
+
"id": "0c6a4bb4",
|
1722 |
+
"metadata": {},
|
1723 |
+
"outputs": [],
|
1724 |
+
"source": [
|
1725 |
+
"y_faces"
|
1726 |
+
]
|
1727 |
+
},
|
1728 |
+
{
|
1729 |
+
"cell_type": "code",
|
1730 |
+
"execution_count": null,
|
1731 |
+
"id": "40a93053",
|
1732 |
+
"metadata": {},
|
1733 |
+
"outputs": [],
|
1734 |
+
"source": []
|
1735 |
+
},
|
1736 |
+
{
|
1737 |
+
"cell_type": "code",
|
1738 |
+
"execution_count": null,
|
1739 |
+
"id": "4a9b5849",
|
1740 |
+
"metadata": {},
|
1741 |
+
"outputs": [],
|
1742 |
+
"source": []
|
1743 |
+
},
|
1744 |
+
{
|
1745 |
+
"cell_type": "code",
|
1746 |
+
"execution_count": null,
|
1747 |
+
"id": "76eee42b",
|
1748 |
+
"metadata": {},
|
1749 |
+
"outputs": [],
|
1750 |
+
"source": [
|
1751 |
+
"np.shape(imgs)"
|
1752 |
+
]
|
1753 |
+
},
|
1754 |
+
{
|
1755 |
+
"cell_type": "code",
|
1756 |
+
"execution_count": null,
|
1757 |
+
"id": "1cc44e0e",
|
1758 |
+
"metadata": {},
|
1759 |
+
"outputs": [],
|
1760 |
+
"source": []
|
1761 |
+
},
|
1762 |
+
{
|
1763 |
+
"cell_type": "code",
|
1764 |
+
"execution_count": null,
|
1765 |
+
"id": "1d14b8ad",
|
1766 |
+
"metadata": {},
|
1767 |
+
"outputs": [],
|
1768 |
+
"source": []
|
1769 |
+
},
|
1770 |
+
{
|
1771 |
+
"cell_type": "code",
|
1772 |
+
"execution_count": null,
|
1773 |
+
"id": "feddeb52",
|
1774 |
+
"metadata": {},
|
1775 |
+
"outputs": [],
|
1776 |
+
"source": [
|
1777 |
+
"import matplotlib.pyplot as plt\n",
|
1778 |
+
"import numpy as np\n",
|
1779 |
+
"from scipy.misc import face\n",
|
1780 |
+
"from scipy.ndimage import zoom\n",
|
1781 |
+
"from scipy.special import logsumexp\n",
|
1782 |
+
"import torch\n",
|
1783 |
+
"\n",
|
1784 |
+
"import deepgaze_pytorch\n",
|
1785 |
+
"\n",
|
1786 |
+
"DEVICE = 'cuda'\n",
|
1787 |
+
"\n",
|
1788 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
1789 |
+
"model = deepgaze_pytorch.DeepGazeIII(pretrained=True).to(DEVICE)\n",
|
1790 |
+
"\n",
|
1791 |
+
"image = face()\n",
|
1792 |
+
"\n",
|
1793 |
+
"# location of previous scanpath fixations in x and y (pixel coordinates), starting with the initial fixation on the image.\n",
|
1794 |
+
"fixation_history_x = np.array([1024//2, 300, 500, 200, 200, 700])\n",
|
1795 |
+
"fixation_history_y = np.array([768//2, 300, 100, 300, 100, 500])\n",
|
1796 |
+
"\n",
|
1797 |
+
"# load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
1798 |
+
"# you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
1799 |
+
"# alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
1800 |
+
"centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
1801 |
+
"# rescale to match image size\n",
|
1802 |
+
"centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
1803 |
+
"# renormalize log density\n",
|
1804 |
+
"centerbias -= logsumexp(centerbias)\n",
|
1805 |
+
"\n",
|
1806 |
+
"image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
1807 |
+
"centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
1808 |
+
"x_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
1809 |
+
"y_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
1810 |
+
"\n",
|
1811 |
+
"log_density_prediction = model(image_tensor, centerbias_tensor, x_hist_tensor, y_hist_tensor)\n",
|
1812 |
+
"\n",
|
1813 |
+
"f, axs = plt.subplots(nrows=1, ncols=2, figsize=(8, 3))\n",
|
1814 |
+
"axs[0].imshow(image)\n",
|
1815 |
+
"axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1816 |
+
"axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1817 |
+
"axs[0].set_axis_off()\n",
|
1818 |
+
"axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
1819 |
+
"axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1820 |
+
"axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1821 |
+
"axs[1].set_axis_off()"
|
1822 |
+
]
|
1823 |
+
},
|
1824 |
+
{
|
1825 |
+
"cell_type": "code",
|
1826 |
+
"execution_count": null,
|
1827 |
+
"id": "2b512963",
|
1828 |
+
"metadata": {},
|
1829 |
+
"outputs": [],
|
1830 |
+
"source": [
|
1831 |
+
"model.included_fixations"
|
1832 |
+
]
|
1833 |
+
},
|
1834 |
+
{
|
1835 |
+
"cell_type": "code",
|
1836 |
+
"execution_count": null,
|
1837 |
+
"id": "33d6872d",
|
1838 |
+
"metadata": {},
|
1839 |
+
"outputs": [],
|
1840 |
+
"source": [
|
1841 |
+
"fixation_history_x"
|
1842 |
+
]
|
1843 |
+
},
|
1844 |
+
{
|
1845 |
+
"cell_type": "code",
|
1846 |
+
"execution_count": null,
|
1847 |
+
"id": "8bce1d25",
|
1848 |
+
"metadata": {},
|
1849 |
+
"outputs": [],
|
1850 |
+
"source": [
|
1851 |
+
"fixation_history_x[model.included_fixations]"
|
1852 |
+
]
|
1853 |
+
},
|
1854 |
+
{
|
1855 |
+
"cell_type": "code",
|
1856 |
+
"execution_count": null,
|
1857 |
+
"id": "751cb04e",
|
1858 |
+
"metadata": {},
|
1859 |
+
"outputs": [],
|
1860 |
+
"source": []
|
1861 |
+
},
|
1862 |
+
{
|
1863 |
+
"cell_type": "code",
|
1864 |
+
"execution_count": null,
|
1865 |
+
"id": "b3160caa",
|
1866 |
+
"metadata": {},
|
1867 |
+
"outputs": [],
|
1868 |
+
"source": [
|
1869 |
+
"import matplotlib.pyplot as plt\n",
|
1870 |
+
"import numpy as np\n",
|
1871 |
+
"from scipy.misc import face\n",
|
1872 |
+
"from scipy.ndimage import zoom\n",
|
1873 |
+
"from scipy.special import logsumexp\n",
|
1874 |
+
"import torch\n",
|
1875 |
+
"\n",
|
1876 |
+
"import deepgaze_pytorch\n",
|
1877 |
+
"\n",
|
1878 |
+
"DEVICE = 'cuda'\n",
|
1879 |
+
"\n",
|
1880 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
1881 |
+
"model = deepgaze_pytorch.DeepGazeIII(pretrained=True).to(DEVICE)\n",
|
1882 |
+
"\n",
|
1883 |
+
"#image = face()\n",
|
1884 |
+
"\n",
|
1885 |
+
"x = {}\n",
|
1886 |
+
"\n",
|
1887 |
+
"for i in range(len(imgs)):\n",
|
1888 |
+
" \n",
|
1889 |
+
" image = imgs[i]\n",
|
1890 |
+
" \n",
|
1891 |
+
" # location of previous scanpath fixations in x and y (pixel coordinates), starting with the initial fixation on the image.\n",
|
1892 |
+
" fixation_history_x = np.array([1024//2, 300, 500, 200, 200, 700])\n",
|
1893 |
+
" fixation_history_y = np.array([768//2, 300, 100, 300, 100, 500])\n",
|
1894 |
+
"\n",
|
1895 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
1896 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
1897 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
1898 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
1899 |
+
" # rescale to match image size\n",
|
1900 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
1901 |
+
" # renormalize log density\n",
|
1902 |
+
" centerbias -= logsumexp(centerbias)\n",
|
1903 |
+
"\n",
|
1904 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
1905 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
1906 |
+
" x_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
1907 |
+
" y_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
1908 |
+
"\n",
|
1909 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor, x_hist_tensor, y_hist_tensor)\n",
|
1910 |
+
"\n",
|
1911 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(8, 3))\n",
|
1912 |
+
" axs[0].imshow(image)\n",
|
1913 |
+
" axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1914 |
+
" axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1915 |
+
" axs[0].set_axis_off()\n",
|
1916 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
1917 |
+
" axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1918 |
+
" axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1919 |
+
" axs[1].set_axis_off()"
|
1920 |
+
]
|
1921 |
+
},
|
1922 |
+
{
|
1923 |
+
"cell_type": "code",
|
1924 |
+
"execution_count": null,
|
1925 |
+
"id": "aa2d7d4e",
|
1926 |
+
"metadata": {},
|
1927 |
+
"outputs": [],
|
1928 |
+
"source": []
|
1929 |
+
},
|
1930 |
+
{
|
1931 |
+
"cell_type": "code",
|
1932 |
+
"execution_count": null,
|
1933 |
+
"id": "274b461a",
|
1934 |
+
"metadata": {},
|
1935 |
+
"outputs": [],
|
1936 |
+
"source": []
|
1937 |
+
},
|
1938 |
+
{
|
1939 |
+
"cell_type": "code",
|
1940 |
+
"execution_count": null,
|
1941 |
+
"id": "f71d7915",
|
1942 |
+
"metadata": {},
|
1943 |
+
"outputs": [],
|
1944 |
+
"source": []
|
1945 |
+
},
|
1946 |
+
{
|
1947 |
+
"cell_type": "code",
|
1948 |
+
"execution_count": null,
|
1949 |
+
"id": "6c4adce6",
|
1950 |
+
"metadata": {},
|
1951 |
+
"outputs": [],
|
1952 |
+
"source": [
|
1953 |
+
"import numpy as np\n",
|
1954 |
+
"from scipy.misc import face\n",
|
1955 |
+
"from scipy.ndimage import zoom\n",
|
1956 |
+
"from scipy.special import logsumexp\n",
|
1957 |
+
"import torch\n",
|
1958 |
+
"import matplotlib.pyplot as plt\n",
|
1959 |
+
"\n",
|
1960 |
+
"import deepgaze_pytorch\n",
|
1961 |
+
"\n",
|
1962 |
+
"DEVICE = 'cuda'\n",
|
1963 |
+
"\n",
|
1964 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
1965 |
+
"model = deepgaze_pytorch.DeepGazeIIE(pretrained=True).to(DEVICE)\n",
|
1966 |
+
"\n",
|
1967 |
+
"# image = face()\n",
|
1968 |
+
"\n",
|
1969 |
+
"x = {}\n",
|
1970 |
+
"\n",
|
1971 |
+
"for i in range(len(imgs)):\n",
|
1972 |
+
" \n",
|
1973 |
+
" image = imgs[i]\n",
|
1974 |
+
" \n",
|
1975 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
1976 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
1977 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
1978 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
1979 |
+
" # rescale to match image size\n",
|
1980 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
1981 |
+
" # renormalize log density\n",
|
1982 |
+
" centerbias -= logsumexp(centerbias)\n",
|
1983 |
+
"\n",
|
1984 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
1985 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
1986 |
+
"\n",
|
1987 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor)\n",
|
1988 |
+
" \n",
|
1989 |
+
" a = log_density_prediction.detach().cpu().numpy()[0, 0]\n",
|
1990 |
+
" \n",
|
1991 |
+
" x[img_name[i].split('.')[0]] = a\n",
|
1992 |
+
" \n",
|
1993 |
+
" '''\n",
|
1994 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(16, 9))\n",
|
1995 |
+
" axs[0].imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))\n",
|
1996 |
+
" # axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1997 |
+
" # axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1998 |
+
" axs[0].set_axis_off()\n",
|
1999 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
2000 |
+
" # axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
2001 |
+
" # axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
2002 |
+
" axs[1].set_axis_off()\n",
|
2003 |
+
" # plt.savefig(os.path.join('DG2_heatmaps', '{0}.jpg'.format(i)))\n",
|
2004 |
+
" '''\n",
|
2005 |
+
" \n",
|
2006 |
+
" #break"
|
2007 |
+
]
|
2008 |
+
},
|
2009 |
+
{
|
2010 |
+
"cell_type": "code",
|
2011 |
+
"execution_count": null,
|
2012 |
+
"id": "eca95def",
|
2013 |
+
"metadata": {},
|
2014 |
+
"outputs": [],
|
2015 |
+
"source": [
|
2016 |
+
"image"
|
2017 |
+
]
|
2018 |
+
},
|
2019 |
+
{
|
2020 |
+
"cell_type": "code",
|
2021 |
+
"execution_count": null,
|
2022 |
+
"id": "d69ce384",
|
2023 |
+
"metadata": {},
|
2024 |
+
"outputs": [],
|
2025 |
+
"source": [
|
2026 |
+
"import matplotlib.pyplot as plt\n",
|
2027 |
+
"import numpy as np\n",
|
2028 |
+
"from scipy.misc import face\n",
|
2029 |
+
"from scipy.ndimage import zoom\n",
|
2030 |
+
"from scipy.special import logsumexp\n",
|
2031 |
+
"import torch\n",
|
2032 |
+
"\n",
|
2033 |
+
"import deepgaze_pytorch\n",
|
2034 |
+
"\n",
|
2035 |
+
"DEVICE = 'cuda'\n",
|
2036 |
+
"\n",
|
2037 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
2038 |
+
"model = deepgaze_pytorch.DeepGazeI(pretrained=True).to(DEVICE)"
|
2039 |
+
]
|
2040 |
+
},
|
2041 |
+
{
|
2042 |
+
"cell_type": "code",
|
2043 |
+
"execution_count": null,
|
2044 |
+
"id": "c8207585",
|
2045 |
+
"metadata": {},
|
2046 |
+
"outputs": [],
|
2047 |
+
"source": []
|
2048 |
+
},
|
2049 |
+
{
|
2050 |
+
"cell_type": "code",
|
2051 |
+
"execution_count": null,
|
2052 |
+
"id": "b9d406ff",
|
2053 |
+
"metadata": {
|
2054 |
+
"scrolled": true
|
2055 |
+
},
|
2056 |
+
"outputs": [],
|
2057 |
+
"source": [
|
2058 |
+
"%%capture captured_output\n",
|
2059 |
+
"# Your code here\n",
|
2060 |
+
"print(model)"
|
2061 |
+
]
|
2062 |
+
},
|
2063 |
+
{
|
2064 |
+
"cell_type": "code",
|
2065 |
+
"execution_count": null,
|
2066 |
+
"id": "984c0e9c",
|
2067 |
+
"metadata": {
|
2068 |
+
"scrolled": true
|
2069 |
+
},
|
2070 |
+
"outputs": [],
|
2071 |
+
"source": [
|
2072 |
+
"with open(\"DG1_arch.txt\", \"w\") as f:\n",
|
2073 |
+
" f.write(captured_output.stdout)\n"
|
2074 |
+
]
|
2075 |
+
},
|
2076 |
+
{
|
2077 |
+
"cell_type": "code",
|
2078 |
+
"execution_count": null,
|
2079 |
+
"id": "6d170109",
|
2080 |
+
"metadata": {},
|
2081 |
+
"outputs": [],
|
2082 |
+
"source": []
|
2083 |
+
}
|
2084 |
+
],
|
2085 |
+
"metadata": {
|
2086 |
+
"kernelspec": {
|
2087 |
+
"display_name": "Python 3",
|
2088 |
+
"language": "python",
|
2089 |
+
"name": "python3"
|
2090 |
+
},
|
2091 |
+
"language_info": {
|
2092 |
+
"codemirror_mode": {
|
2093 |
+
"name": "ipython",
|
2094 |
+
"version": 3
|
2095 |
+
},
|
2096 |
+
"file_extension": ".py",
|
2097 |
+
"mimetype": "text/x-python",
|
2098 |
+
"name": "python",
|
2099 |
+
"nbconvert_exporter": "python",
|
2100 |
+
"pygments_lexer": "ipython3",
|
2101 |
+
"version": "3.8.5"
|
2102 |
+
}
|
2103 |
+
},
|
2104 |
+
"nbformat": 4,
|
2105 |
+
"nbformat_minor": 5
|
2106 |
+
}
|
DeepGaze/.ipynb_checkpoints/dg2e_wardle-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/.ipynb_checkpoints/dg2e_wardle_inv-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/.ipynb_checkpoints/dg3_hg-checkpoint.ipynb
ADDED
@@ -0,0 +1,2272 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"id": "2683899d",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [],
|
9 |
+
"source": [
|
10 |
+
"import numpy as np\n",
|
11 |
+
"from scipy.misc import face\n",
|
12 |
+
"from scipy.ndimage import zoom\n",
|
13 |
+
"from scipy.special import logsumexp\n",
|
14 |
+
"import torch\n",
|
15 |
+
"import matplotlib.pyplot as plt\n",
|
16 |
+
"import pickle\n",
|
17 |
+
"import scipy.io\n",
|
18 |
+
"import cv2\n",
|
19 |
+
"import os"
|
20 |
+
]
|
21 |
+
},
|
22 |
+
{
|
23 |
+
"cell_type": "code",
|
24 |
+
"execution_count": 2,
|
25 |
+
"id": "32bd8589",
|
26 |
+
"metadata": {
|
27 |
+
"scrolled": true
|
28 |
+
},
|
29 |
+
"outputs": [],
|
30 |
+
"source": [
|
31 |
+
"def load_images_from_folder(folder):\n",
|
32 |
+
" images = []\n",
|
33 |
+
" img_name = []\n",
|
34 |
+
" for filename in os.listdir(folder):\n",
|
35 |
+
" img = cv2.imread(os.path.join(folder,filename))\n",
|
36 |
+
" if img is not None:\n",
|
37 |
+
" images.append(img)\n",
|
38 |
+
" img_name.append(filename)\n",
|
39 |
+
" return images, img_name"
|
40 |
+
]
|
41 |
+
},
|
42 |
+
{
|
43 |
+
"cell_type": "code",
|
44 |
+
"execution_count": 3,
|
45 |
+
"id": "c5ebf6a1",
|
46 |
+
"metadata": {},
|
47 |
+
"outputs": [],
|
48 |
+
"source": [
|
49 |
+
"imgs, img_name = load_images_from_folder('stimuli')"
|
50 |
+
]
|
51 |
+
},
|
52 |
+
{
|
53 |
+
"cell_type": "code",
|
54 |
+
"execution_count": 4,
|
55 |
+
"id": "571c8db2",
|
56 |
+
"metadata": {
|
57 |
+
"scrolled": true
|
58 |
+
},
|
59 |
+
"outputs": [
|
60 |
+
{
|
61 |
+
"data": {
|
62 |
+
"text/plain": [
|
63 |
+
"['67.jpg',\n",
|
64 |
+
" '1587.jpg',\n",
|
65 |
+
" '1458.jpg',\n",
|
66 |
+
" '91.jpg',\n",
|
67 |
+
" '1397.jpg',\n",
|
68 |
+
" '121.jpg',\n",
|
69 |
+
" '1324.jpg',\n",
|
70 |
+
" '1153.jpg',\n",
|
71 |
+
" '1597.jpg',\n",
|
72 |
+
" '1143.jpg',\n",
|
73 |
+
" '1039.jpg',\n",
|
74 |
+
" '1400.jpg',\n",
|
75 |
+
" '1209.jpg',\n",
|
76 |
+
" '75.jpg',\n",
|
77 |
+
" '1480.jpg',\n",
|
78 |
+
" '1093.jpg',\n",
|
79 |
+
" '1267.jpg',\n",
|
80 |
+
" '1227.jpg',\n",
|
81 |
+
" '2.jpg',\n",
|
82 |
+
" '1109.jpg',\n",
|
83 |
+
" '1558.jpg',\n",
|
84 |
+
" '1385.jpg',\n",
|
85 |
+
" '22.jpg',\n",
|
86 |
+
" '56.jpg',\n",
|
87 |
+
" '1118.jpg',\n",
|
88 |
+
" '1078.jpg',\n",
|
89 |
+
" '1532.jpg',\n",
|
90 |
+
" '1416.jpg',\n",
|
91 |
+
" '79.jpg',\n",
|
92 |
+
" '1485.jpg',\n",
|
93 |
+
" '1471.jpg',\n",
|
94 |
+
" '95.jpg',\n",
|
95 |
+
" '20.jpg',\n",
|
96 |
+
" '1042.jpg',\n",
|
97 |
+
" '1262.jpg',\n",
|
98 |
+
" '1288.jpg',\n",
|
99 |
+
" '15.jpg',\n",
|
100 |
+
" '128.jpg',\n",
|
101 |
+
" '72.jpg',\n",
|
102 |
+
" '117.jpg',\n",
|
103 |
+
" '1413.jpg',\n",
|
104 |
+
" '1266.jpg',\n",
|
105 |
+
" '1234.jpg',\n",
|
106 |
+
" '125.jpg',\n",
|
107 |
+
" '1293.jpg',\n",
|
108 |
+
" '147.jpg',\n",
|
109 |
+
" '1557.jpg',\n",
|
110 |
+
" '11.jpg',\n",
|
111 |
+
" '1645.jpg',\n",
|
112 |
+
" '1239.jpg',\n",
|
113 |
+
" '1394.jpg',\n",
|
114 |
+
" '151.jpg',\n",
|
115 |
+
" '010.jpg',\n",
|
116 |
+
" '1559.jpg',\n",
|
117 |
+
" '36.jpg',\n",
|
118 |
+
" '1065.jpg',\n",
|
119 |
+
" '1337.jpg',\n",
|
120 |
+
" '1294.jpg',\n",
|
121 |
+
" '17.jpg',\n",
|
122 |
+
" '143.jpg',\n",
|
123 |
+
" '1022.jpg',\n",
|
124 |
+
" '1016.jpg',\n",
|
125 |
+
" '60.jpg',\n",
|
126 |
+
" '98.jpg',\n",
|
127 |
+
" '1448.jpg',\n",
|
128 |
+
" '1224.jpg',\n",
|
129 |
+
" '139.jpg',\n",
|
130 |
+
" '1149.jpg',\n",
|
131 |
+
" '1455.jpg',\n",
|
132 |
+
" '76.jpg',\n",
|
133 |
+
" '1654.jpg',\n",
|
134 |
+
" '1438.jpg',\n",
|
135 |
+
" '152.jpg',\n",
|
136 |
+
" '1329.jpg',\n",
|
137 |
+
" '1249.jpg',\n",
|
138 |
+
" '1383.jpg',\n",
|
139 |
+
" '1642.jpg',\n",
|
140 |
+
" '102.jpg',\n",
|
141 |
+
" '27.jpg',\n",
|
142 |
+
" '1363.jpg',\n",
|
143 |
+
" '1108.jpg',\n",
|
144 |
+
" '28.jpg',\n",
|
145 |
+
" '1387.jpg',\n",
|
146 |
+
" '1538.jpg',\n",
|
147 |
+
" '1388.jpg',\n",
|
148 |
+
" '138.jpg',\n",
|
149 |
+
" '66.jpg',\n",
|
150 |
+
" '1079.jpg',\n",
|
151 |
+
" '1043.jpg',\n",
|
152 |
+
" '1317.jpg',\n",
|
153 |
+
" '44.jpg',\n",
|
154 |
+
" '1040.jpg',\n",
|
155 |
+
" '103.jpg',\n",
|
156 |
+
" '1644.jpg',\n",
|
157 |
+
" '1120.jpg',\n",
|
158 |
+
" '1125.jpg',\n",
|
159 |
+
" '1392.jpg',\n",
|
160 |
+
" '111.jpg',\n",
|
161 |
+
" '82.jpg',\n",
|
162 |
+
" '85.jpg',\n",
|
163 |
+
" '1627.jpg',\n",
|
164 |
+
" '106.jpg',\n",
|
165 |
+
" '57.jpg',\n",
|
166 |
+
" '1568.jpg',\n",
|
167 |
+
" '1029.jpg',\n",
|
168 |
+
" '1351.jpg',\n",
|
169 |
+
" '1087.jpg',\n",
|
170 |
+
" '83.jpg',\n",
|
171 |
+
" '146.jpg',\n",
|
172 |
+
" '1465.jpg',\n",
|
173 |
+
" '1561.jpg',\n",
|
174 |
+
" '1505.jpg',\n",
|
175 |
+
" '1183.jpg',\n",
|
176 |
+
" '48.jpg',\n",
|
177 |
+
" '1275.jpg',\n",
|
178 |
+
" '1541.jpg',\n",
|
179 |
+
" '1565.jpg',\n",
|
180 |
+
" '1682.jpg',\n",
|
181 |
+
" '123.jpg',\n",
|
182 |
+
" '1647.jpg',\n",
|
183 |
+
" '1523.jpg',\n",
|
184 |
+
" '64.jpg',\n",
|
185 |
+
" '1426.jpg',\n",
|
186 |
+
" '1321.jpg',\n",
|
187 |
+
" '1624.jpg',\n",
|
188 |
+
" '1126.jpg',\n",
|
189 |
+
" '38.jpg',\n",
|
190 |
+
" '1513.jpg',\n",
|
191 |
+
" '141.jpg',\n",
|
192 |
+
" '1304.jpg',\n",
|
193 |
+
" '1367.jpg',\n",
|
194 |
+
" '1618.jpg',\n",
|
195 |
+
" '1669.jpg',\n",
|
196 |
+
" '81.jpg',\n",
|
197 |
+
" '25.jpg',\n",
|
198 |
+
" '1500.jpg',\n",
|
199 |
+
" '1219.jpg',\n",
|
200 |
+
" '1699.jpg',\n",
|
201 |
+
" '149.jpg',\n",
|
202 |
+
" '1487.jpg',\n",
|
203 |
+
" '1638.jpg',\n",
|
204 |
+
" '1442.jpg',\n",
|
205 |
+
" '150.jpg',\n",
|
206 |
+
" '148.jpg',\n",
|
207 |
+
" '1382.jpg',\n",
|
208 |
+
" '42.jpg',\n",
|
209 |
+
" '1553.jpg',\n",
|
210 |
+
" '014.jpg',\n",
|
211 |
+
" '1474.jpg',\n",
|
212 |
+
" '97.jpg',\n",
|
213 |
+
" '140.jpg',\n",
|
214 |
+
" '1195.jpg',\n",
|
215 |
+
" '1245.jpg',\n",
|
216 |
+
" '1610.jpg',\n",
|
217 |
+
" '58.jpg',\n",
|
218 |
+
" '127.jpg',\n",
|
219 |
+
" '1516.jpg',\n",
|
220 |
+
" '1353.jpg',\n",
|
221 |
+
" '1184.jpg',\n",
|
222 |
+
" '1358.jpg',\n",
|
223 |
+
" '1160.jpg',\n",
|
224 |
+
" '1015.jpg',\n",
|
225 |
+
" '1449.jpg',\n",
|
226 |
+
" '132.jpg',\n",
|
227 |
+
" '1612.jpg',\n",
|
228 |
+
" '1.jpg',\n",
|
229 |
+
" '1303.jpg',\n",
|
230 |
+
" '1095.jpg',\n",
|
231 |
+
" '1658.jpg',\n",
|
232 |
+
" '008.jpg',\n",
|
233 |
+
" '005.jpg',\n",
|
234 |
+
" '157.jpg',\n",
|
235 |
+
" '1574.jpg',\n",
|
236 |
+
" '1144.jpg',\n",
|
237 |
+
" '112.jpg',\n",
|
238 |
+
" '003.jpg',\n",
|
239 |
+
" '1343.jpg',\n",
|
240 |
+
" '55.jpg',\n",
|
241 |
+
" '154.jpg',\n",
|
242 |
+
" '1178.jpg',\n",
|
243 |
+
" '1673.jpg',\n",
|
244 |
+
" '96.jpg',\n",
|
245 |
+
" '1365.jpg',\n",
|
246 |
+
" '1117.jpg',\n",
|
247 |
+
" '24.jpg',\n",
|
248 |
+
" '1077.jpg',\n",
|
249 |
+
" '1316.jpg',\n",
|
250 |
+
" '1492.jpg',\n",
|
251 |
+
" '1520.jpg',\n",
|
252 |
+
" '1556.jpg',\n",
|
253 |
+
" '1410.jpg',\n",
|
254 |
+
" '159.jpg',\n",
|
255 |
+
" '1210.jpg',\n",
|
256 |
+
" '002.jpg',\n",
|
257 |
+
" '1548.jpg',\n",
|
258 |
+
" '118.jpg',\n",
|
259 |
+
" '1423.jpg',\n",
|
260 |
+
" '1113.jpg',\n",
|
261 |
+
" '1428.jpg',\n",
|
262 |
+
" '1472.jpg',\n",
|
263 |
+
" '87.jpg',\n",
|
264 |
+
" '21.jpg',\n",
|
265 |
+
" '001.jpg',\n",
|
266 |
+
" '1062.jpg',\n",
|
267 |
+
" '1096.jpg',\n",
|
268 |
+
" '1460.jpg',\n",
|
269 |
+
" '1314.jpg',\n",
|
270 |
+
" '1554.jpg',\n",
|
271 |
+
" '1498.jpg',\n",
|
272 |
+
" '1049.jpg',\n",
|
273 |
+
" '1206.jpg',\n",
|
274 |
+
" '119.jpg',\n",
|
275 |
+
" '3.jpg',\n",
|
276 |
+
" '1372.jpg',\n",
|
277 |
+
" '74.jpg',\n",
|
278 |
+
" '007.jpg',\n",
|
279 |
+
" '30.jpg',\n",
|
280 |
+
" '1163.jpg',\n",
|
281 |
+
" '1281.jpg',\n",
|
282 |
+
" '1522.jpg',\n",
|
283 |
+
" '1001.jpg',\n",
|
284 |
+
" '011.jpg',\n",
|
285 |
+
" '108.jpg',\n",
|
286 |
+
" '131.jpg',\n",
|
287 |
+
" '68.jpg',\n",
|
288 |
+
" '1215.jpg',\n",
|
289 |
+
" '1527.jpg',\n",
|
290 |
+
" '122.jpg',\n",
|
291 |
+
" '1698.jpg',\n",
|
292 |
+
" '1690.jpg',\n",
|
293 |
+
" '1083.jpg',\n",
|
294 |
+
" '1092.jpg',\n",
|
295 |
+
" '006.jpg',\n",
|
296 |
+
" '113.jpg',\n",
|
297 |
+
" '80.jpg',\n",
|
298 |
+
" '1347.jpg',\n",
|
299 |
+
" '1499.jpg',\n",
|
300 |
+
" '1018.jpg',\n",
|
301 |
+
" '89.jpg',\n",
|
302 |
+
" '004.jpg',\n",
|
303 |
+
" '78.jpg',\n",
|
304 |
+
" '1443.jpg',\n",
|
305 |
+
" '1094.jpg',\n",
|
306 |
+
" '1131.jpg',\n",
|
307 |
+
" '1476.jpg',\n",
|
308 |
+
" '1483.jpg',\n",
|
309 |
+
" '013.jpg',\n",
|
310 |
+
" '1517.jpg',\n",
|
311 |
+
" '1586.jpg',\n",
|
312 |
+
" '1346.jpg',\n",
|
313 |
+
" '1535.jpg',\n",
|
314 |
+
" '1254.jpg',\n",
|
315 |
+
" '9.jpg',\n",
|
316 |
+
" '009.jpg',\n",
|
317 |
+
" '156.jpg',\n",
|
318 |
+
" '1190.jpg',\n",
|
319 |
+
" '1306.jpg',\n",
|
320 |
+
" '1067.jpg',\n",
|
321 |
+
" '49.jpg',\n",
|
322 |
+
" '115.jpg',\n",
|
323 |
+
" '1151.jpg',\n",
|
324 |
+
" '120.jpg',\n",
|
325 |
+
" '1192.jpg',\n",
|
326 |
+
" '39.jpg',\n",
|
327 |
+
" '84.jpg',\n",
|
328 |
+
" '1510.jpg',\n",
|
329 |
+
" '69.jpg',\n",
|
330 |
+
" '1360.jpg',\n",
|
331 |
+
" '1290.jpg',\n",
|
332 |
+
" '1433.jpg',\n",
|
333 |
+
" '1570.jpg',\n",
|
334 |
+
" '1489.jpg',\n",
|
335 |
+
" '1352.jpg',\n",
|
336 |
+
" '153.jpg',\n",
|
337 |
+
" '133.jpg',\n",
|
338 |
+
" '1469.jpg',\n",
|
339 |
+
" '144.jpg',\n",
|
340 |
+
" '110.jpg',\n",
|
341 |
+
" '145.jpg',\n",
|
342 |
+
" '7.jpg',\n",
|
343 |
+
" '1182.jpg',\n",
|
344 |
+
" '35.jpg',\n",
|
345 |
+
" '1369.jpg',\n",
|
346 |
+
" '1504.jpg',\n",
|
347 |
+
" '70.jpg',\n",
|
348 |
+
" '116.jpg',\n",
|
349 |
+
" '1488.jpg',\n",
|
350 |
+
" '126.jpg',\n",
|
351 |
+
" '1240.jpg',\n",
|
352 |
+
" '1651.jpg',\n",
|
353 |
+
" '012.jpg',\n",
|
354 |
+
" '1186.jpg',\n",
|
355 |
+
" '1393.jpg',\n",
|
356 |
+
" '109.jpg',\n",
|
357 |
+
" '137.jpg',\n",
|
358 |
+
" '1105.jpg',\n",
|
359 |
+
" '1297.jpg',\n",
|
360 |
+
" '1238.jpg',\n",
|
361 |
+
" '50.jpg',\n",
|
362 |
+
" '1589.jpg']"
|
363 |
+
]
|
364 |
+
},
|
365 |
+
"execution_count": 4,
|
366 |
+
"metadata": {},
|
367 |
+
"output_type": "execute_result"
|
368 |
+
}
|
369 |
+
],
|
370 |
+
"source": [
|
371 |
+
"img_name"
|
372 |
+
]
|
373 |
+
},
|
374 |
+
{
|
375 |
+
"cell_type": "code",
|
376 |
+
"execution_count": 5,
|
377 |
+
"id": "e99e7121",
|
378 |
+
"metadata": {},
|
379 |
+
"outputs": [
|
380 |
+
{
|
381 |
+
"data": {
|
382 |
+
"text/plain": [
|
383 |
+
"300"
|
384 |
+
]
|
385 |
+
},
|
386 |
+
"execution_count": 5,
|
387 |
+
"metadata": {},
|
388 |
+
"output_type": "execute_result"
|
389 |
+
}
|
390 |
+
],
|
391 |
+
"source": [
|
392 |
+
"len(img_name)"
|
393 |
+
]
|
394 |
+
},
|
395 |
+
{
|
396 |
+
"cell_type": "code",
|
397 |
+
"execution_count": 6,
|
398 |
+
"id": "0dc9ab34",
|
399 |
+
"metadata": {},
|
400 |
+
"outputs": [],
|
401 |
+
"source": [
|
402 |
+
"def load_fix_from_folder(folder):\n",
|
403 |
+
" fix_X = []\n",
|
404 |
+
" fix_Y = []\n",
|
405 |
+
" radius = []\n",
|
406 |
+
" img_name = []\n",
|
407 |
+
" for filename in os.listdir(folder):\n",
|
408 |
+
" fix_X.append(scipy.io.loadmat(os.path.join(folder,filename))['currImData'][:,4])\n",
|
409 |
+
" fix_Y.append(scipy.io.loadmat(os.path.join(folder,filename))['currImData'][:,5])\n",
|
410 |
+
" radius.append(scipy.io.loadmat(os.path.join(folder,filename))['currImData'][:,6])\n",
|
411 |
+
" img_name.append(str(scipy.io.loadmat(os.path.join(folder,filename))['currImName'][0][0]) + '.jpg')\n",
|
412 |
+
" #print(filename)\n",
|
413 |
+
" #print(img_name)\n",
|
414 |
+
" return fix_X, fix_Y, radius, img_name"
|
415 |
+
]
|
416 |
+
},
|
417 |
+
{
|
418 |
+
"cell_type": "code",
|
419 |
+
"execution_count": 7,
|
420 |
+
"id": "864cb318",
|
421 |
+
"metadata": {},
|
422 |
+
"outputs": [],
|
423 |
+
"source": [
|
424 |
+
"import os\n",
|
425 |
+
"\n",
|
426 |
+
"def create_folder(folder_path):\n",
|
427 |
+
" try:\n",
|
428 |
+
" os.mkdir(folder_path)\n",
|
429 |
+
" print(f\"Folder '{folder_path}' created successfully.\")\n",
|
430 |
+
" except FileExistsError:\n",
|
431 |
+
" print(f\"Folder '{folder_path}' already exists.\")\n",
|
432 |
+
" except Exception as e:\n",
|
433 |
+
" print(f\"An error occurred: {e}\")"
|
434 |
+
]
|
435 |
+
},
|
436 |
+
{
|
437 |
+
"cell_type": "code",
|
438 |
+
"execution_count": 8,
|
439 |
+
"id": "47b06581",
|
440 |
+
"metadata": {},
|
441 |
+
"outputs": [],
|
442 |
+
"source": [
|
443 |
+
"import os\n",
|
444 |
+
"\n",
|
445 |
+
"def folder_exists(folder_path):\n",
|
446 |
+
" return os.path.exists(folder_path) and os.path.isdir(folder_path)\n",
|
447 |
+
"\n"
|
448 |
+
]
|
449 |
+
},
|
450 |
+
{
|
451 |
+
"cell_type": "code",
|
452 |
+
"execution_count": 9,
|
453 |
+
"id": "bb2809f0",
|
454 |
+
"metadata": {},
|
455 |
+
"outputs": [],
|
456 |
+
"source": [
|
457 |
+
"def add_circles(matrix, x_list, y_list, r_list):\n",
|
458 |
+
" for x, y, r in zip(x_list, y_list, r_list):\n",
|
459 |
+
" x, y, r = int(x), int(y), int(r)\n",
|
460 |
+
" for i in range(max(0, y - r), min(matrix.shape[0], y + r + 1)):\n",
|
461 |
+
" for j in range(max(0, x - r), min(matrix.shape[1], x + r + 1)):\n",
|
462 |
+
" if (i - y) ** 2 + (j - x) ** 2 <= r ** 2:\n",
|
463 |
+
" matrix[i][j] += 1\n",
|
464 |
+
" return matrix"
|
465 |
+
]
|
466 |
+
},
|
467 |
+
{
|
468 |
+
"cell_type": "code",
|
469 |
+
"execution_count": null,
|
470 |
+
"id": "d5f1efd1",
|
471 |
+
"metadata": {
|
472 |
+
"scrolled": true
|
473 |
+
},
|
474 |
+
"outputs": [
|
475 |
+
{
|
476 |
+
"name": "stderr",
|
477 |
+
"output_type": "stream",
|
478 |
+
"text": [
|
479 |
+
"Using cache found in /home/pranjul/.cache/torch/hub/pytorch_vision_v0.6.0\n"
|
480 |
+
]
|
481 |
+
},
|
482 |
+
{
|
483 |
+
"name": "stdout",
|
484 |
+
"output_type": "stream",
|
485 |
+
"text": [
|
486 |
+
"Folder 'DG3_HG_heatmaps/S10_fix' created successfully.\n",
|
487 |
+
"Folder 'DG3_HG_heatmaps/S11_fix' created successfully.\n",
|
488 |
+
"Folder 'DG3_HG_heatmaps/S12_fix' created successfully.\n",
|
489 |
+
"Folder 'DG3_HG_heatmaps/S13_fix' created successfully.\n",
|
490 |
+
"Folder 'DG3_HG_heatmaps/S14_fix' created successfully.\n",
|
491 |
+
"Folder 'DG3_HG_heatmaps/S15_fix' created successfully.\n",
|
492 |
+
"Folder 'DG3_HG_heatmaps/S16_fix' created successfully.\n"
|
493 |
+
]
|
494 |
+
}
|
495 |
+
],
|
496 |
+
"source": [
|
497 |
+
"import matplotlib.pyplot as plt\n",
|
498 |
+
"import numpy as np\n",
|
499 |
+
"from scipy.misc import face\n",
|
500 |
+
"from scipy.ndimage import zoom\n",
|
501 |
+
"from scipy.special import logsumexp\n",
|
502 |
+
"import torch\n",
|
503 |
+
"\n",
|
504 |
+
"import deepgaze_pytorch\n",
|
505 |
+
"\n",
|
506 |
+
"DEVICE = 'cuda'\n",
|
507 |
+
"\n",
|
508 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
509 |
+
"model = deepgaze_pytorch.DeepGazeIII(pretrained=True).to(DEVICE)\n",
|
510 |
+
"\n",
|
511 |
+
"#image = face()\n",
|
512 |
+
"\n",
|
513 |
+
"\n",
|
514 |
+
"for q in range(10, 56):\n",
|
515 |
+
" \n",
|
516 |
+
" x = []\n",
|
517 |
+
" \n",
|
518 |
+
" # Replace 'path/to/your/folder' with the folder path you want to check\n",
|
519 |
+
" folder_path = 'S_fix/S'+ str(q) +'_fix'\n",
|
520 |
+
" \n",
|
521 |
+
" if folder_exists(folder_path):\n",
|
522 |
+
" \n",
|
523 |
+
" fix_X, fix_Y, radius, img_name = load_fix_from_folder('S_fix/S'+ str(q) +'_fix')\n",
|
524 |
+
" \n",
|
525 |
+
" \n",
|
526 |
+
"\n",
|
527 |
+
" # Replace 'path/to/your/folder' with the desired folder path\n",
|
528 |
+
" folder_path = 'DG3_HG_heatmaps/S'+ str(q) +'_fix'\n",
|
529 |
+
" create_folder(folder_path)\n",
|
530 |
+
"\n",
|
531 |
+
"\n",
|
532 |
+
" for i in range(len(img_name)):\n",
|
533 |
+
"\n",
|
534 |
+
" image = cv2.imread('/home/pranjul/DeepGaze/stimuli/' + img_name[i])\n",
|
535 |
+
"\n",
|
536 |
+
" if image is not None and len(fix_X[i]) > 3 and len(fix_Y[i] > 3):\n",
|
537 |
+
"\n",
|
538 |
+
" # location of previous scanpath fixations in x and y (pixel coordinates), starting with the initial fixation on the image.\n",
|
539 |
+
" #fixation_history_x = np.array([1024//2, 300, 500, 200, 200, 700])\n",
|
540 |
+
" #fixation_history_y = np.array([768//2, 300, 100, 300, 100, 500])\n",
|
541 |
+
"\n",
|
542 |
+
" #print(img_name[i])\n",
|
543 |
+
"\n",
|
544 |
+
" fixation_history_x = fix_X[i]/3\n",
|
545 |
+
" #print(fixation_history_x)\n",
|
546 |
+
" fixation_history_y = fix_Y[i]/3\n",
|
547 |
+
" radius_history = radius[i]/5\n",
|
548 |
+
" \n",
|
549 |
+
" #print(fixation_history_x, fixation_history_y, radius_history)\n",
|
550 |
+
" \n",
|
551 |
+
" # Create a 2D matrix filled with zeros of size (600, 800)\n",
|
552 |
+
" matrix_size = (600, 800)\n",
|
553 |
+
" matrix = np.zeros(matrix_size, dtype=int)\n",
|
554 |
+
"\n",
|
555 |
+
" # Call the function to add circles to the matrix\n",
|
556 |
+
" result_matrix = add_circles(matrix, fixation_history_x, fixation_history_y, radius_history)\n",
|
557 |
+
" \n",
|
558 |
+
" #plt.imshow(result_matrix)\n",
|
559 |
+
" #plt.plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
560 |
+
" #plt.axis('on')\n",
|
561 |
+
" #plt.colorbar(fraction=0.046, pad=0.04) # Adjust fraction and pad values as needed\n",
|
562 |
+
" #plt.tight_layout()\n",
|
563 |
+
" \n",
|
564 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
565 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
566 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
567 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
568 |
+
" \n",
|
569 |
+
" # rescale to match image size\n",
|
570 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
571 |
+
" # renormalize log density\n",
|
572 |
+
" centerbias -= logsumexp(centerbias)\n",
|
573 |
+
"\n",
|
574 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
575 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
576 |
+
" x_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
577 |
+
" y_hist_tensor = torch.tensor([fixation_history_y[model.included_fixations]]).to(DEVICE)\n",
|
578 |
+
"\n",
|
579 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor, x_hist_tensor, y_hist_tensor)\n",
|
580 |
+
"\n",
|
581 |
+
" # Scale factor\n",
|
582 |
+
" #scale_factor = 3\n",
|
583 |
+
"\n",
|
584 |
+
" # Calculate the new width and height\n",
|
585 |
+
" #new_width = image.shape[1] * scale_factor\n",
|
586 |
+
" #new_height = image.shape[0] * scale_factor\n",
|
587 |
+
"\n",
|
588 |
+
" # Resize the image using cv2.resize()\n",
|
589 |
+
" #image = cv2.resize(image, (new_width, new_height))\n",
|
590 |
+
"\n",
|
591 |
+
" image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n",
|
592 |
+
" \n",
|
593 |
+
" x.append((log_density_prediction.detach().cpu().numpy()[0, 0], str(img_name[i].split('.')[0]),\n",
|
594 |
+
" 'S' + str(q), result_matrix))\n",
|
595 |
+
" \n",
|
596 |
+
" \n",
|
597 |
+
" \n",
|
598 |
+
" f, axs = plt.subplots(nrows=1, ncols=3, figsize=(16, 9))\n",
|
599 |
+
" axs[0].imshow(image)\n",
|
600 |
+
" axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
601 |
+
" axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='white', zorder=100)\n",
|
602 |
+
" axs[0].set_axis_off()\n",
|
603 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
604 |
+
" axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
605 |
+
" axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='white', zorder=100)\n",
|
606 |
+
" axs[1].set_axis_off()\n",
|
607 |
+
" axs[2].matshow(result_matrix)\n",
|
608 |
+
" axs[2].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
609 |
+
" axs[2].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='white', zorder=100)\n",
|
610 |
+
" axs[2].set_axis_off()\n",
|
611 |
+
" #plt.show()\n",
|
612 |
+
" plt.savefig(os.path.join('DG3_HG_heatmaps/S'+ str(q) +'_fix', img_name[i]))\n",
|
613 |
+
" plt.close()\n",
|
614 |
+
" #break\n",
|
615 |
+
" \n",
|
616 |
+
" # Open a file in binary write mode\n",
|
617 |
+
" with open('DG3_HG_heatmaps/S'+ str(q) +'_fix/' + 'S'+ str(q) + '.pkl', 'wb') as file:\n",
|
618 |
+
" pickle.dump(x, file)\n",
|
619 |
+
" \n",
|
620 |
+
" #break\n",
|
621 |
+
" #break"
|
622 |
+
]
|
623 |
+
},
|
624 |
+
{
|
625 |
+
"cell_type": "code",
|
626 |
+
"execution_count": null,
|
627 |
+
"id": "a7496b7d",
|
628 |
+
"metadata": {},
|
629 |
+
"outputs": [],
|
630 |
+
"source": [
|
631 |
+
"len(x)"
|
632 |
+
]
|
633 |
+
},
|
634 |
+
{
|
635 |
+
"cell_type": "code",
|
636 |
+
"execution_count": null,
|
637 |
+
"id": "17e1a970",
|
638 |
+
"metadata": {
|
639 |
+
"scrolled": true
|
640 |
+
},
|
641 |
+
"outputs": [],
|
642 |
+
"source": [
|
643 |
+
"x_loaded = {}\n",
|
644 |
+
"\n",
|
645 |
+
"for q in range(1, 5):\n",
|
646 |
+
"\n",
|
647 |
+
" # Replace 'path/to/your/folder' with the folder path you want to check\n",
|
648 |
+
" folder_path = 'S_fix/S0'+ str(q) +'_fix'\n",
|
649 |
+
" \n",
|
650 |
+
" if folder_exists(folder_path):\n",
|
651 |
+
" # Open a file in binary write mode\n",
|
652 |
+
" with open('DG3_HG_heatmaps/S0'+ str(q) +'_fix/' + 'S0'+ str(q) + '.pkl', 'rb') as file:\n",
|
653 |
+
" x_loaded[q] = pickle.load(file)\n",
|
654 |
+
"\n",
|
655 |
+
"#x_loaded = [x.tolist() for x in x_loaded]\n"
|
656 |
+
]
|
657 |
+
},
|
658 |
+
{
|
659 |
+
"cell_type": "code",
|
660 |
+
"execution_count": null,
|
661 |
+
"id": "8eba733e",
|
662 |
+
"metadata": {},
|
663 |
+
"outputs": [],
|
664 |
+
"source": [
|
665 |
+
"x_loaded"
|
666 |
+
]
|
667 |
+
},
|
668 |
+
{
|
669 |
+
"cell_type": "code",
|
670 |
+
"execution_count": null,
|
671 |
+
"id": "b5c443d6",
|
672 |
+
"metadata": {},
|
673 |
+
"outputs": [],
|
674 |
+
"source": [
|
675 |
+
"len(x_loaded)"
|
676 |
+
]
|
677 |
+
},
|
678 |
+
{
|
679 |
+
"cell_type": "code",
|
680 |
+
"execution_count": null,
|
681 |
+
"id": "4ea66668",
|
682 |
+
"metadata": {},
|
683 |
+
"outputs": [],
|
684 |
+
"source": []
|
685 |
+
},
|
686 |
+
{
|
687 |
+
"cell_type": "code",
|
688 |
+
"execution_count": null,
|
689 |
+
"id": "84c04b86",
|
690 |
+
"metadata": {},
|
691 |
+
"outputs": [],
|
692 |
+
"source": []
|
693 |
+
},
|
694 |
+
{
|
695 |
+
"cell_type": "code",
|
696 |
+
"execution_count": null,
|
697 |
+
"id": "3e4f31b1",
|
698 |
+
"metadata": {},
|
699 |
+
"outputs": [],
|
700 |
+
"source": [
|
701 |
+
"x_loaded_q = []\n",
|
702 |
+
"\n",
|
703 |
+
"for q in range(1, 5):\n",
|
704 |
+
" if q in x_loaded:\n",
|
705 |
+
" print(len(x_loaded[q]))\n",
|
706 |
+
" x_loaded_q.append(x_loaded[q])\n",
|
707 |
+
" "
|
708 |
+
]
|
709 |
+
},
|
710 |
+
{
|
711 |
+
"cell_type": "code",
|
712 |
+
"execution_count": null,
|
713 |
+
"id": "93264ea7",
|
714 |
+
"metadata": {
|
715 |
+
"scrolled": true
|
716 |
+
},
|
717 |
+
"outputs": [],
|
718 |
+
"source": [
|
719 |
+
"np.shape(np.reshape(x_loaded_q, (849, 4)))"
|
720 |
+
]
|
721 |
+
},
|
722 |
+
{
|
723 |
+
"cell_type": "code",
|
724 |
+
"execution_count": null,
|
725 |
+
"id": "7aaf41a1",
|
726 |
+
"metadata": {},
|
727 |
+
"outputs": [],
|
728 |
+
"source": [
|
729 |
+
"283*3"
|
730 |
+
]
|
731 |
+
},
|
732 |
+
{
|
733 |
+
"cell_type": "code",
|
734 |
+
"execution_count": null,
|
735 |
+
"id": "18f03b5b",
|
736 |
+
"metadata": {},
|
737 |
+
"outputs": [],
|
738 |
+
"source": [
|
739 |
+
"plt.matshow(np.reshape(x_loaded_q, (849, 4))[100][0])"
|
740 |
+
]
|
741 |
+
},
|
742 |
+
{
|
743 |
+
"cell_type": "code",
|
744 |
+
"execution_count": null,
|
745 |
+
"id": "54701e93",
|
746 |
+
"metadata": {},
|
747 |
+
"outputs": [],
|
748 |
+
"source": [
|
749 |
+
"plt.matshow(np.reshape(x_loaded_q, (849, 4))[100][3])"
|
750 |
+
]
|
751 |
+
},
|
752 |
+
{
|
753 |
+
"cell_type": "code",
|
754 |
+
"execution_count": null,
|
755 |
+
"id": "8966156a",
|
756 |
+
"metadata": {},
|
757 |
+
"outputs": [],
|
758 |
+
"source": [
|
759 |
+
"x_loaded"
|
760 |
+
]
|
761 |
+
},
|
762 |
+
{
|
763 |
+
"cell_type": "code",
|
764 |
+
"execution_count": null,
|
765 |
+
"id": "4e2a4d75",
|
766 |
+
"metadata": {},
|
767 |
+
"outputs": [],
|
768 |
+
"source": [
|
769 |
+
"x_loaded_q_reshaped = np.reshape(x_loaded_q, (849, 4))"
|
770 |
+
]
|
771 |
+
},
|
772 |
+
{
|
773 |
+
"cell_type": "code",
|
774 |
+
"execution_count": null,
|
775 |
+
"id": "45392af9",
|
776 |
+
"metadata": {},
|
777 |
+
"outputs": [],
|
778 |
+
"source": [
|
779 |
+
"img.shape"
|
780 |
+
]
|
781 |
+
},
|
782 |
+
{
|
783 |
+
"cell_type": "code",
|
784 |
+
"execution_count": null,
|
785 |
+
"id": "93a09086",
|
786 |
+
"metadata": {
|
787 |
+
"scrolled": true
|
788 |
+
},
|
789 |
+
"outputs": [],
|
790 |
+
"source": [
|
791 |
+
"import numpy as np\n",
|
792 |
+
"from scipy.misc import face\n",
|
793 |
+
"from scipy.ndimage import zoom\n",
|
794 |
+
"from scipy.special import logsumexp\n",
|
795 |
+
"import torch\n",
|
796 |
+
"import matplotlib.pyplot as plt\n",
|
797 |
+
"\n",
|
798 |
+
"import deepgaze_pytorch\n",
|
799 |
+
"\n",
|
800 |
+
"DEVICE = 'cuda'\n",
|
801 |
+
"\n",
|
802 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
803 |
+
"model = deepgaze_pytorch.DeepGazeI(pretrained=True).to(DEVICE)\n",
|
804 |
+
"\n",
|
805 |
+
"# image = face()\n",
|
806 |
+
"\n",
|
807 |
+
"x = {}\n",
|
808 |
+
"\n",
|
809 |
+
"for i in range(len(image_paths)):\n",
|
810 |
+
" print(i)\n",
|
811 |
+
" \n",
|
812 |
+
" image = cv2.imread(image_paths[i])\n",
|
813 |
+
" \n",
|
814 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
815 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
816 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
817 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
818 |
+
" # rescale to match image size\n",
|
819 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
820 |
+
" # renormalize log density\n",
|
821 |
+
" centerbias -= logsumexp(centerbias)\n",
|
822 |
+
"\n",
|
823 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
824 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
825 |
+
"\n",
|
826 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor)\n",
|
827 |
+
" \n",
|
828 |
+
" #a = log_density_prediction.detach().cpu().numpy()[0, 0]\n",
|
829 |
+
" \n",
|
830 |
+
" #x[img_name[i].split('.')[0]] = a\n",
|
831 |
+
" \n",
|
832 |
+
" \n",
|
833 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(16, 9))\n",
|
834 |
+
" axs[0].imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))\n",
|
835 |
+
" # axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
836 |
+
" # axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
837 |
+
" axs[0].set_axis_off()\n",
|
838 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
839 |
+
" # axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
840 |
+
" # axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
841 |
+
" axs[1].set_axis_off()\n",
|
842 |
+
" plt.savefig(os.path.join('DG2_modified_imgs_heatmaps', '{0}.jpg'.format(i)))\n",
|
843 |
+
" \n",
|
844 |
+
" \n",
|
845 |
+
" #break"
|
846 |
+
]
|
847 |
+
},
|
848 |
+
{
|
849 |
+
"cell_type": "code",
|
850 |
+
"execution_count": null,
|
851 |
+
"id": "3e4e709a",
|
852 |
+
"metadata": {},
|
853 |
+
"outputs": [],
|
854 |
+
"source": []
|
855 |
+
},
|
856 |
+
{
|
857 |
+
"cell_type": "code",
|
858 |
+
"execution_count": null,
|
859 |
+
"id": "2bd1220a",
|
860 |
+
"metadata": {},
|
861 |
+
"outputs": [],
|
862 |
+
"source": []
|
863 |
+
},
|
864 |
+
{
|
865 |
+
"cell_type": "code",
|
866 |
+
"execution_count": null,
|
867 |
+
"id": "d2f42e76",
|
868 |
+
"metadata": {
|
869 |
+
"scrolled": false
|
870 |
+
},
|
871 |
+
"outputs": [],
|
872 |
+
"source": [
|
873 |
+
"import numpy as np\n",
|
874 |
+
"from scipy.misc import face\n",
|
875 |
+
"from scipy.ndimage import zoom\n",
|
876 |
+
"from scipy.special import logsumexp\n",
|
877 |
+
"import torch\n",
|
878 |
+
"import matplotlib.pyplot as plt\n",
|
879 |
+
"\n",
|
880 |
+
"import deepgaze_pytorch\n",
|
881 |
+
"\n",
|
882 |
+
"DEVICE = 'cuda'\n",
|
883 |
+
"\n",
|
884 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
885 |
+
"model = deepgaze_pytorch.DeepGazeIIE(pretrained=True).to(DEVICE)\n",
|
886 |
+
"\n",
|
887 |
+
"# image = face()\n",
|
888 |
+
"\n",
|
889 |
+
"#x = []\n",
|
890 |
+
"\n",
|
891 |
+
"for i in range(len(imgs)):\n",
|
892 |
+
" \n",
|
893 |
+
" image = imgs[i]\n",
|
894 |
+
" \n",
|
895 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
896 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
897 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
898 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
899 |
+
" # centerbias_template = np.zeros((1024, 1024))\n",
|
900 |
+
" # rescale to match image size\n",
|
901 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
902 |
+
" # renormalize log density\n",
|
903 |
+
" centerbias -= logsumexp(centerbias)\n",
|
904 |
+
"\n",
|
905 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
906 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
907 |
+
"\n",
|
908 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor)\n",
|
909 |
+
" \n",
|
910 |
+
" #a = log_density_prediction.detach().cpu().numpy()[0,0]\n",
|
911 |
+
" \n",
|
912 |
+
" #x[a] = str(img_name[i].split('.')[0])\n",
|
913 |
+
" \n",
|
914 |
+
" # Inside your loop\n",
|
915 |
+
" x.append((log_density_prediction.detach().cpu().numpy()[0, 0], str(img_name[i].split('.')[0])))\n",
|
916 |
+
"\n",
|
917 |
+
"\n",
|
918 |
+
"\n",
|
919 |
+
" \n",
|
920 |
+
" '''\n",
|
921 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(16, 9))\n",
|
922 |
+
" axs[0].imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))\n",
|
923 |
+
" # axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
924 |
+
" # axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
925 |
+
" axs[0].set_axis_off()\n",
|
926 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
927 |
+
" # axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
928 |
+
" # axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
929 |
+
" axs[1].set_axis_off()\n",
|
930 |
+
" # plt.savefig(os.path.join('DG2_heatmaps', '{0}.jpg'.format(i)))\n",
|
931 |
+
" '''\n",
|
932 |
+
" \n",
|
933 |
+
" break"
|
934 |
+
]
|
935 |
+
},
|
936 |
+
{
|
937 |
+
"cell_type": "code",
|
938 |
+
"execution_count": null,
|
939 |
+
"id": "fcb41708",
|
940 |
+
"metadata": {},
|
941 |
+
"outputs": [],
|
942 |
+
"source": []
|
943 |
+
},
|
944 |
+
{
|
945 |
+
"cell_type": "code",
|
946 |
+
"execution_count": null,
|
947 |
+
"id": "1ad5624e",
|
948 |
+
"metadata": {},
|
949 |
+
"outputs": [],
|
950 |
+
"source": []
|
951 |
+
},
|
952 |
+
{
|
953 |
+
"cell_type": "code",
|
954 |
+
"execution_count": null,
|
955 |
+
"id": "26527272",
|
956 |
+
"metadata": {},
|
957 |
+
"outputs": [],
|
958 |
+
"source": [
|
959 |
+
"import glob\n",
|
960 |
+
"from scipy.io import loadmat\n",
|
961 |
+
"from scipy.stats import pearsonr, spearmanr\n",
|
962 |
+
"from sklearn.preprocessing import MinMaxScaler\n",
|
963 |
+
"\n",
|
964 |
+
"scaler = MinMaxScaler()"
|
965 |
+
]
|
966 |
+
},
|
967 |
+
{
|
968 |
+
"cell_type": "code",
|
969 |
+
"execution_count": null,
|
970 |
+
"id": "3938f5cb",
|
971 |
+
"metadata": {},
|
972 |
+
"outputs": [],
|
973 |
+
"source": [
|
974 |
+
"\n",
|
975 |
+
"y_faces = {}\n",
|
976 |
+
"\n",
|
977 |
+
"for filename in glob.glob('/home/pranjul/DeepGaze/heatmaps/faces/*.mat'): #assuming gif\n",
|
978 |
+
" \n",
|
979 |
+
" fn=loadmat(filename)\n",
|
980 |
+
" y_faces[filename.split('/')[-1].split('.')[0]] = fn\n",
|
981 |
+
" #break"
|
982 |
+
]
|
983 |
+
},
|
984 |
+
{
|
985 |
+
"cell_type": "code",
|
986 |
+
"execution_count": null,
|
987 |
+
"id": "c5902106",
|
988 |
+
"metadata": {},
|
989 |
+
"outputs": [],
|
990 |
+
"source": [
|
991 |
+
"\n",
|
992 |
+
"y_objects = {}\n",
|
993 |
+
"\n",
|
994 |
+
"for filename in glob.glob('/home/pranjul/DeepGaze/heatmaps/objects/*.mat'): #assuming gif\n",
|
995 |
+
" \n",
|
996 |
+
" fn=loadmat(filename)\n",
|
997 |
+
" y_objects[filename.split('/')[-1].split('.')[0]] = fn\n",
|
998 |
+
" #break"
|
999 |
+
]
|
1000 |
+
},
|
1001 |
+
{
|
1002 |
+
"cell_type": "code",
|
1003 |
+
"execution_count": null,
|
1004 |
+
"id": "e6fa7c47",
|
1005 |
+
"metadata": {},
|
1006 |
+
"outputs": [],
|
1007 |
+
"source": [
|
1008 |
+
"\n",
|
1009 |
+
"y_pareidolia = {}\n",
|
1010 |
+
"\n",
|
1011 |
+
"for filename in glob.glob('/home/pranjul/DeepGaze/heatmaps/pareidolia/*.mat'): #assuming gif\n",
|
1012 |
+
" \n",
|
1013 |
+
" fn=loadmat(filename)\n",
|
1014 |
+
" y_pareidolia[filename.split('/')[-1].split('.')[0]] = fn\n",
|
1015 |
+
" #break"
|
1016 |
+
]
|
1017 |
+
},
|
1018 |
+
{
|
1019 |
+
"cell_type": "code",
|
1020 |
+
"execution_count": null,
|
1021 |
+
"id": "90d31035",
|
1022 |
+
"metadata": {},
|
1023 |
+
"outputs": [],
|
1024 |
+
"source": [
|
1025 |
+
"y_pareidolia['2']['a']"
|
1026 |
+
]
|
1027 |
+
},
|
1028 |
+
{
|
1029 |
+
"cell_type": "code",
|
1030 |
+
"execution_count": null,
|
1031 |
+
"id": "bcf0f6dc",
|
1032 |
+
"metadata": {},
|
1033 |
+
"outputs": [],
|
1034 |
+
"source": [
|
1035 |
+
"y_pareidolia['2']['a'].shape"
|
1036 |
+
]
|
1037 |
+
},
|
1038 |
+
{
|
1039 |
+
"cell_type": "code",
|
1040 |
+
"execution_count": null,
|
1041 |
+
"id": "c416a753",
|
1042 |
+
"metadata": {},
|
1043 |
+
"outputs": [],
|
1044 |
+
"source": [
|
1045 |
+
"plt.imshow(y_pareidolia['2']['a'])\n",
|
1046 |
+
"plt.axis('off')\n",
|
1047 |
+
"plt.colorbar(fraction=0.046, pad=0.04) # Adjust fraction and pad values as needed\n",
|
1048 |
+
"plt.tight_layout()\n",
|
1049 |
+
"#plt.savefig('HG_mars_face.png', dpi=600)"
|
1050 |
+
]
|
1051 |
+
},
|
1052 |
+
{
|
1053 |
+
"cell_type": "code",
|
1054 |
+
"execution_count": null,
|
1055 |
+
"id": "f0a6bda6",
|
1056 |
+
"metadata": {},
|
1057 |
+
"outputs": [],
|
1058 |
+
"source": [
|
1059 |
+
"spearmanr([3,4,5,6,7], [1,2,3,4,5])"
|
1060 |
+
]
|
1061 |
+
},
|
1062 |
+
{
|
1063 |
+
"cell_type": "code",
|
1064 |
+
"execution_count": null,
|
1065 |
+
"id": "40524e56",
|
1066 |
+
"metadata": {},
|
1067 |
+
"outputs": [],
|
1068 |
+
"source": []
|
1069 |
+
},
|
1070 |
+
{
|
1071 |
+
"cell_type": "code",
|
1072 |
+
"execution_count": null,
|
1073 |
+
"id": "5b89081d",
|
1074 |
+
"metadata": {},
|
1075 |
+
"outputs": [],
|
1076 |
+
"source": [
|
1077 |
+
"ke = []\n",
|
1078 |
+
"for k in range(len(x_loaded)):\n",
|
1079 |
+
" if x_loaded[k][1] in y_faces:\n",
|
1080 |
+
" #print(k)\n",
|
1081 |
+
" ke.append(k)\n",
|
1082 |
+
" "
|
1083 |
+
]
|
1084 |
+
},
|
1085 |
+
{
|
1086 |
+
"cell_type": "code",
|
1087 |
+
"execution_count": null,
|
1088 |
+
"id": "a5f6584d",
|
1089 |
+
"metadata": {},
|
1090 |
+
"outputs": [],
|
1091 |
+
"source": [
|
1092 |
+
"x_loaded[2][3].flatten().shape"
|
1093 |
+
]
|
1094 |
+
},
|
1095 |
+
{
|
1096 |
+
"cell_type": "code",
|
1097 |
+
"execution_count": null,
|
1098 |
+
"id": "726784f7",
|
1099 |
+
"metadata": {},
|
1100 |
+
"outputs": [],
|
1101 |
+
"source": []
|
1102 |
+
},
|
1103 |
+
{
|
1104 |
+
"cell_type": "code",
|
1105 |
+
"execution_count": null,
|
1106 |
+
"id": "aadc4268",
|
1107 |
+
"metadata": {},
|
1108 |
+
"outputs": [],
|
1109 |
+
"source": [
|
1110 |
+
"len(x)"
|
1111 |
+
]
|
1112 |
+
},
|
1113 |
+
{
|
1114 |
+
"cell_type": "code",
|
1115 |
+
"execution_count": null,
|
1116 |
+
"id": "c36eb153",
|
1117 |
+
"metadata": {},
|
1118 |
+
"outputs": [],
|
1119 |
+
"source": [
|
1120 |
+
"len(ke)"
|
1121 |
+
]
|
1122 |
+
},
|
1123 |
+
{
|
1124 |
+
"cell_type": "code",
|
1125 |
+
"execution_count": null,
|
1126 |
+
"id": "a2166932",
|
1127 |
+
"metadata": {
|
1128 |
+
"scrolled": true
|
1129 |
+
},
|
1130 |
+
"outputs": [],
|
1131 |
+
"source": [
|
1132 |
+
"#dg_faces = []\n",
|
1133 |
+
"#eg_faces = []\n",
|
1134 |
+
"ke_faces = []\n",
|
1135 |
+
"correlation_coef_faces = []\n",
|
1136 |
+
"\n",
|
1137 |
+
"for k in range(len(x_loaded_q_reshaped)):\n",
|
1138 |
+
" if x_loaded_q_reshaped[k][1] in y_faces:\n",
|
1139 |
+
" #print(k)\n",
|
1140 |
+
" ke_faces.append(k)\n",
|
1141 |
+
" #print(np.shape(x[k]))\n",
|
1142 |
+
" #print(y_faces[k])\n",
|
1143 |
+
" #dg_faces.append(scaler.fit_transform(np.array(x[k])).flatten())\n",
|
1144 |
+
" #eg_faces.append(scaler.fit_transform(np.array(y_faces[k]['a'])).flatten())\n",
|
1145 |
+
" correlation_coef_faces.append(spearmanr(x_loaded_q_reshaped[k][0].flatten(),\n",
|
1146 |
+
" x_loaded_q_reshaped[k][3].flatten())[0])\n",
|
1147 |
+
" #correlation_coef = spearmanr(np.array(dg_faces).flatten(), np.array(eg_faces).flatten())\n",
|
1148 |
+
"\n",
|
1149 |
+
" #break\n",
|
1150 |
+
"\n",
|
1151 |
+
"#spearmanr(scaler.fit_transform(cv2.resize(x['1397'], (800, 600))).flatten(), scaler.fit_transform(y_faces['1397']['a']).flatten())[0]\n",
|
1152 |
+
"\n",
|
1153 |
+
" \n",
|
1154 |
+
"# correlation_coef, p_value = spearmanr(np.array(dg_faces).flatten(), np.array(eg_faces).flatten())\n",
|
1155 |
+
"# correlation_coef = np.corrcoef(np.array(dg_faces).flatten(), np.array(eg_faces).flatten())\n",
|
1156 |
+
"# print(\"Correlation coefficient:\", correlation_coef)\n",
|
1157 |
+
"# print(\"p-value:\", p_value)"
|
1158 |
+
]
|
1159 |
+
},
|
1160 |
+
{
|
1161 |
+
"cell_type": "code",
|
1162 |
+
"execution_count": null,
|
1163 |
+
"id": "c0881d58",
|
1164 |
+
"metadata": {
|
1165 |
+
"scrolled": true
|
1166 |
+
},
|
1167 |
+
"outputs": [],
|
1168 |
+
"source": [
|
1169 |
+
"correlation_coef_faces"
|
1170 |
+
]
|
1171 |
+
},
|
1172 |
+
{
|
1173 |
+
"cell_type": "code",
|
1174 |
+
"execution_count": null,
|
1175 |
+
"id": "723cc7fe",
|
1176 |
+
"metadata": {},
|
1177 |
+
"outputs": [],
|
1178 |
+
"source": [
|
1179 |
+
"np.mean(correlation_coef_faces)"
|
1180 |
+
]
|
1181 |
+
},
|
1182 |
+
{
|
1183 |
+
"cell_type": "code",
|
1184 |
+
"execution_count": null,
|
1185 |
+
"id": "52e9c3ac",
|
1186 |
+
"metadata": {},
|
1187 |
+
"outputs": [],
|
1188 |
+
"source": [
|
1189 |
+
"np.std(correlation_coef_faces)"
|
1190 |
+
]
|
1191 |
+
},
|
1192 |
+
{
|
1193 |
+
"cell_type": "code",
|
1194 |
+
"execution_count": null,
|
1195 |
+
"id": "c187f3a1",
|
1196 |
+
"metadata": {
|
1197 |
+
"scrolled": true
|
1198 |
+
},
|
1199 |
+
"outputs": [],
|
1200 |
+
"source": [
|
1201 |
+
"plt.plot(correlation_coef_faces, 'o')"
|
1202 |
+
]
|
1203 |
+
},
|
1204 |
+
{
|
1205 |
+
"cell_type": "code",
|
1206 |
+
"execution_count": null,
|
1207 |
+
"id": "70a4ecfb",
|
1208 |
+
"metadata": {
|
1209 |
+
"scrolled": true
|
1210 |
+
},
|
1211 |
+
"outputs": [],
|
1212 |
+
"source": [
|
1213 |
+
"len(correlation_coef_faces)"
|
1214 |
+
]
|
1215 |
+
},
|
1216 |
+
{
|
1217 |
+
"cell_type": "code",
|
1218 |
+
"execution_count": null,
|
1219 |
+
"id": "77266844",
|
1220 |
+
"metadata": {
|
1221 |
+
"scrolled": true
|
1222 |
+
},
|
1223 |
+
"outputs": [],
|
1224 |
+
"source": [
|
1225 |
+
"#dg_objects = []\n",
|
1226 |
+
"#eg_objects = []\n",
|
1227 |
+
"ke_objects = []\n",
|
1228 |
+
"correlation_coef_objects = []\n",
|
1229 |
+
"\n",
|
1230 |
+
"for k in range(len(x_loaded_q_reshaped)):\n",
|
1231 |
+
" if x_loaded_q_reshaped[k][1] in y_objects:\n",
|
1232 |
+
" #print(k)\n",
|
1233 |
+
" ke_objects.append(k)\n",
|
1234 |
+
" #print(np.shape(x[k]))\n",
|
1235 |
+
" #print(y_faces[k])\n",
|
1236 |
+
" #dg_objects.append(np.array(x[k]).flatten())\n",
|
1237 |
+
" #eg_objects.append(np.array(y_objects[k]['a']).flatten())\n",
|
1238 |
+
" correlation_coef_objects.append(spearmanr(x_loaded_q_reshaped[k][0].flatten(), \n",
|
1239 |
+
" x_loaded_q_reshaped[k][3].flatten())[0])\n",
|
1240 |
+
"\n",
|
1241 |
+
" #break\n",
|
1242 |
+
"\n",
|
1243 |
+
"#correlation_coef, p_value = spearmanr(np.array(dg_objects).flatten(), np.array(eg_objects).flatten())\n",
|
1244 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1245 |
+
"# print(\"Correlation coefficient:\", correlation_coef)\n",
|
1246 |
+
"# print(\"p-value:\", p_value)"
|
1247 |
+
]
|
1248 |
+
},
|
1249 |
+
{
|
1250 |
+
"cell_type": "code",
|
1251 |
+
"execution_count": null,
|
1252 |
+
"id": "d5f30f29",
|
1253 |
+
"metadata": {},
|
1254 |
+
"outputs": [],
|
1255 |
+
"source": []
|
1256 |
+
},
|
1257 |
+
{
|
1258 |
+
"cell_type": "code",
|
1259 |
+
"execution_count": null,
|
1260 |
+
"id": "df8da20e",
|
1261 |
+
"metadata": {},
|
1262 |
+
"outputs": [],
|
1263 |
+
"source": [
|
1264 |
+
"np.mean(correlation_coef_objects)"
|
1265 |
+
]
|
1266 |
+
},
|
1267 |
+
{
|
1268 |
+
"cell_type": "code",
|
1269 |
+
"execution_count": null,
|
1270 |
+
"id": "f4c9834d",
|
1271 |
+
"metadata": {
|
1272 |
+
"scrolled": true
|
1273 |
+
},
|
1274 |
+
"outputs": [],
|
1275 |
+
"source": [
|
1276 |
+
"np.std(correlation_coef_objects)"
|
1277 |
+
]
|
1278 |
+
},
|
1279 |
+
{
|
1280 |
+
"cell_type": "code",
|
1281 |
+
"execution_count": null,
|
1282 |
+
"id": "9465aa0e",
|
1283 |
+
"metadata": {},
|
1284 |
+
"outputs": [],
|
1285 |
+
"source": [
|
1286 |
+
"plt.plot(correlation_coef_objects, 'o')"
|
1287 |
+
]
|
1288 |
+
},
|
1289 |
+
{
|
1290 |
+
"cell_type": "code",
|
1291 |
+
"execution_count": null,
|
1292 |
+
"id": "beb428b2",
|
1293 |
+
"metadata": {
|
1294 |
+
"scrolled": true
|
1295 |
+
},
|
1296 |
+
"outputs": [],
|
1297 |
+
"source": [
|
1298 |
+
"correlation_coef_objects"
|
1299 |
+
]
|
1300 |
+
},
|
1301 |
+
{
|
1302 |
+
"cell_type": "code",
|
1303 |
+
"execution_count": null,
|
1304 |
+
"id": "802ebc6d",
|
1305 |
+
"metadata": {},
|
1306 |
+
"outputs": [],
|
1307 |
+
"source": [
|
1308 |
+
"len(correlation_coef_objects)"
|
1309 |
+
]
|
1310 |
+
},
|
1311 |
+
{
|
1312 |
+
"cell_type": "code",
|
1313 |
+
"execution_count": null,
|
1314 |
+
"id": "0403de67",
|
1315 |
+
"metadata": {
|
1316 |
+
"scrolled": true
|
1317 |
+
},
|
1318 |
+
"outputs": [],
|
1319 |
+
"source": [
|
1320 |
+
"#dg_pareidolia = []\n",
|
1321 |
+
"#eg_pareidolia = []\n",
|
1322 |
+
"ke_pareidolia = []\n",
|
1323 |
+
"correlation_coef_pareidolia = []\n",
|
1324 |
+
"\n",
|
1325 |
+
"for k in range(len(x_loaded_q_reshaped)):\n",
|
1326 |
+
" if x_loaded_q_reshaped[k][1] in y_pareidolia:\n",
|
1327 |
+
" #print(k)\n",
|
1328 |
+
" ke_pareidolia.append(k)\n",
|
1329 |
+
" # print(np.shape(x[k]))\n",
|
1330 |
+
" # print(y_faces[k])\n",
|
1331 |
+
" # dg_pareidolia.append(scaler.fit_transform(np.array(x[k])).flatten())\n",
|
1332 |
+
" # eg_pareidolia.append(scaler.fit_transform(np.array(y_pareidolia[k]['a'])).flatten())\n",
|
1333 |
+
" correlation_coef_pareidolia.append(spearmanr(x_loaded_q_reshaped[k][0].flatten(), \n",
|
1334 |
+
" x_loaded_q_reshaped[k][3].flatten())[0])\n",
|
1335 |
+
" \n",
|
1336 |
+
" #break\n",
|
1337 |
+
"\n",
|
1338 |
+
"# correlation_coef, p_value = spearmanr(np.array(dg_pareidolia).flatten(), np.array(eg_pareidolia).flatten())\n",
|
1339 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1340 |
+
"# print(\"Correlation coefficient:\", correlation_coef)\n",
|
1341 |
+
"# print(\"p-value:\", p_value)"
|
1342 |
+
]
|
1343 |
+
},
|
1344 |
+
{
|
1345 |
+
"cell_type": "code",
|
1346 |
+
"execution_count": null,
|
1347 |
+
"id": "14e6d358",
|
1348 |
+
"metadata": {},
|
1349 |
+
"outputs": [],
|
1350 |
+
"source": [
|
1351 |
+
"np.mean(correlation_coef_pareidolia)"
|
1352 |
+
]
|
1353 |
+
},
|
1354 |
+
{
|
1355 |
+
"cell_type": "code",
|
1356 |
+
"execution_count": null,
|
1357 |
+
"id": "30812b76",
|
1358 |
+
"metadata": {},
|
1359 |
+
"outputs": [],
|
1360 |
+
"source": [
|
1361 |
+
"np.std(correlation_coef_pareidolia)"
|
1362 |
+
]
|
1363 |
+
},
|
1364 |
+
{
|
1365 |
+
"cell_type": "code",
|
1366 |
+
"execution_count": null,
|
1367 |
+
"id": "ab74cd89",
|
1368 |
+
"metadata": {},
|
1369 |
+
"outputs": [],
|
1370 |
+
"source": [
|
1371 |
+
"plt.plot(correlation_coef_pareidolia, 'o')"
|
1372 |
+
]
|
1373 |
+
},
|
1374 |
+
{
|
1375 |
+
"cell_type": "code",
|
1376 |
+
"execution_count": null,
|
1377 |
+
"id": "c4980b11",
|
1378 |
+
"metadata": {},
|
1379 |
+
"outputs": [],
|
1380 |
+
"source": [
|
1381 |
+
"len(correlation_coef_pareidolia)"
|
1382 |
+
]
|
1383 |
+
},
|
1384 |
+
{
|
1385 |
+
"cell_type": "code",
|
1386 |
+
"execution_count": null,
|
1387 |
+
"id": "10f01cdd",
|
1388 |
+
"metadata": {},
|
1389 |
+
"outputs": [],
|
1390 |
+
"source": [
|
1391 |
+
"303+252+297"
|
1392 |
+
]
|
1393 |
+
},
|
1394 |
+
{
|
1395 |
+
"cell_type": "code",
|
1396 |
+
"execution_count": null,
|
1397 |
+
"id": "98aa156c",
|
1398 |
+
"metadata": {
|
1399 |
+
"scrolled": false
|
1400 |
+
},
|
1401 |
+
"outputs": [],
|
1402 |
+
"source": [
|
1403 |
+
"import pandas as pd\n",
|
1404 |
+
"\n",
|
1405 |
+
"# Sample data with different lengths\n",
|
1406 |
+
"#correlation_coef_faces = [0.5, 0.6, 0.7]\n",
|
1407 |
+
"#correlation_coef_objects = [0.3, 0.4]\n",
|
1408 |
+
"#correlation_coef_pareidolia = [0.2, 0.3, 0.1, 0.4]\n",
|
1409 |
+
"\n",
|
1410 |
+
"# Create a DataFrame with a common index\n",
|
1411 |
+
"index = range(max(len(correlation_coef_faces), len(correlation_coef_objects), len(correlation_coef_pareidolia)))\n",
|
1412 |
+
"\n",
|
1413 |
+
"data = {\n",
|
1414 |
+
" 'sr_f': correlation_coef_faces + [None] * (len(index) - len(correlation_coef_faces)),\n",
|
1415 |
+
" 'sr_o': correlation_coef_objects + [None] * (len(index) - len(correlation_coef_objects)),\n",
|
1416 |
+
" 'sr_p': correlation_coef_pareidolia + [None] * (len(index) - len(correlation_coef_pareidolia))\n",
|
1417 |
+
"}\n",
|
1418 |
+
"\n",
|
1419 |
+
"df = pd.DataFrame(data, index=index)\n",
|
1420 |
+
"\n",
|
1421 |
+
"# Specify the file name\n",
|
1422 |
+
"csv_file = 'data.csv'\n",
|
1423 |
+
"\n",
|
1424 |
+
"# Save DataFrame to CSV file\n",
|
1425 |
+
"df.to_csv(csv_file)\n",
|
1426 |
+
"\n",
|
1427 |
+
"print(f'Data saved to {csv_file}')\n"
|
1428 |
+
]
|
1429 |
+
},
|
1430 |
+
{
|
1431 |
+
"cell_type": "code",
|
1432 |
+
"execution_count": null,
|
1433 |
+
"id": "37692ab8",
|
1434 |
+
"metadata": {},
|
1435 |
+
"outputs": [],
|
1436 |
+
"source": [
|
1437 |
+
"import csv\n",
|
1438 |
+
"\n",
|
1439 |
+
"# Sample data\n",
|
1440 |
+
"data = [\n",
|
1441 |
+
" ['Name', 'Age', 'City'],\n",
|
1442 |
+
" ['Alice', 28, 'New York'],\n",
|
1443 |
+
" ['Bob', 35, 'Los Angeles'],\n",
|
1444 |
+
" ['Charlie', 22, 'Chicago']\n",
|
1445 |
+
"]\n",
|
1446 |
+
"\n",
|
1447 |
+
"# Specify the file name\n",
|
1448 |
+
"csv_file = 'data.csv'\n",
|
1449 |
+
"\n",
|
1450 |
+
"# Write data to CSV file\n",
|
1451 |
+
"with open(csv_file, mode='w', newline='') as file:\n",
|
1452 |
+
" writer = csv.writer(file)\n",
|
1453 |
+
" writer.writerows(data)\n",
|
1454 |
+
"\n",
|
1455 |
+
"print(f'Data saved to {csv_file}')\n"
|
1456 |
+
]
|
1457 |
+
},
|
1458 |
+
{
|
1459 |
+
"cell_type": "code",
|
1460 |
+
"execution_count": null,
|
1461 |
+
"id": "f8816fcc",
|
1462 |
+
"metadata": {},
|
1463 |
+
"outputs": [],
|
1464 |
+
"source": []
|
1465 |
+
},
|
1466 |
+
{
|
1467 |
+
"cell_type": "code",
|
1468 |
+
"execution_count": null,
|
1469 |
+
"id": "1d73414c",
|
1470 |
+
"metadata": {},
|
1471 |
+
"outputs": [],
|
1472 |
+
"source": []
|
1473 |
+
},
|
1474 |
+
{
|
1475 |
+
"cell_type": "code",
|
1476 |
+
"execution_count": null,
|
1477 |
+
"id": "0e53bda0",
|
1478 |
+
"metadata": {},
|
1479 |
+
"outputs": [],
|
1480 |
+
"source": []
|
1481 |
+
},
|
1482 |
+
{
|
1483 |
+
"cell_type": "code",
|
1484 |
+
"execution_count": null,
|
1485 |
+
"id": "7fe39537",
|
1486 |
+
"metadata": {},
|
1487 |
+
"outputs": [],
|
1488 |
+
"source": []
|
1489 |
+
},
|
1490 |
+
{
|
1491 |
+
"cell_type": "code",
|
1492 |
+
"execution_count": null,
|
1493 |
+
"id": "6a51040d",
|
1494 |
+
"metadata": {},
|
1495 |
+
"outputs": [],
|
1496 |
+
"source": []
|
1497 |
+
},
|
1498 |
+
{
|
1499 |
+
"cell_type": "code",
|
1500 |
+
"execution_count": null,
|
1501 |
+
"id": "89a93508",
|
1502 |
+
"metadata": {},
|
1503 |
+
"outputs": [],
|
1504 |
+
"source": []
|
1505 |
+
},
|
1506 |
+
{
|
1507 |
+
"cell_type": "code",
|
1508 |
+
"execution_count": null,
|
1509 |
+
"id": "c297d11a",
|
1510 |
+
"metadata": {},
|
1511 |
+
"outputs": [],
|
1512 |
+
"source": [
|
1513 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_faces).flatten(), np.array(eg_faces).flatten())\n",
|
1514 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1515 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1516 |
+
"print(\"p-value:\", p_value)"
|
1517 |
+
]
|
1518 |
+
},
|
1519 |
+
{
|
1520 |
+
"cell_type": "code",
|
1521 |
+
"execution_count": null,
|
1522 |
+
"id": "85e5edb2",
|
1523 |
+
"metadata": {},
|
1524 |
+
"outputs": [],
|
1525 |
+
"source": [
|
1526 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_objects).flatten(), np.array(eg_objects).flatten())\n",
|
1527 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1528 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1529 |
+
"print(\"p-value:\", p_value)"
|
1530 |
+
]
|
1531 |
+
},
|
1532 |
+
{
|
1533 |
+
"cell_type": "code",
|
1534 |
+
"execution_count": null,
|
1535 |
+
"id": "d99c7309",
|
1536 |
+
"metadata": {},
|
1537 |
+
"outputs": [],
|
1538 |
+
"source": [
|
1539 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_pareidolia).flatten(), np.array(eg_pareidolia).flatten())\n",
|
1540 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1541 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1542 |
+
"print(\"p-value:\", p_value)"
|
1543 |
+
]
|
1544 |
+
},
|
1545 |
+
{
|
1546 |
+
"cell_type": "code",
|
1547 |
+
"execution_count": null,
|
1548 |
+
"id": "e9702314",
|
1549 |
+
"metadata": {},
|
1550 |
+
"outputs": [],
|
1551 |
+
"source": [
|
1552 |
+
"len(dg_pareidolia)"
|
1553 |
+
]
|
1554 |
+
},
|
1555 |
+
{
|
1556 |
+
"cell_type": "code",
|
1557 |
+
"execution_count": null,
|
1558 |
+
"id": "c319f00b",
|
1559 |
+
"metadata": {},
|
1560 |
+
"outputs": [],
|
1561 |
+
"source": [
|
1562 |
+
"len(dg_faces[:83])"
|
1563 |
+
]
|
1564 |
+
},
|
1565 |
+
{
|
1566 |
+
"cell_type": "code",
|
1567 |
+
"execution_count": null,
|
1568 |
+
"id": "1fa45e93",
|
1569 |
+
"metadata": {},
|
1570 |
+
"outputs": [],
|
1571 |
+
"source": [
|
1572 |
+
"len(dg_objects[:83])"
|
1573 |
+
]
|
1574 |
+
},
|
1575 |
+
{
|
1576 |
+
"cell_type": "code",
|
1577 |
+
"execution_count": null,
|
1578 |
+
"id": "5e9fd2b6",
|
1579 |
+
"metadata": {},
|
1580 |
+
"outputs": [],
|
1581 |
+
"source": [
|
1582 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_faces[:83]).flatten(), np.array(dg_objects[:83]).flatten())\n",
|
1583 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1584 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1585 |
+
"print(\"p-value:\", p_value)"
|
1586 |
+
]
|
1587 |
+
},
|
1588 |
+
{
|
1589 |
+
"cell_type": "code",
|
1590 |
+
"execution_count": null,
|
1591 |
+
"id": "a9357f4f",
|
1592 |
+
"metadata": {},
|
1593 |
+
"outputs": [],
|
1594 |
+
"source": [
|
1595 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_faces[:83]).flatten(), np.array(dg_pareidolia[:83]).flatten())\n",
|
1596 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1597 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1598 |
+
"print(\"p-value:\", p_value)"
|
1599 |
+
]
|
1600 |
+
},
|
1601 |
+
{
|
1602 |
+
"cell_type": "code",
|
1603 |
+
"execution_count": null,
|
1604 |
+
"id": "f70021f3",
|
1605 |
+
"metadata": {},
|
1606 |
+
"outputs": [],
|
1607 |
+
"source": [
|
1608 |
+
"correlation_coef, p_value = spearmanr(np.array(dg_pareidolia[:83]).flatten(), np.array(dg_objects[:83]).flatten())\n",
|
1609 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1610 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1611 |
+
"print(\"p-value:\", p_value)"
|
1612 |
+
]
|
1613 |
+
},
|
1614 |
+
{
|
1615 |
+
"cell_type": "code",
|
1616 |
+
"execution_count": null,
|
1617 |
+
"id": "0df004a4",
|
1618 |
+
"metadata": {},
|
1619 |
+
"outputs": [],
|
1620 |
+
"source": [
|
1621 |
+
"correlation_coef, p_value = spearmanr(np.array(eg_pareidolia[:83]).flatten(), np.array(eg_objects[:83]).flatten())\n",
|
1622 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1623 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1624 |
+
"print(\"p-value:\", p_value)"
|
1625 |
+
]
|
1626 |
+
},
|
1627 |
+
{
|
1628 |
+
"cell_type": "code",
|
1629 |
+
"execution_count": null,
|
1630 |
+
"id": "1742ecb1",
|
1631 |
+
"metadata": {},
|
1632 |
+
"outputs": [],
|
1633 |
+
"source": [
|
1634 |
+
"correlation_coef, p_value = spearmanr(np.array(eg_pareidolia[:83]).flatten(), np.array(eg_faces[:83]).flatten())\n",
|
1635 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1636 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1637 |
+
"print(\"p-value:\", p_value)"
|
1638 |
+
]
|
1639 |
+
},
|
1640 |
+
{
|
1641 |
+
"cell_type": "code",
|
1642 |
+
"execution_count": null,
|
1643 |
+
"id": "0a02bf88",
|
1644 |
+
"metadata": {},
|
1645 |
+
"outputs": [],
|
1646 |
+
"source": [
|
1647 |
+
"correlation_coef, p_value = spearmanr(np.array(eg_faces[:83]).flatten(), np.array(eg_objects[:83]).flatten())\n",
|
1648 |
+
"# correlation_coef = np.corrcoef(a, b)\n",
|
1649 |
+
"print(\"Correlation coefficient:\", correlation_coef)\n",
|
1650 |
+
"print(\"p-value:\", p_value)"
|
1651 |
+
]
|
1652 |
+
},
|
1653 |
+
{
|
1654 |
+
"cell_type": "code",
|
1655 |
+
"execution_count": null,
|
1656 |
+
"id": "b7ccd13e",
|
1657 |
+
"metadata": {},
|
1658 |
+
"outputs": [],
|
1659 |
+
"source": []
|
1660 |
+
},
|
1661 |
+
{
|
1662 |
+
"cell_type": "code",
|
1663 |
+
"execution_count": null,
|
1664 |
+
"id": "fdeb2fc5",
|
1665 |
+
"metadata": {},
|
1666 |
+
"outputs": [],
|
1667 |
+
"source": []
|
1668 |
+
},
|
1669 |
+
{
|
1670 |
+
"cell_type": "code",
|
1671 |
+
"execution_count": null,
|
1672 |
+
"id": "7faa17c1",
|
1673 |
+
"metadata": {},
|
1674 |
+
"outputs": [],
|
1675 |
+
"source": []
|
1676 |
+
},
|
1677 |
+
{
|
1678 |
+
"cell_type": "code",
|
1679 |
+
"execution_count": null,
|
1680 |
+
"id": "f9af3d41",
|
1681 |
+
"metadata": {},
|
1682 |
+
"outputs": [],
|
1683 |
+
"source": [
|
1684 |
+
"import numpy as np\n",
|
1685 |
+
"from scipy.stats import spearmanr\n",
|
1686 |
+
"\n",
|
1687 |
+
"# Generate two arrays with random data\n",
|
1688 |
+
"array1 = np.random.rand(100)\n",
|
1689 |
+
"array2 = np.random.rand(100)\n",
|
1690 |
+
"\n",
|
1691 |
+
"# Calculate Spearman's correlation coefficient and p-value\n",
|
1692 |
+
"correlation, p_value = spearmanr(array1, array2)\n",
|
1693 |
+
"\n",
|
1694 |
+
"print(\"Spearman's correlation coefficient:\", correlation)\n",
|
1695 |
+
"print(\"p-value:\", p_value)\n"
|
1696 |
+
]
|
1697 |
+
},
|
1698 |
+
{
|
1699 |
+
"cell_type": "code",
|
1700 |
+
"execution_count": null,
|
1701 |
+
"id": "f7cd0d61",
|
1702 |
+
"metadata": {},
|
1703 |
+
"outputs": [],
|
1704 |
+
"source": []
|
1705 |
+
},
|
1706 |
+
{
|
1707 |
+
"cell_type": "code",
|
1708 |
+
"execution_count": null,
|
1709 |
+
"id": "3570f454",
|
1710 |
+
"metadata": {},
|
1711 |
+
"outputs": [],
|
1712 |
+
"source": []
|
1713 |
+
},
|
1714 |
+
{
|
1715 |
+
"cell_type": "code",
|
1716 |
+
"execution_count": null,
|
1717 |
+
"id": "3a0a92be",
|
1718 |
+
"metadata": {},
|
1719 |
+
"outputs": [],
|
1720 |
+
"source": [
|
1721 |
+
"import numpy as np\n",
|
1722 |
+
"from scipy.stats import pearsonr\n",
|
1723 |
+
"\n",
|
1724 |
+
"# define two eye gaze heatmaps\n",
|
1725 |
+
"heatmap1 = np.array([[0.2, 0.3, 0.1],\n",
|
1726 |
+
" [0.1, 0.4, 0.3],\n",
|
1727 |
+
" [0.3, 0.2, 0.1]])\n",
|
1728 |
+
"\n",
|
1729 |
+
"heatmap2 = np.array([[0.1, 0.2, 0.3],\n",
|
1730 |
+
" [0.2, 0.3, 0.2],\n",
|
1731 |
+
" [0.3, 0.1, 0.1]])\n",
|
1732 |
+
"\n",
|
1733 |
+
"# flatten the heatmaps into 1D arrays\n",
|
1734 |
+
"flat_heatmap1 = heatmap1.flatten()\n",
|
1735 |
+
"flat_heatmap2 = heatmap2.flatten()\n",
|
1736 |
+
"\n",
|
1737 |
+
"# calculate the Pearson correlation coefficient and p-value\n",
|
1738 |
+
"corr, p_value = pearsonr(flat_heatmap1, flat_heatmap2)\n",
|
1739 |
+
"\n",
|
1740 |
+
"print(\"Correlation coefficient:\", corr)\n",
|
1741 |
+
"print(\"p-value:\", p_value)\n"
|
1742 |
+
]
|
1743 |
+
},
|
1744 |
+
{
|
1745 |
+
"cell_type": "code",
|
1746 |
+
"execution_count": null,
|
1747 |
+
"id": "98a8e3c1",
|
1748 |
+
"metadata": {},
|
1749 |
+
"outputs": [],
|
1750 |
+
"source": [
|
1751 |
+
"np.shape(b)"
|
1752 |
+
]
|
1753 |
+
},
|
1754 |
+
{
|
1755 |
+
"cell_type": "code",
|
1756 |
+
"execution_count": null,
|
1757 |
+
"id": "55b352bd",
|
1758 |
+
"metadata": {},
|
1759 |
+
"outputs": [],
|
1760 |
+
"source": [
|
1761 |
+
"np.shape(a)"
|
1762 |
+
]
|
1763 |
+
},
|
1764 |
+
{
|
1765 |
+
"cell_type": "code",
|
1766 |
+
"execution_count": null,
|
1767 |
+
"id": "3fe648aa",
|
1768 |
+
"metadata": {},
|
1769 |
+
"outputs": [],
|
1770 |
+
"source": [
|
1771 |
+
"np.shape(correlation_coef)"
|
1772 |
+
]
|
1773 |
+
},
|
1774 |
+
{
|
1775 |
+
"cell_type": "code",
|
1776 |
+
"execution_count": null,
|
1777 |
+
"id": "cd8e091b",
|
1778 |
+
"metadata": {},
|
1779 |
+
"outputs": [],
|
1780 |
+
"source": [
|
1781 |
+
"plt.imshow(correlation_coef)"
|
1782 |
+
]
|
1783 |
+
},
|
1784 |
+
{
|
1785 |
+
"cell_type": "code",
|
1786 |
+
"execution_count": null,
|
1787 |
+
"id": "884bf73a",
|
1788 |
+
"metadata": {},
|
1789 |
+
"outputs": [],
|
1790 |
+
"source": [
|
1791 |
+
"correlation_coef[83:, :83]"
|
1792 |
+
]
|
1793 |
+
},
|
1794 |
+
{
|
1795 |
+
"cell_type": "code",
|
1796 |
+
"execution_count": null,
|
1797 |
+
"id": "4a540fa9",
|
1798 |
+
"metadata": {
|
1799 |
+
"scrolled": true
|
1800 |
+
},
|
1801 |
+
"outputs": [],
|
1802 |
+
"source": [
|
1803 |
+
"plt.imshow(correlation_coef[83:, :83])"
|
1804 |
+
]
|
1805 |
+
},
|
1806 |
+
{
|
1807 |
+
"cell_type": "code",
|
1808 |
+
"execution_count": null,
|
1809 |
+
"id": "62cadea8",
|
1810 |
+
"metadata": {},
|
1811 |
+
"outputs": [],
|
1812 |
+
"source": [
|
1813 |
+
"plt.plot(np.diagonal(correlation_coef[100:, :100]), 'o') #faces"
|
1814 |
+
]
|
1815 |
+
},
|
1816 |
+
{
|
1817 |
+
"cell_type": "code",
|
1818 |
+
"execution_count": null,
|
1819 |
+
"id": "f05bd895",
|
1820 |
+
"metadata": {},
|
1821 |
+
"outputs": [],
|
1822 |
+
"source": [
|
1823 |
+
"np.mean(np.diagonal(correlation_coef[100:, :100]))"
|
1824 |
+
]
|
1825 |
+
},
|
1826 |
+
{
|
1827 |
+
"cell_type": "code",
|
1828 |
+
"execution_count": null,
|
1829 |
+
"id": "6e227007",
|
1830 |
+
"metadata": {},
|
1831 |
+
"outputs": [],
|
1832 |
+
"source": [
|
1833 |
+
"plt.plot(np.diagonal(correlation_coef[100:, :100]), 'o') #obj"
|
1834 |
+
]
|
1835 |
+
},
|
1836 |
+
{
|
1837 |
+
"cell_type": "code",
|
1838 |
+
"execution_count": null,
|
1839 |
+
"id": "12ed25e7",
|
1840 |
+
"metadata": {},
|
1841 |
+
"outputs": [],
|
1842 |
+
"source": [
|
1843 |
+
"np.mean(np.diagonal(correlation_coef[86:, :86]))"
|
1844 |
+
]
|
1845 |
+
},
|
1846 |
+
{
|
1847 |
+
"cell_type": "code",
|
1848 |
+
"execution_count": null,
|
1849 |
+
"id": "ccf0a569",
|
1850 |
+
"metadata": {},
|
1851 |
+
"outputs": [],
|
1852 |
+
"source": [
|
1853 |
+
"plt.plot(np.diagonal(correlation_coef[83:, :83]), 'o') #pare"
|
1854 |
+
]
|
1855 |
+
},
|
1856 |
+
{
|
1857 |
+
"cell_type": "code",
|
1858 |
+
"execution_count": null,
|
1859 |
+
"id": "923ed911",
|
1860 |
+
"metadata": {},
|
1861 |
+
"outputs": [],
|
1862 |
+
"source": [
|
1863 |
+
"np.mean(np.diagonal(correlation_coef[83:, :83]))"
|
1864 |
+
]
|
1865 |
+
},
|
1866 |
+
{
|
1867 |
+
"cell_type": "code",
|
1868 |
+
"execution_count": null,
|
1869 |
+
"id": "27bac165",
|
1870 |
+
"metadata": {},
|
1871 |
+
"outputs": [],
|
1872 |
+
"source": []
|
1873 |
+
},
|
1874 |
+
{
|
1875 |
+
"cell_type": "code",
|
1876 |
+
"execution_count": null,
|
1877 |
+
"id": "f751bc29",
|
1878 |
+
"metadata": {},
|
1879 |
+
"outputs": [],
|
1880 |
+
"source": [
|
1881 |
+
"plt.imshow(y_objects['1153']['a'])"
|
1882 |
+
]
|
1883 |
+
},
|
1884 |
+
{
|
1885 |
+
"cell_type": "code",
|
1886 |
+
"execution_count": null,
|
1887 |
+
"id": "0c6a4bb4",
|
1888 |
+
"metadata": {},
|
1889 |
+
"outputs": [],
|
1890 |
+
"source": [
|
1891 |
+
"y_faces"
|
1892 |
+
]
|
1893 |
+
},
|
1894 |
+
{
|
1895 |
+
"cell_type": "code",
|
1896 |
+
"execution_count": null,
|
1897 |
+
"id": "40a93053",
|
1898 |
+
"metadata": {},
|
1899 |
+
"outputs": [],
|
1900 |
+
"source": []
|
1901 |
+
},
|
1902 |
+
{
|
1903 |
+
"cell_type": "code",
|
1904 |
+
"execution_count": null,
|
1905 |
+
"id": "4a9b5849",
|
1906 |
+
"metadata": {},
|
1907 |
+
"outputs": [],
|
1908 |
+
"source": []
|
1909 |
+
},
|
1910 |
+
{
|
1911 |
+
"cell_type": "code",
|
1912 |
+
"execution_count": null,
|
1913 |
+
"id": "76eee42b",
|
1914 |
+
"metadata": {},
|
1915 |
+
"outputs": [],
|
1916 |
+
"source": [
|
1917 |
+
"np.shape(imgs)"
|
1918 |
+
]
|
1919 |
+
},
|
1920 |
+
{
|
1921 |
+
"cell_type": "code",
|
1922 |
+
"execution_count": null,
|
1923 |
+
"id": "1cc44e0e",
|
1924 |
+
"metadata": {},
|
1925 |
+
"outputs": [],
|
1926 |
+
"source": []
|
1927 |
+
},
|
1928 |
+
{
|
1929 |
+
"cell_type": "code",
|
1930 |
+
"execution_count": null,
|
1931 |
+
"id": "1d14b8ad",
|
1932 |
+
"metadata": {},
|
1933 |
+
"outputs": [],
|
1934 |
+
"source": []
|
1935 |
+
},
|
1936 |
+
{
|
1937 |
+
"cell_type": "code",
|
1938 |
+
"execution_count": null,
|
1939 |
+
"id": "feddeb52",
|
1940 |
+
"metadata": {},
|
1941 |
+
"outputs": [],
|
1942 |
+
"source": [
|
1943 |
+
"import matplotlib.pyplot as plt\n",
|
1944 |
+
"import numpy as np\n",
|
1945 |
+
"from scipy.misc import face\n",
|
1946 |
+
"from scipy.ndimage import zoom\n",
|
1947 |
+
"from scipy.special import logsumexp\n",
|
1948 |
+
"import torch\n",
|
1949 |
+
"\n",
|
1950 |
+
"import deepgaze_pytorch\n",
|
1951 |
+
"\n",
|
1952 |
+
"DEVICE = 'cuda'\n",
|
1953 |
+
"\n",
|
1954 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
1955 |
+
"model = deepgaze_pytorch.DeepGazeIII(pretrained=True).to(DEVICE)\n",
|
1956 |
+
"\n",
|
1957 |
+
"image = face()\n",
|
1958 |
+
"\n",
|
1959 |
+
"# location of previous scanpath fixations in x and y (pixel coordinates), starting with the initial fixation on the image.\n",
|
1960 |
+
"fixation_history_x = np.array([1024//2, 300, 500, 200, 200, 700])\n",
|
1961 |
+
"fixation_history_y = np.array([768//2, 300, 100, 300, 100, 500])\n",
|
1962 |
+
"\n",
|
1963 |
+
"# load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
1964 |
+
"# you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
1965 |
+
"# alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
1966 |
+
"centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
1967 |
+
"# rescale to match image size\n",
|
1968 |
+
"centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
1969 |
+
"# renormalize log density\n",
|
1970 |
+
"centerbias -= logsumexp(centerbias)\n",
|
1971 |
+
"\n",
|
1972 |
+
"image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
1973 |
+
"centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
1974 |
+
"x_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
1975 |
+
"y_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
1976 |
+
"\n",
|
1977 |
+
"log_density_prediction = model(image_tensor, centerbias_tensor, x_hist_tensor, y_hist_tensor)\n",
|
1978 |
+
"\n",
|
1979 |
+
"f, axs = plt.subplots(nrows=1, ncols=2, figsize=(8, 3))\n",
|
1980 |
+
"axs[0].imshow(image)\n",
|
1981 |
+
"axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1982 |
+
"axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1983 |
+
"axs[0].set_axis_off()\n",
|
1984 |
+
"axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
1985 |
+
"axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1986 |
+
"axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1987 |
+
"axs[1].set_axis_off()"
|
1988 |
+
]
|
1989 |
+
},
|
1990 |
+
{
|
1991 |
+
"cell_type": "code",
|
1992 |
+
"execution_count": null,
|
1993 |
+
"id": "2b512963",
|
1994 |
+
"metadata": {},
|
1995 |
+
"outputs": [],
|
1996 |
+
"source": [
|
1997 |
+
"model.included_fixations"
|
1998 |
+
]
|
1999 |
+
},
|
2000 |
+
{
|
2001 |
+
"cell_type": "code",
|
2002 |
+
"execution_count": null,
|
2003 |
+
"id": "33d6872d",
|
2004 |
+
"metadata": {},
|
2005 |
+
"outputs": [],
|
2006 |
+
"source": [
|
2007 |
+
"fixation_history_x"
|
2008 |
+
]
|
2009 |
+
},
|
2010 |
+
{
|
2011 |
+
"cell_type": "code",
|
2012 |
+
"execution_count": null,
|
2013 |
+
"id": "8bce1d25",
|
2014 |
+
"metadata": {},
|
2015 |
+
"outputs": [],
|
2016 |
+
"source": [
|
2017 |
+
"fixation_history_x[model.included_fixations]"
|
2018 |
+
]
|
2019 |
+
},
|
2020 |
+
{
|
2021 |
+
"cell_type": "code",
|
2022 |
+
"execution_count": null,
|
2023 |
+
"id": "751cb04e",
|
2024 |
+
"metadata": {},
|
2025 |
+
"outputs": [],
|
2026 |
+
"source": []
|
2027 |
+
},
|
2028 |
+
{
|
2029 |
+
"cell_type": "code",
|
2030 |
+
"execution_count": null,
|
2031 |
+
"id": "b3160caa",
|
2032 |
+
"metadata": {},
|
2033 |
+
"outputs": [],
|
2034 |
+
"source": [
|
2035 |
+
"import matplotlib.pyplot as plt\n",
|
2036 |
+
"import numpy as np\n",
|
2037 |
+
"from scipy.misc import face\n",
|
2038 |
+
"from scipy.ndimage import zoom\n",
|
2039 |
+
"from scipy.special import logsumexp\n",
|
2040 |
+
"import torch\n",
|
2041 |
+
"\n",
|
2042 |
+
"import deepgaze_pytorch\n",
|
2043 |
+
"\n",
|
2044 |
+
"DEVICE = 'cuda'\n",
|
2045 |
+
"\n",
|
2046 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
2047 |
+
"model = deepgaze_pytorch.DeepGazeIII(pretrained=True).to(DEVICE)\n",
|
2048 |
+
"\n",
|
2049 |
+
"#image = face()\n",
|
2050 |
+
"\n",
|
2051 |
+
"x = {}\n",
|
2052 |
+
"\n",
|
2053 |
+
"for i in range(len(imgs)):\n",
|
2054 |
+
" \n",
|
2055 |
+
" image = imgs[i]\n",
|
2056 |
+
" \n",
|
2057 |
+
" # location of previous scanpath fixations in x and y (pixel coordinates), starting with the initial fixation on the image.\n",
|
2058 |
+
" fixation_history_x = np.array([1024//2, 300, 500, 200, 200, 700])\n",
|
2059 |
+
" fixation_history_y = np.array([768//2, 300, 100, 300, 100, 500])\n",
|
2060 |
+
"\n",
|
2061 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
2062 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
2063 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
2064 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
2065 |
+
" # rescale to match image size\n",
|
2066 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
2067 |
+
" # renormalize log density\n",
|
2068 |
+
" centerbias -= logsumexp(centerbias)\n",
|
2069 |
+
"\n",
|
2070 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
2071 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
2072 |
+
" x_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
2073 |
+
" y_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
2074 |
+
"\n",
|
2075 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor, x_hist_tensor, y_hist_tensor)\n",
|
2076 |
+
"\n",
|
2077 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(8, 3))\n",
|
2078 |
+
" axs[0].imshow(image)\n",
|
2079 |
+
" axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
2080 |
+
" axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
2081 |
+
" axs[0].set_axis_off()\n",
|
2082 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
2083 |
+
" axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
2084 |
+
" axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
2085 |
+
" axs[1].set_axis_off()"
|
2086 |
+
]
|
2087 |
+
},
|
2088 |
+
{
|
2089 |
+
"cell_type": "code",
|
2090 |
+
"execution_count": null,
|
2091 |
+
"id": "aa2d7d4e",
|
2092 |
+
"metadata": {},
|
2093 |
+
"outputs": [],
|
2094 |
+
"source": []
|
2095 |
+
},
|
2096 |
+
{
|
2097 |
+
"cell_type": "code",
|
2098 |
+
"execution_count": null,
|
2099 |
+
"id": "274b461a",
|
2100 |
+
"metadata": {},
|
2101 |
+
"outputs": [],
|
2102 |
+
"source": []
|
2103 |
+
},
|
2104 |
+
{
|
2105 |
+
"cell_type": "code",
|
2106 |
+
"execution_count": null,
|
2107 |
+
"id": "f71d7915",
|
2108 |
+
"metadata": {},
|
2109 |
+
"outputs": [],
|
2110 |
+
"source": []
|
2111 |
+
},
|
2112 |
+
{
|
2113 |
+
"cell_type": "code",
|
2114 |
+
"execution_count": null,
|
2115 |
+
"id": "6c4adce6",
|
2116 |
+
"metadata": {},
|
2117 |
+
"outputs": [],
|
2118 |
+
"source": [
|
2119 |
+
"import numpy as np\n",
|
2120 |
+
"from scipy.misc import face\n",
|
2121 |
+
"from scipy.ndimage import zoom\n",
|
2122 |
+
"from scipy.special import logsumexp\n",
|
2123 |
+
"import torch\n",
|
2124 |
+
"import matplotlib.pyplot as plt\n",
|
2125 |
+
"\n",
|
2126 |
+
"import deepgaze_pytorch\n",
|
2127 |
+
"\n",
|
2128 |
+
"DEVICE = 'cuda'\n",
|
2129 |
+
"\n",
|
2130 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
2131 |
+
"model = deepgaze_pytorch.DeepGazeIIE(pretrained=True).to(DEVICE)\n",
|
2132 |
+
"\n",
|
2133 |
+
"# image = face()\n",
|
2134 |
+
"\n",
|
2135 |
+
"x = {}\n",
|
2136 |
+
"\n",
|
2137 |
+
"for i in range(len(imgs)):\n",
|
2138 |
+
" \n",
|
2139 |
+
" image = imgs[i]\n",
|
2140 |
+
" \n",
|
2141 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
2142 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
2143 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
2144 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
2145 |
+
" # rescale to match image size\n",
|
2146 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
2147 |
+
" # renormalize log density\n",
|
2148 |
+
" centerbias -= logsumexp(centerbias)\n",
|
2149 |
+
"\n",
|
2150 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
2151 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
2152 |
+
"\n",
|
2153 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor)\n",
|
2154 |
+
" \n",
|
2155 |
+
" a = log_density_prediction.detach().cpu().numpy()[0, 0]\n",
|
2156 |
+
" \n",
|
2157 |
+
" x[img_name[i].split('.')[0]] = a\n",
|
2158 |
+
" \n",
|
2159 |
+
" '''\n",
|
2160 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(16, 9))\n",
|
2161 |
+
" axs[0].imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))\n",
|
2162 |
+
" # axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
2163 |
+
" # axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
2164 |
+
" axs[0].set_axis_off()\n",
|
2165 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
2166 |
+
" # axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
2167 |
+
" # axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
2168 |
+
" axs[1].set_axis_off()\n",
|
2169 |
+
" # plt.savefig(os.path.join('DG2_heatmaps', '{0}.jpg'.format(i)))\n",
|
2170 |
+
" '''\n",
|
2171 |
+
" \n",
|
2172 |
+
" #break"
|
2173 |
+
]
|
2174 |
+
},
|
2175 |
+
{
|
2176 |
+
"cell_type": "code",
|
2177 |
+
"execution_count": null,
|
2178 |
+
"id": "eca95def",
|
2179 |
+
"metadata": {},
|
2180 |
+
"outputs": [],
|
2181 |
+
"source": [
|
2182 |
+
"image"
|
2183 |
+
]
|
2184 |
+
},
|
2185 |
+
{
|
2186 |
+
"cell_type": "code",
|
2187 |
+
"execution_count": null,
|
2188 |
+
"id": "d69ce384",
|
2189 |
+
"metadata": {},
|
2190 |
+
"outputs": [],
|
2191 |
+
"source": [
|
2192 |
+
"import matplotlib.pyplot as plt\n",
|
2193 |
+
"import numpy as np\n",
|
2194 |
+
"from scipy.misc import face\n",
|
2195 |
+
"from scipy.ndimage import zoom\n",
|
2196 |
+
"from scipy.special import logsumexp\n",
|
2197 |
+
"import torch\n",
|
2198 |
+
"\n",
|
2199 |
+
"import deepgaze_pytorch\n",
|
2200 |
+
"\n",
|
2201 |
+
"DEVICE = 'cuda'\n",
|
2202 |
+
"\n",
|
2203 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
2204 |
+
"model = deepgaze_pytorch.DeepGazeI(pretrained=True).to(DEVICE)"
|
2205 |
+
]
|
2206 |
+
},
|
2207 |
+
{
|
2208 |
+
"cell_type": "code",
|
2209 |
+
"execution_count": null,
|
2210 |
+
"id": "c8207585",
|
2211 |
+
"metadata": {},
|
2212 |
+
"outputs": [],
|
2213 |
+
"source": []
|
2214 |
+
},
|
2215 |
+
{
|
2216 |
+
"cell_type": "code",
|
2217 |
+
"execution_count": null,
|
2218 |
+
"id": "b9d406ff",
|
2219 |
+
"metadata": {
|
2220 |
+
"scrolled": true
|
2221 |
+
},
|
2222 |
+
"outputs": [],
|
2223 |
+
"source": [
|
2224 |
+
"%%capture captured_output\n",
|
2225 |
+
"# Your code here\n",
|
2226 |
+
"print(model)"
|
2227 |
+
]
|
2228 |
+
},
|
2229 |
+
{
|
2230 |
+
"cell_type": "code",
|
2231 |
+
"execution_count": null,
|
2232 |
+
"id": "984c0e9c",
|
2233 |
+
"metadata": {
|
2234 |
+
"scrolled": true
|
2235 |
+
},
|
2236 |
+
"outputs": [],
|
2237 |
+
"source": [
|
2238 |
+
"with open(\"DG1_arch.txt\", \"w\") as f:\n",
|
2239 |
+
" f.write(captured_output.stdout)\n"
|
2240 |
+
]
|
2241 |
+
},
|
2242 |
+
{
|
2243 |
+
"cell_type": "code",
|
2244 |
+
"execution_count": null,
|
2245 |
+
"id": "6d170109",
|
2246 |
+
"metadata": {},
|
2247 |
+
"outputs": [],
|
2248 |
+
"source": []
|
2249 |
+
}
|
2250 |
+
],
|
2251 |
+
"metadata": {
|
2252 |
+
"kernelspec": {
|
2253 |
+
"display_name": "Python 3",
|
2254 |
+
"language": "python",
|
2255 |
+
"name": "python3"
|
2256 |
+
},
|
2257 |
+
"language_info": {
|
2258 |
+
"codemirror_mode": {
|
2259 |
+
"name": "ipython",
|
2260 |
+
"version": 3
|
2261 |
+
},
|
2262 |
+
"file_extension": ".py",
|
2263 |
+
"mimetype": "text/x-python",
|
2264 |
+
"name": "python",
|
2265 |
+
"nbconvert_exporter": "python",
|
2266 |
+
"pygments_lexer": "ipython3",
|
2267 |
+
"version": "3.8.5"
|
2268 |
+
}
|
2269 |
+
},
|
2270 |
+
"nbformat": 4,
|
2271 |
+
"nbformat_minor": 5
|
2272 |
+
}
|
DeepGaze/.ipynb_checkpoints/dg3_hg_split_half_rel-checkpoint.ipynb
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9189a317120c7c1594b25d071d088d9422bd721c44271ce8e379e45841e27269
|
3 |
+
size 17759643
|
DeepGaze/.ipynb_checkpoints/dg3_hg_wardle_art_inv-checkpoint.ipynb
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:14ff4fb79f63a52250f442cde44a1d4a450e2b1e1ef58153e9ecbdca0435900d
|
3 |
+
size 14871391
|
DeepGaze/.ipynb_checkpoints/et_analysis-checkpoint.ipynb
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:88c90ae548caf6b8e0fa25fba292f6e6ce55748cddefced368bacddfee0bc3e9
|
3 |
+
size 8811377
|
DeepGaze/.ipynb_checkpoints/et_analysis_helena_dg1-checkpoint.ipynb
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4b13cbe608b4cd1524178eaf748c9445cff83d91218d66fe4a410a9db44befe2
|
3 |
+
size 18093501
|
DeepGaze/.ipynb_checkpoints/extract_hg_c-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/.ipynb_checkpoints/helena_data_complete-checkpoint.ipynb
ADDED
@@ -0,0 +1,3092 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"id": "dab18dbb",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [],
|
9 |
+
"source": [
|
10 |
+
"import numpy as np\n",
|
11 |
+
"from scipy.misc import face\n",
|
12 |
+
"from scipy.ndimage import zoom\n",
|
13 |
+
"from scipy.special import logsumexp\n",
|
14 |
+
"import torch\n",
|
15 |
+
"import matplotlib.pyplot as plt\n",
|
16 |
+
"import pickle\n",
|
17 |
+
"import scipy.io\n",
|
18 |
+
"import cv2\n",
|
19 |
+
"import os\n",
|
20 |
+
"import pandas as pd\n",
|
21 |
+
"from scipy.stats import pearsonr, spearmanr"
|
22 |
+
]
|
23 |
+
},
|
24 |
+
{
|
25 |
+
"cell_type": "code",
|
26 |
+
"execution_count": null,
|
27 |
+
"id": "b48a6642",
|
28 |
+
"metadata": {},
|
29 |
+
"outputs": [],
|
30 |
+
"source": [
|
31 |
+
"def load_images_from_folder(folder):\n",
|
32 |
+
" images = []\n",
|
33 |
+
" img_name = []\n",
|
34 |
+
" for filename in os.listdir(folder):\n",
|
35 |
+
" img = cv2.imread(os.path.join(folder,filename))\n",
|
36 |
+
" if img is not None:\n",
|
37 |
+
" images.append(img)\n",
|
38 |
+
" img_name.append(filename)\n",
|
39 |
+
" return images, img_name"
|
40 |
+
]
|
41 |
+
},
|
42 |
+
{
|
43 |
+
"cell_type": "code",
|
44 |
+
"execution_count": null,
|
45 |
+
"id": "a79f3e8f",
|
46 |
+
"metadata": {},
|
47 |
+
"outputs": [],
|
48 |
+
"source": [
|
49 |
+
"imgs, img_name = load_images_from_folder('stimuli')"
|
50 |
+
]
|
51 |
+
},
|
52 |
+
{
|
53 |
+
"cell_type": "code",
|
54 |
+
"execution_count": null,
|
55 |
+
"id": "c2d3ff2c",
|
56 |
+
"metadata": {},
|
57 |
+
"outputs": [],
|
58 |
+
"source": [
|
59 |
+
"img_name"
|
60 |
+
]
|
61 |
+
},
|
62 |
+
{
|
63 |
+
"cell_type": "code",
|
64 |
+
"execution_count": null,
|
65 |
+
"id": "d00d5fcb",
|
66 |
+
"metadata": {},
|
67 |
+
"outputs": [],
|
68 |
+
"source": [
|
69 |
+
"len(scipy.io.loadmat(fn)['Results']['Disp'])"
|
70 |
+
]
|
71 |
+
},
|
72 |
+
{
|
73 |
+
"cell_type": "code",
|
74 |
+
"execution_count": null,
|
75 |
+
"id": "6957bb28",
|
76 |
+
"metadata": {},
|
77 |
+
"outputs": [],
|
78 |
+
"source": [
|
79 |
+
"fn = '/home/pranjul/DeepGaze/Bachelorarbeit_Christine_Huschens/results/S04/FA_Block1.mat'"
|
80 |
+
]
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"cell_type": "code",
|
84 |
+
"execution_count": null,
|
85 |
+
"id": "6af13d03",
|
86 |
+
"metadata": {
|
87 |
+
"scrolled": true
|
88 |
+
},
|
89 |
+
"outputs": [],
|
90 |
+
"source": [
|
91 |
+
"len(scipy.io.loadmat(fn)['Results']['FixData'][0][0][0][63][0])"
|
92 |
+
]
|
93 |
+
},
|
94 |
+
{
|
95 |
+
"cell_type": "code",
|
96 |
+
"execution_count": null,
|
97 |
+
"id": "67e9c2eb",
|
98 |
+
"metadata": {},
|
99 |
+
"outputs": [],
|
100 |
+
"source": [
|
101 |
+
"fn = '/home/pranjul/DeepGaze/Bachelorarbeit_Christine_Huschens/results/S04/FA_Block1.mat'\n",
|
102 |
+
"\n",
|
103 |
+
"for i in range(64):\n",
|
104 |
+
" gavx, gavy, sttime, entime = [], [], [], []\n",
|
105 |
+
" \n",
|
106 |
+
" for j in range(len(scipy.io.loadmat(fn)['Results']['FixData'][0][0][0][i][0])):\n",
|
107 |
+
" gavx.append(scipy.io.loadmat(fn)['Results']['FixData'][0][0][0][i][0][j][18][0][0])\n",
|
108 |
+
" gavy.append(scipy.io.loadmat(fn)['Results']['FixData'][0][0][0][i][0][j][19][0][0])\n",
|
109 |
+
" sttime.append(scipy.io.loadmat(fn)['Results']['FixData'][0][0][0][i][0][j][4][0][0])\n",
|
110 |
+
" entime.append(scipy.io.loadmat(fn)['Results']['FixData'][0][0][0][i][0][j][5][0][0])\n",
|
111 |
+
"\n",
|
112 |
+
" fixendtimes = scipy.io.loadmat(fn)['Results']['FixEndTimes'][0][0][0][i][0]\n",
|
113 |
+
" stim_image_name = scipy.io.loadmat(fn)['Results']['ImPath'][0][0][0][i][0].split('\\\\')[-1]\n",
|
114 |
+
" stim_folder_name = scipy.io.loadmat(fn)['Results']['ImPath'][0][0][0][i][0].split('\\\\')[-2]\n",
|
115 |
+
"\n",
|
116 |
+
" break\n",
|
117 |
+
"\n",
|
118 |
+
"gavx = np.array(gavx)\n",
|
119 |
+
"gavy = np.array(gavy)\n",
|
120 |
+
"sttime = np.array(sttime)\n",
|
121 |
+
"entime = np.array(entime)\n",
|
122 |
+
"\n",
|
123 |
+
"res_width = scipy.io.loadmat(fn)['Results']['Disp'][0][0][0][0][2][0][0][0][0][0]\n",
|
124 |
+
"res_height = scipy.io.loadmat(fn)['Results']['Disp'][0][0][0][0][2][0][0][1][0][0]\n",
|
125 |
+
"ImWidth = scipy.io.loadmat(fn)['Results']['ImWidth'][0][0][0][0]\n",
|
126 |
+
"ImHeight = scipy.io.loadmat(fn)['Results']['ImHeight'][0][0][0][0]\n",
|
127 |
+
"\n",
|
128 |
+
"FixX = np.round(gavx) - (res_width/2) + (ImWidth/2)\n",
|
129 |
+
"FixY = np.round(gavy) - (res_height/2) + (ImHeight/2)\n",
|
130 |
+
"FixDur = entime - sttime\n",
|
131 |
+
"FixOnset = fixendtimes - FixDur + FixDur*.999\n",
|
132 |
+
"\n",
|
133 |
+
"exclude_ind = np.unique([np.where(FixDur < 100)[0][0], np.where(FixOnset < 0)[0][0]])\n",
|
134 |
+
"FixX = np.delete(FixX, exclude_ind)\n",
|
135 |
+
"FixY = np.delete(FixY, exclude_ind)\n",
|
136 |
+
"FixDur = np.delete(FixDur, exclude_ind)\n",
|
137 |
+
"FixOnset = np.delete(FixOnset, exclude_ind)\n",
|
138 |
+
"\n",
|
139 |
+
"\n"
|
140 |
+
]
|
141 |
+
},
|
142 |
+
{
|
143 |
+
"cell_type": "code",
|
144 |
+
"execution_count": null,
|
145 |
+
"id": "87e18819",
|
146 |
+
"metadata": {},
|
147 |
+
"outputs": [],
|
148 |
+
"source": [
|
149 |
+
"image = cv2.imread('/home/pranjul/DeepGaze/Bachelorarbeit_Christine_Huschens/stimuli/' + stim_folder_name + '/' + stim_image_name)\n",
|
150 |
+
"image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n",
|
151 |
+
"image = cv2.resize(image, (ImWidth, ImHeight))\n",
|
152 |
+
"plt.imshow(image)\n",
|
153 |
+
"\n",
|
154 |
+
"\n"
|
155 |
+
]
|
156 |
+
},
|
157 |
+
{
|
158 |
+
"cell_type": "code",
|
159 |
+
"execution_count": null,
|
160 |
+
"id": "e07be79d",
|
161 |
+
"metadata": {},
|
162 |
+
"outputs": [],
|
163 |
+
"source": []
|
164 |
+
},
|
165 |
+
{
|
166 |
+
"cell_type": "code",
|
167 |
+
"execution_count": null,
|
168 |
+
"id": "17977642",
|
169 |
+
"metadata": {},
|
170 |
+
"outputs": [],
|
171 |
+
"source": [
|
172 |
+
"image.shape"
|
173 |
+
]
|
174 |
+
},
|
175 |
+
{
|
176 |
+
"cell_type": "code",
|
177 |
+
"execution_count": null,
|
178 |
+
"id": "aad511e9",
|
179 |
+
"metadata": {},
|
180 |
+
"outputs": [],
|
181 |
+
"source": [
|
182 |
+
"scipy.io.loadmat(fn)['Results']['ImPath'][0][0][0][i][0].split('\\\\')[-2]"
|
183 |
+
]
|
184 |
+
},
|
185 |
+
{
|
186 |
+
"cell_type": "code",
|
187 |
+
"execution_count": null,
|
188 |
+
"id": "6396d916",
|
189 |
+
"metadata": {},
|
190 |
+
"outputs": [],
|
191 |
+
"source": [
|
192 |
+
"\n",
|
193 |
+
"#fixation_history_x = fix_X[i]/3\n",
|
194 |
+
"#print(fixation_history_x)\n",
|
195 |
+
"#fixation_history_y = fix_Y[i]/3\n",
|
196 |
+
"#radius_history = radius[i]/5\n",
|
197 |
+
"\n",
|
198 |
+
"#print(fixation_history_x, fixation_history_y, radius_history)\n",
|
199 |
+
"\n",
|
200 |
+
"# Create a 2D matrix filled with zeros of size (600, 800)\n",
|
201 |
+
"matrix_size = (1200, 1200)\n",
|
202 |
+
"matrix = np.zeros(matrix_size, dtype=int)\n",
|
203 |
+
"\n",
|
204 |
+
"# Call the function to add circles to the matrix\n",
|
205 |
+
"result_matrix = add_circles(matrix, FixY, FixX, FixDur/5)\n"
|
206 |
+
]
|
207 |
+
},
|
208 |
+
{
|
209 |
+
"cell_type": "code",
|
210 |
+
"execution_count": null,
|
211 |
+
"id": "6f396faf",
|
212 |
+
"metadata": {},
|
213 |
+
"outputs": [],
|
214 |
+
"source": [
|
215 |
+
"plt.imshow(result_matrix)"
|
216 |
+
]
|
217 |
+
},
|
218 |
+
{
|
219 |
+
"cell_type": "code",
|
220 |
+
"execution_count": null,
|
221 |
+
"id": "7c35bf1b",
|
222 |
+
"metadata": {},
|
223 |
+
"outputs": [],
|
224 |
+
"source": []
|
225 |
+
},
|
226 |
+
{
|
227 |
+
"cell_type": "code",
|
228 |
+
"execution_count": null,
|
229 |
+
"id": "2b9b0899",
|
230 |
+
"metadata": {},
|
231 |
+
"outputs": [],
|
232 |
+
"source": []
|
233 |
+
},
|
234 |
+
{
|
235 |
+
"cell_type": "code",
|
236 |
+
"execution_count": null,
|
237 |
+
"id": "e52c9c1a",
|
238 |
+
"metadata": {},
|
239 |
+
"outputs": [],
|
240 |
+
"source": [
|
241 |
+
"FixX(iFix) = round(FixData(iFix).gavx - Results.Disp.Resolution.width./2 + Results.ImWidth/2); \n",
|
242 |
+
"FixY(iFix) = round(FixData(iFix).gavy - Results.Disp.Resolution.height./2 + Results.ImHeight/2);\n",
|
243 |
+
"FixDur(iFix) = FixData(iFix).entime - FixData(iFix).sttime;\n",
|
244 |
+
"FixOnset(iFix) = Results.FixEndTimes{iIm}(iFix) - FixDur(iFix);\n",
|
245 |
+
"% Bug fix to correct error in fixation onsets\n",
|
246 |
+
"FixOnset(iFix) = FixOnset(iFix) + FixDur(iFix)*.999;"
|
247 |
+
]
|
248 |
+
},
|
249 |
+
{
|
250 |
+
"cell_type": "code",
|
251 |
+
"execution_count": null,
|
252 |
+
"id": "8e8787a9",
|
253 |
+
"metadata": {},
|
254 |
+
"outputs": [],
|
255 |
+
"source": []
|
256 |
+
},
|
257 |
+
{
|
258 |
+
"cell_type": "code",
|
259 |
+
"execution_count": null,
|
260 |
+
"id": "412324a5",
|
261 |
+
"metadata": {},
|
262 |
+
"outputs": [],
|
263 |
+
"source": []
|
264 |
+
},
|
265 |
+
{
|
266 |
+
"cell_type": "code",
|
267 |
+
"execution_count": null,
|
268 |
+
"id": "d2ebb782",
|
269 |
+
"metadata": {},
|
270 |
+
"outputs": [],
|
271 |
+
"source": [
|
272 |
+
"def load_fix_from_folder(folder):\n",
|
273 |
+
" fix_X = []\n",
|
274 |
+
" fix_Y = []\n",
|
275 |
+
" radius = []\n",
|
276 |
+
" img_name = []\n",
|
277 |
+
" for filename in os.listdir(folder):\n",
|
278 |
+
" fix_X.append(scipy.io.loadmat(os.path.join(folder,filename))['currImData'][:,4])\n",
|
279 |
+
" fix_Y.append(scipy.io.loadmat(os.path.join(folder,filename))['currImData'][:,5])\n",
|
280 |
+
" radius.append(scipy.io.loadmat(os.path.join(folder,filename))['currImData'][:,6])\n",
|
281 |
+
" img_name.append(str(scipy.io.loadmat(os.path.join(folder,filename))['currImName'][0][0]) + '.jpg')\n",
|
282 |
+
" #print(filename)\n",
|
283 |
+
" #print(img_name)\n",
|
284 |
+
" return fix_X, fix_Y, radius, img_name"
|
285 |
+
]
|
286 |
+
},
|
287 |
+
{
|
288 |
+
"cell_type": "code",
|
289 |
+
"execution_count": null,
|
290 |
+
"id": "78ddfb7d",
|
291 |
+
"metadata": {},
|
292 |
+
"outputs": [],
|
293 |
+
"source": [
|
294 |
+
"import os\n",
|
295 |
+
"\n",
|
296 |
+
"def create_folder(folder_path):\n",
|
297 |
+
" try:\n",
|
298 |
+
" os.mkdir(folder_path)\n",
|
299 |
+
" print(f\"Folder '{folder_path}' created successfully.\")\n",
|
300 |
+
" except FileExistsError:\n",
|
301 |
+
" print(f\"Folder '{folder_path}' already exists.\")\n",
|
302 |
+
" except Exception as e:\n",
|
303 |
+
" print(f\"An error occurred: {e}\")"
|
304 |
+
]
|
305 |
+
},
|
306 |
+
{
|
307 |
+
"cell_type": "code",
|
308 |
+
"execution_count": 4,
|
309 |
+
"id": "585be960",
|
310 |
+
"metadata": {},
|
311 |
+
"outputs": [],
|
312 |
+
"source": [
|
313 |
+
"import os\n",
|
314 |
+
"\n",
|
315 |
+
"def folder_exists(folder_path):\n",
|
316 |
+
" return os.path.exists(folder_path) and os.path.isdir(folder_path)\n"
|
317 |
+
]
|
318 |
+
},
|
319 |
+
{
|
320 |
+
"cell_type": "code",
|
321 |
+
"execution_count": null,
|
322 |
+
"id": "25fa0752",
|
323 |
+
"metadata": {},
|
324 |
+
"outputs": [],
|
325 |
+
"source": [
|
326 |
+
"def add_circles(matrix, x_list, y_list, r_list):\n",
|
327 |
+
" for x, y, r in zip(x_list, y_list, r_list):\n",
|
328 |
+
" x, y, r = int(x), int(y), int(r)\n",
|
329 |
+
" for i in range(max(0, y - r), min(matrix.shape[0], y + r + 1)):\n",
|
330 |
+
" for j in range(max(0, x - r), min(matrix.shape[1], x + r + 1)):\n",
|
331 |
+
" if (i - y) ** 2 + (j - x) ** 2 <= r ** 2:\n",
|
332 |
+
" matrix[i][j] += 1\n",
|
333 |
+
" return matrix"
|
334 |
+
]
|
335 |
+
},
|
336 |
+
{
|
337 |
+
"cell_type": "code",
|
338 |
+
"execution_count": null,
|
339 |
+
"id": "bd2da5f7",
|
340 |
+
"metadata": {
|
341 |
+
"scrolled": true
|
342 |
+
},
|
343 |
+
"outputs": [],
|
344 |
+
"source": [
|
345 |
+
"import matplotlib.pyplot as plt\n",
|
346 |
+
"import numpy as np\n",
|
347 |
+
"from scipy.misc import face\n",
|
348 |
+
"from scipy.ndimage import zoom\n",
|
349 |
+
"from scipy.special import logsumexp\n",
|
350 |
+
"import torch\n",
|
351 |
+
"\n",
|
352 |
+
"import deepgaze_pytorch\n",
|
353 |
+
"\n",
|
354 |
+
"DEVICE = 'cuda'\n",
|
355 |
+
"\n",
|
356 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
357 |
+
"model = deepgaze_pytorch.DeepGazeIII(pretrained=True).to(DEVICE)\n",
|
358 |
+
"\n",
|
359 |
+
"#image = face()\n",
|
360 |
+
"\n",
|
361 |
+
"n_f = '/home/pranjul/DeepGaze/Bachelorarbeit_Christine_Huschens_(1)/results/S'\n",
|
362 |
+
"\n",
|
363 |
+
"for q in range(30, 41):\n",
|
364 |
+
" \n",
|
365 |
+
" x = []\n",
|
366 |
+
" \n",
|
367 |
+
" # Replace 'path/to/your/folder' with the folder path you want to check\n",
|
368 |
+
" folder_path = n_f + str(q)\n",
|
369 |
+
" \n",
|
370 |
+
" if folder_exists(folder_path):\n",
|
371 |
+
" \n",
|
372 |
+
" #fix_X, fix_Y, radius, img_name = load_fix_from_folder('S_fix/S'+ str(q) +'_fix')\n",
|
373 |
+
"\n",
|
374 |
+
" # Replace 'path/to/your/folder' with the desired folder path\n",
|
375 |
+
" folder_path = '/home/pranjul/DeepGaze/Bachelorarbeit_Christine_Huschens/DG3_HG_heatmaps_c/S'+ str(q) +'_fix_c'\n",
|
376 |
+
" create_folder(folder_path)\n",
|
377 |
+
"\n",
|
378 |
+
" for file in sorted(os.listdir(n_f + str(q))):\n",
|
379 |
+
" if 'Block' in file:\n",
|
380 |
+
" print(file) \n",
|
381 |
+
"\n",
|
382 |
+
" fn = n_f + str(q) + '/' + file\n",
|
383 |
+
"\n",
|
384 |
+
" for i in range(64):\n",
|
385 |
+
" gavx, gavy, sttime, entime = [], [], [], []\n",
|
386 |
+
"\n",
|
387 |
+
" for j in range(len(scipy.io.loadmat(fn)['Results']['FixData'][0][0][0][i][0])):\n",
|
388 |
+
" gavx.append(scipy.io.loadmat(fn)['Results']['FixData'][0][0][0][i][0][j][18][0][0])\n",
|
389 |
+
" gavy.append(scipy.io.loadmat(fn)['Results']['FixData'][0][0][0][i][0][j][19][0][0])\n",
|
390 |
+
" sttime.append(scipy.io.loadmat(fn)['Results']['FixData'][0][0][0][i][0][j][4][0][0])\n",
|
391 |
+
" entime.append(scipy.io.loadmat(fn)['Results']['FixData'][0][0][0][i][0][j][5][0][0])\n",
|
392 |
+
"\n",
|
393 |
+
" fixendtimes = scipy.io.loadmat(fn)['Results']['FixEndTimes'][0][0][0][i][0]\n",
|
394 |
+
" stim_image_name = scipy.io.loadmat(fn)['Results']['ImPath'][0][0][0][i][0].split('\\\\')[-1]\n",
|
395 |
+
" stim_folder_name = scipy.io.loadmat(fn)['Results']['ImPath'][0][0][0][i][0].split('\\\\')[-2]\n",
|
396 |
+
"\n",
|
397 |
+
" #break\n",
|
398 |
+
"\n",
|
399 |
+
" gavx = np.array(gavx)\n",
|
400 |
+
" gavy = np.array(gavy)\n",
|
401 |
+
" sttime = np.array(sttime)\n",
|
402 |
+
" entime = np.array(entime)\n",
|
403 |
+
"\n",
|
404 |
+
" res_width = scipy.io.loadmat(fn)['Results']['Disp'][0][0][0][0][2][0][0][0][0][0]\n",
|
405 |
+
" res_height = scipy.io.loadmat(fn)['Results']['Disp'][0][0][0][0][2][0][0][1][0][0]\n",
|
406 |
+
" ImWidth = scipy.io.loadmat(fn)['Results']['ImWidth'][0][0][0][0]\n",
|
407 |
+
" ImHeight = scipy.io.loadmat(fn)['Results']['ImHeight'][0][0][0][0]\n",
|
408 |
+
"\n",
|
409 |
+
" FixX = np.round(gavx) - (res_width/2) + (ImWidth/2)\n",
|
410 |
+
" FixY = np.round(gavy) - (res_height/2) + (ImHeight/2)\n",
|
411 |
+
" FixDur = entime - sttime\n",
|
412 |
+
" FixOnset = fixendtimes - FixDur + FixDur\n",
|
413 |
+
" \n",
|
414 |
+
" #print(FixDur)\n",
|
415 |
+
" #print(FixOnset)\n",
|
416 |
+
" dur_indices = np.where(FixDur < 100)[0]\n",
|
417 |
+
" onset_indices = np.where(FixOnset < 0)[0]\n",
|
418 |
+
"\n",
|
419 |
+
" exclude_ind = np.unique(np.concatenate([dur_indices, onset_indices]))\n",
|
420 |
+
" \n",
|
421 |
+
" print(exclude_ind)\n",
|
422 |
+
" FixX = np.delete(FixX, exclude_ind)\n",
|
423 |
+
" FixY = np.delete(FixY, exclude_ind)\n",
|
424 |
+
" FixDur = np.delete(FixDur, exclude_ind)\n",
|
425 |
+
" FixOnset = np.delete(FixOnset, exclude_ind) \n",
|
426 |
+
" \n",
|
427 |
+
" image = cv2.imread('/home/pranjul/DeepGaze/Bachelorarbeit_Christine_Huschens/stimuli/' + stim_folder_name + '/' + stim_image_name)\n",
|
428 |
+
" create_folder(os.path.join(folder_path, stim_folder_name))\n",
|
429 |
+
" \n",
|
430 |
+
" #image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n",
|
431 |
+
" image = cv2.resize(image, (ImWidth, ImHeight)) \n",
|
432 |
+
" \n",
|
433 |
+
" if image is not None and len(FixX) > 3 and len(FixY > 3):\n",
|
434 |
+
"\n",
|
435 |
+
" # location of previous scanpath fixations in x and y (pixel coordinates), starting with the initial fixation on the image.\n",
|
436 |
+
" #fixation_history_x = np.array([1024//2, 300, 500, 200, 200, 700])\n",
|
437 |
+
" #fixation_history_y = np.array([768//2, 300, 100, 300, 100, 500])\n",
|
438 |
+
"\n",
|
439 |
+
" #print(img_name[i])\n",
|
440 |
+
"\n",
|
441 |
+
" fixation_history_x = FixX\n",
|
442 |
+
" #print(fixation_history_x)\n",
|
443 |
+
" fixation_history_y = FixY\n",
|
444 |
+
" #radius_history = radius[i]/5\n",
|
445 |
+
"\n",
|
446 |
+
" #print(fixation_history_x, fixation_history_y, radius_history)\n",
|
447 |
+
"\n",
|
448 |
+
" # Create a 2D matrix filled with zeros of size (600, 800)\n",
|
449 |
+
" matrix_size = (ImWidth, ImHeight)\n",
|
450 |
+
" matrix = np.zeros(matrix_size, dtype=int)\n",
|
451 |
+
"\n",
|
452 |
+
" # Call the function to add circles to the matrix\n",
|
453 |
+
" result_matrix = add_circles(matrix, FixX, FixY, FixDur/5)\n",
|
454 |
+
"\n",
|
455 |
+
" #plt.imshow(result_matrix)\n",
|
456 |
+
" #plt.plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
457 |
+
" #plt.axis('on')\n",
|
458 |
+
" #plt.colorbar(fraction=0.046, pad=0.04) # Adjust fraction and pad values as needed\n",
|
459 |
+
" #plt.tight_layout()\n",
|
460 |
+
"\n",
|
461 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
462 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
463 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
464 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
465 |
+
"\n",
|
466 |
+
" # rescale to match image size\n",
|
467 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
468 |
+
" # renormalize log density\n",
|
469 |
+
" centerbias -= logsumexp(centerbias)\n",
|
470 |
+
"\n",
|
471 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
472 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
473 |
+
" x_hist_tensor = torch.tensor([fixation_history_x[model.included_fixations]]).to(DEVICE)\n",
|
474 |
+
" y_hist_tensor = torch.tensor([fixation_history_y[model.included_fixations]]).to(DEVICE)\n",
|
475 |
+
"\n",
|
476 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor, x_hist_tensor, y_hist_tensor)\n",
|
477 |
+
"\n",
|
478 |
+
" # Scale factor\n",
|
479 |
+
" #scale_factor = 3\n",
|
480 |
+
"\n",
|
481 |
+
" # Calculate the new width and height\n",
|
482 |
+
" #new_width = image.shape[1] * scale_factor\n",
|
483 |
+
" #new_height = image.shape[0] * scale_factor\n",
|
484 |
+
"\n",
|
485 |
+
" # Resize the image using cv2.resize()\n",
|
486 |
+
" #image = cv2.resize(image, (new_width, new_height))\n",
|
487 |
+
"\n",
|
488 |
+
" image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n",
|
489 |
+
"\n",
|
490 |
+
" x.append((log_density_prediction.detach().cpu().numpy()[0, 0], str(stim_folder_name), str(stim_image_name.split('.')[0]),\n",
|
491 |
+
" 'S' + str(q), result_matrix))\n",
|
492 |
+
"\n",
|
493 |
+
" f, axs = plt.subplots(nrows=1, ncols=3, figsize=(16, 9))\n",
|
494 |
+
" axs[0].imshow(image)\n",
|
495 |
+
" axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
496 |
+
" axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='white', zorder=100)\n",
|
497 |
+
" axs[0].set_axis_off()\n",
|
498 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
499 |
+
" axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
500 |
+
" axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='white', zorder=100)\n",
|
501 |
+
" axs[1].set_axis_off()\n",
|
502 |
+
" axs[2].matshow(result_matrix)\n",
|
503 |
+
" axs[2].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
504 |
+
" axs[2].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='white', zorder=100)\n",
|
505 |
+
" axs[2].set_axis_off()\n",
|
506 |
+
" plt.tight_layout()\n",
|
507 |
+
" plt.savefig(os.path.join(folder_path, stim_folder_name, stim_image_name.split('.')[0] + '.png'))\n",
|
508 |
+
" #plt.show()\n",
|
509 |
+
" plt.close()\n",
|
510 |
+
" #break\n",
|
511 |
+
"\n",
|
512 |
+
" # Open a file in binary write mode\n",
|
513 |
+
" with open(folder_path + '/' + 'S' + str(q) + '.pkl', 'wb') as file:\n",
|
514 |
+
" pickle.dump(x, file)\n",
|
515 |
+
"\n",
|
516 |
+
" #break\n",
|
517 |
+
" #break"
|
518 |
+
]
|
519 |
+
},
|
520 |
+
{
|
521 |
+
"cell_type": "code",
|
522 |
+
"execution_count": null,
|
523 |
+
"id": "d083b6bf",
|
524 |
+
"metadata": {},
|
525 |
+
"outputs": [],
|
526 |
+
"source": [
|
527 |
+
"np.shape(x)"
|
528 |
+
]
|
529 |
+
},
|
530 |
+
{
|
531 |
+
"cell_type": "code",
|
532 |
+
"execution_count": null,
|
533 |
+
"id": "3b1a8ba5",
|
534 |
+
"metadata": {},
|
535 |
+
"outputs": [],
|
536 |
+
"source": [
|
537 |
+
"32*8"
|
538 |
+
]
|
539 |
+
},
|
540 |
+
{
|
541 |
+
"cell_type": "code",
|
542 |
+
"execution_count": 2,
|
543 |
+
"id": "970201dc",
|
544 |
+
"metadata": {},
|
545 |
+
"outputs": [],
|
546 |
+
"source": [
|
547 |
+
"x_loaded = {}"
|
548 |
+
]
|
549 |
+
},
|
550 |
+
{
|
551 |
+
"cell_type": "code",
|
552 |
+
"execution_count": 7,
|
553 |
+
"id": "072a0b13",
|
554 |
+
"metadata": {},
|
555 |
+
"outputs": [],
|
556 |
+
"source": [
|
557 |
+
"for q in range(10, 41):\n",
|
558 |
+
"\n",
|
559 |
+
" # Replace 'path/to/your/folder' with the folder path you want to check\n",
|
560 |
+
" folder_path = '/raid/pranjul/DG3_HG_heatmaps_c/S'+ str(q) +'_fix_c'\n",
|
561 |
+
" \n",
|
562 |
+
" if folder_exists(folder_path):\n",
|
563 |
+
" # Open a file in binary write mode\n",
|
564 |
+
" with open('/raid/pranjul/DG3_HG_heatmaps_c/S'+ str(q) +'_fix_c/' + 'S'+ str(q) + '.pkl', 'rb') as file:\n",
|
565 |
+
" x_loaded[q] = pickle.load(file)\n",
|
566 |
+
"\n",
|
567 |
+
"#x_loaded = [x.tolist() for x in x_loaded]"
|
568 |
+
]
|
569 |
+
},
|
570 |
+
{
|
571 |
+
"cell_type": "code",
|
572 |
+
"execution_count": 8,
|
573 |
+
"id": "eef8a427",
|
574 |
+
"metadata": {},
|
575 |
+
"outputs": [
|
576 |
+
{
|
577 |
+
"data": {
|
578 |
+
"text/plain": [
|
579 |
+
"37"
|
580 |
+
]
|
581 |
+
},
|
582 |
+
"execution_count": 8,
|
583 |
+
"metadata": {},
|
584 |
+
"output_type": "execute_result"
|
585 |
+
}
|
586 |
+
],
|
587 |
+
"source": [
|
588 |
+
"len(x_loaded)"
|
589 |
+
]
|
590 |
+
},
|
591 |
+
{
|
592 |
+
"cell_type": "code",
|
593 |
+
"execution_count": null,
|
594 |
+
"id": "532e15cd",
|
595 |
+
"metadata": {},
|
596 |
+
"outputs": [],
|
597 |
+
"source": [
|
598 |
+
"x_loaded"
|
599 |
+
]
|
600 |
+
},
|
601 |
+
{
|
602 |
+
"cell_type": "code",
|
603 |
+
"execution_count": null,
|
604 |
+
"id": "a4e0f88c",
|
605 |
+
"metadata": {
|
606 |
+
"scrolled": true
|
607 |
+
},
|
608 |
+
"outputs": [],
|
609 |
+
"source": [
|
610 |
+
"x_loaded[4]"
|
611 |
+
]
|
612 |
+
},
|
613 |
+
{
|
614 |
+
"cell_type": "code",
|
615 |
+
"execution_count": null,
|
616 |
+
"id": "4d0b7c18",
|
617 |
+
"metadata": {},
|
618 |
+
"outputs": [],
|
619 |
+
"source": [
|
620 |
+
"plt.imshow(x_loaded[4][0][0])"
|
621 |
+
]
|
622 |
+
},
|
623 |
+
{
|
624 |
+
"cell_type": "code",
|
625 |
+
"execution_count": null,
|
626 |
+
"id": "7253f70f",
|
627 |
+
"metadata": {},
|
628 |
+
"outputs": [],
|
629 |
+
"source": [
|
630 |
+
"plt.imshow(x_loaded[4][0][4])"
|
631 |
+
]
|
632 |
+
},
|
633 |
+
{
|
634 |
+
"cell_type": "code",
|
635 |
+
"execution_count": 10,
|
636 |
+
"id": "48886c2d",
|
637 |
+
"metadata": {},
|
638 |
+
"outputs": [
|
639 |
+
{
|
640 |
+
"data": {
|
641 |
+
"text/plain": [
|
642 |
+
"9472"
|
643 |
+
]
|
644 |
+
},
|
645 |
+
"execution_count": 10,
|
646 |
+
"metadata": {},
|
647 |
+
"output_type": "execute_result"
|
648 |
+
}
|
649 |
+
],
|
650 |
+
"source": [
|
651 |
+
"256*37"
|
652 |
+
]
|
653 |
+
},
|
654 |
+
{
|
655 |
+
"cell_type": "code",
|
656 |
+
"execution_count": null,
|
657 |
+
"id": "fb4e8b68",
|
658 |
+
"metadata": {},
|
659 |
+
"outputs": [],
|
660 |
+
"source": [
|
661 |
+
"for i in range(2):\n",
|
662 |
+
" print(f\"Iter:{i+1}\")\n"
|
663 |
+
]
|
664 |
+
},
|
665 |
+
{
|
666 |
+
"cell_type": "code",
|
667 |
+
"execution_count": 9,
|
668 |
+
"id": "9743923c",
|
669 |
+
"metadata": {},
|
670 |
+
"outputs": [
|
671 |
+
{
|
672 |
+
"name": "stdout",
|
673 |
+
"output_type": "stream",
|
674 |
+
"text": [
|
675 |
+
" dg3 stim_folder \\\n",
|
676 |
+
"0 [[-21.89091177095421, -21.89091177095421, -21.... pareidolia \n",
|
677 |
+
"1 [[-23.752590900618024, -23.752590900618024, -2... pareidolia_inv \n",
|
678 |
+
"2 [[-22.717763718089778, -22.717763718089778, -2... faces \n",
|
679 |
+
"3 [[-23.13883206422637, -23.13883206422637, -23.... objects \n",
|
680 |
+
"4 [[-20.465820021512595, -20.465820021512595, -2... pareidolia_inv \n",
|
681 |
+
"... ... ... \n",
|
682 |
+
"9204 [[-22.03320704181483, -22.03320704181483, -22.... objects_inv \n",
|
683 |
+
"9205 [[-19.347162311089896, -19.347162311089896, -1... pareidolia_inv \n",
|
684 |
+
"9206 [[-21.903870228837253, -21.903870228837253, -2... objects \n",
|
685 |
+
"9207 [[-19.344542363086855, -19.344542363086855, -1... faces_inv \n",
|
686 |
+
"9208 [[-24.540417387594943, -24.540417387594943, -2... pareidolia_inv \n",
|
687 |
+
"\n",
|
688 |
+
" stim_name sub hg \n",
|
689 |
+
"0 64 S04 [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... \n",
|
690 |
+
"1 56_inv S04 [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... \n",
|
691 |
+
"2 face31 S04 [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... \n",
|
692 |
+
"3 16_match S04 [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... \n",
|
693 |
+
"4 46_inv S04 [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... \n",
|
694 |
+
"... ... ... ... \n",
|
695 |
+
"9204 74_match_inv S40 [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... \n",
|
696 |
+
"9205 15_inv S40 [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... \n",
|
697 |
+
"9206 39_match S40 [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... \n",
|
698 |
+
"9207 face12_inv S40 [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... \n",
|
699 |
+
"9208 06_inv S40 [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... \n",
|
700 |
+
"\n",
|
701 |
+
"[9209 rows x 5 columns]\n"
|
702 |
+
]
|
703 |
+
}
|
704 |
+
],
|
705 |
+
"source": [
|
706 |
+
"import pandas as pd\n",
|
707 |
+
"\n",
|
708 |
+
"# Assuming x_loaded is a dictionary\n",
|
709 |
+
"data_frames = []\n",
|
710 |
+
"\n",
|
711 |
+
"for key, value in x_loaded.items():\n",
|
712 |
+
" df = pd.DataFrame(value, columns=['dg3', 'stim_folder', 'stim_name', 'sub', 'hg'])\n",
|
713 |
+
" data_frames.append(df)\n",
|
714 |
+
"\n",
|
715 |
+
"# Concatenate DataFrames\n",
|
716 |
+
"df = pd.concat(data_frames, ignore_index=True)\n",
|
717 |
+
"\n",
|
718 |
+
"# Display the resulting DataFrame\n",
|
719 |
+
"print(df)\n"
|
720 |
+
]
|
721 |
+
},
|
722 |
+
{
|
723 |
+
"cell_type": "code",
|
724 |
+
"execution_count": null,
|
725 |
+
"id": "4d51aabe",
|
726 |
+
"metadata": {},
|
727 |
+
"outputs": [],
|
728 |
+
"source": []
|
729 |
+
},
|
730 |
+
{
|
731 |
+
"cell_type": "code",
|
732 |
+
"execution_count": 11,
|
733 |
+
"id": "9fc92e53",
|
734 |
+
"metadata": {},
|
735 |
+
"outputs": [],
|
736 |
+
"source": [
|
737 |
+
"df_agg_hg = df.groupby(['stim_folder', 'stim_name'])['hg'].apply(lambda x: np.mean(x.tolist(), axis=0)).reset_index()\n"
|
738 |
+
]
|
739 |
+
},
|
740 |
+
{
|
741 |
+
"cell_type": "code",
|
742 |
+
"execution_count": 12,
|
743 |
+
"id": "2e9d4054",
|
744 |
+
"metadata": {},
|
745 |
+
"outputs": [
|
746 |
+
{
|
747 |
+
"data": {
|
748 |
+
"text/html": [
|
749 |
+
"<div>\n",
|
750 |
+
"<style scoped>\n",
|
751 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
752 |
+
" vertical-align: middle;\n",
|
753 |
+
" }\n",
|
754 |
+
"\n",
|
755 |
+
" .dataframe tbody tr th {\n",
|
756 |
+
" vertical-align: top;\n",
|
757 |
+
" }\n",
|
758 |
+
"\n",
|
759 |
+
" .dataframe thead th {\n",
|
760 |
+
" text-align: right;\n",
|
761 |
+
" }\n",
|
762 |
+
"</style>\n",
|
763 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
764 |
+
" <thead>\n",
|
765 |
+
" <tr style=\"text-align: right;\">\n",
|
766 |
+
" <th></th>\n",
|
767 |
+
" <th>stim_folder</th>\n",
|
768 |
+
" <th>stim_name</th>\n",
|
769 |
+
" <th>hg</th>\n",
|
770 |
+
" </tr>\n",
|
771 |
+
" </thead>\n",
|
772 |
+
" <tbody>\n",
|
773 |
+
" <tr>\n",
|
774 |
+
" <th>0</th>\n",
|
775 |
+
" <td>faces</td>\n",
|
776 |
+
" <td>face01</td>\n",
|
777 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
778 |
+
" </tr>\n",
|
779 |
+
" <tr>\n",
|
780 |
+
" <th>1</th>\n",
|
781 |
+
" <td>faces</td>\n",
|
782 |
+
" <td>face02</td>\n",
|
783 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
784 |
+
" </tr>\n",
|
785 |
+
" <tr>\n",
|
786 |
+
" <th>2</th>\n",
|
787 |
+
" <td>faces</td>\n",
|
788 |
+
" <td>face03</td>\n",
|
789 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
790 |
+
" </tr>\n",
|
791 |
+
" <tr>\n",
|
792 |
+
" <th>3</th>\n",
|
793 |
+
" <td>faces</td>\n",
|
794 |
+
" <td>face04</td>\n",
|
795 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
796 |
+
" </tr>\n",
|
797 |
+
" <tr>\n",
|
798 |
+
" <th>4</th>\n",
|
799 |
+
" <td>faces</td>\n",
|
800 |
+
" <td>face05</td>\n",
|
801 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
802 |
+
" </tr>\n",
|
803 |
+
" <tr>\n",
|
804 |
+
" <th>...</th>\n",
|
805 |
+
" <td>...</td>\n",
|
806 |
+
" <td>...</td>\n",
|
807 |
+
" <td>...</td>\n",
|
808 |
+
" </tr>\n",
|
809 |
+
" <tr>\n",
|
810 |
+
" <th>251</th>\n",
|
811 |
+
" <td>pareidolia_inv</td>\n",
|
812 |
+
" <td>75_inv</td>\n",
|
813 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
814 |
+
" </tr>\n",
|
815 |
+
" <tr>\n",
|
816 |
+
" <th>252</th>\n",
|
817 |
+
" <td>pareidolia_inv</td>\n",
|
818 |
+
" <td>78_inv</td>\n",
|
819 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
820 |
+
" </tr>\n",
|
821 |
+
" <tr>\n",
|
822 |
+
" <th>253</th>\n",
|
823 |
+
" <td>pareidolia_inv</td>\n",
|
824 |
+
" <td>80_inv</td>\n",
|
825 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
826 |
+
" </tr>\n",
|
827 |
+
" <tr>\n",
|
828 |
+
" <th>254</th>\n",
|
829 |
+
" <td>pareidolia_inv</td>\n",
|
830 |
+
" <td>81_inv</td>\n",
|
831 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
832 |
+
" </tr>\n",
|
833 |
+
" <tr>\n",
|
834 |
+
" <th>255</th>\n",
|
835 |
+
" <td>pareidolia_inv</td>\n",
|
836 |
+
" <td>83_inv</td>\n",
|
837 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
838 |
+
" </tr>\n",
|
839 |
+
" </tbody>\n",
|
840 |
+
"</table>\n",
|
841 |
+
"<p>256 rows × 3 columns</p>\n",
|
842 |
+
"</div>"
|
843 |
+
],
|
844 |
+
"text/plain": [
|
845 |
+
" stim_folder stim_name \\\n",
|
846 |
+
"0 faces face01 \n",
|
847 |
+
"1 faces face02 \n",
|
848 |
+
"2 faces face03 \n",
|
849 |
+
"3 faces face04 \n",
|
850 |
+
"4 faces face05 \n",
|
851 |
+
".. ... ... \n",
|
852 |
+
"251 pareidolia_inv 75_inv \n",
|
853 |
+
"252 pareidolia_inv 78_inv \n",
|
854 |
+
"253 pareidolia_inv 80_inv \n",
|
855 |
+
"254 pareidolia_inv 81_inv \n",
|
856 |
+
"255 pareidolia_inv 83_inv \n",
|
857 |
+
"\n",
|
858 |
+
" hg \n",
|
859 |
+
"0 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
860 |
+
"1 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
861 |
+
"2 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
862 |
+
"3 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
863 |
+
"4 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
864 |
+
".. ... \n",
|
865 |
+
"251 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
866 |
+
"252 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
867 |
+
"253 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
868 |
+
"254 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
869 |
+
"255 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
870 |
+
"\n",
|
871 |
+
"[256 rows x 3 columns]"
|
872 |
+
]
|
873 |
+
},
|
874 |
+
"execution_count": 12,
|
875 |
+
"metadata": {},
|
876 |
+
"output_type": "execute_result"
|
877 |
+
}
|
878 |
+
],
|
879 |
+
"source": [
|
880 |
+
"df_agg_hg"
|
881 |
+
]
|
882 |
+
},
|
883 |
+
{
|
884 |
+
"cell_type": "code",
|
885 |
+
"execution_count": 14,
|
886 |
+
"id": "1f15b7de",
|
887 |
+
"metadata": {},
|
888 |
+
"outputs": [],
|
889 |
+
"source": [
|
890 |
+
"\n",
|
891 |
+
"import base64\n",
|
892 |
+
"# Define a function to serialize the 2D arrays\n",
|
893 |
+
"def serialize_array(arr):\n",
|
894 |
+
" return base64.b64encode(pickle.dumps(arr)).decode('utf-8')\n",
|
895 |
+
"\n",
|
896 |
+
"# Apply the serialization function to the column\n",
|
897 |
+
"df_agg_hg['hg'] = df_agg_hg['hg'].apply(serialize_array)\n",
|
898 |
+
"\n",
|
899 |
+
"# Save the DataFrame to a CSV file\n",
|
900 |
+
"df_agg_hg.to_csv('/raid/pranjul/agg_hg_37_subs_c.csv', index=False)"
|
901 |
+
]
|
902 |
+
},
|
903 |
+
{
|
904 |
+
"cell_type": "code",
|
905 |
+
"execution_count": 15,
|
906 |
+
"id": "709b8028",
|
907 |
+
"metadata": {},
|
908 |
+
"outputs": [],
|
909 |
+
"source": [
|
910 |
+
"\n",
|
911 |
+
"\n",
|
912 |
+
"# Load the DataFrame from the CSV file\n",
|
913 |
+
"loaded_df_csv = pd.read_csv('/raid/pranjul/agg_hg_37_subs_c.csv')\n",
|
914 |
+
"\n",
|
915 |
+
"# Define a function to deserialize the 2D arrays\n",
|
916 |
+
"def deserialize_array(serialized_arr):\n",
|
917 |
+
" return pickle.loads(base64.b64decode(serialized_arr.encode('utf-8')))\n",
|
918 |
+
"\n",
|
919 |
+
"# Apply the deserialization function to the column\n",
|
920 |
+
"loaded_df_csv['hg'] = loaded_df_csv['hg'].apply(deserialize_array)\n",
|
921 |
+
"\n",
|
922 |
+
"# Now, loaded_df contains the original DataFrame with 2D arrays in 'Array_Column'"
|
923 |
+
]
|
924 |
+
},
|
925 |
+
{
|
926 |
+
"cell_type": "code",
|
927 |
+
"execution_count": 16,
|
928 |
+
"id": "44d66ffb",
|
929 |
+
"metadata": {},
|
930 |
+
"outputs": [
|
931 |
+
{
|
932 |
+
"data": {
|
933 |
+
"text/html": [
|
934 |
+
"<div>\n",
|
935 |
+
"<style scoped>\n",
|
936 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
937 |
+
" vertical-align: middle;\n",
|
938 |
+
" }\n",
|
939 |
+
"\n",
|
940 |
+
" .dataframe tbody tr th {\n",
|
941 |
+
" vertical-align: top;\n",
|
942 |
+
" }\n",
|
943 |
+
"\n",
|
944 |
+
" .dataframe thead th {\n",
|
945 |
+
" text-align: right;\n",
|
946 |
+
" }\n",
|
947 |
+
"</style>\n",
|
948 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
949 |
+
" <thead>\n",
|
950 |
+
" <tr style=\"text-align: right;\">\n",
|
951 |
+
" <th></th>\n",
|
952 |
+
" <th>stim_folder</th>\n",
|
953 |
+
" <th>stim_name</th>\n",
|
954 |
+
" <th>hg</th>\n",
|
955 |
+
" </tr>\n",
|
956 |
+
" </thead>\n",
|
957 |
+
" <tbody>\n",
|
958 |
+
" <tr>\n",
|
959 |
+
" <th>0</th>\n",
|
960 |
+
" <td>faces</td>\n",
|
961 |
+
" <td>face01</td>\n",
|
962 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
963 |
+
" </tr>\n",
|
964 |
+
" <tr>\n",
|
965 |
+
" <th>1</th>\n",
|
966 |
+
" <td>faces</td>\n",
|
967 |
+
" <td>face02</td>\n",
|
968 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
969 |
+
" </tr>\n",
|
970 |
+
" <tr>\n",
|
971 |
+
" <th>2</th>\n",
|
972 |
+
" <td>faces</td>\n",
|
973 |
+
" <td>face03</td>\n",
|
974 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
975 |
+
" </tr>\n",
|
976 |
+
" <tr>\n",
|
977 |
+
" <th>3</th>\n",
|
978 |
+
" <td>faces</td>\n",
|
979 |
+
" <td>face04</td>\n",
|
980 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
981 |
+
" </tr>\n",
|
982 |
+
" <tr>\n",
|
983 |
+
" <th>4</th>\n",
|
984 |
+
" <td>faces</td>\n",
|
985 |
+
" <td>face05</td>\n",
|
986 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
987 |
+
" </tr>\n",
|
988 |
+
" <tr>\n",
|
989 |
+
" <th>...</th>\n",
|
990 |
+
" <td>...</td>\n",
|
991 |
+
" <td>...</td>\n",
|
992 |
+
" <td>...</td>\n",
|
993 |
+
" </tr>\n",
|
994 |
+
" <tr>\n",
|
995 |
+
" <th>251</th>\n",
|
996 |
+
" <td>pareidolia_inv</td>\n",
|
997 |
+
" <td>75_inv</td>\n",
|
998 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
999 |
+
" </tr>\n",
|
1000 |
+
" <tr>\n",
|
1001 |
+
" <th>252</th>\n",
|
1002 |
+
" <td>pareidolia_inv</td>\n",
|
1003 |
+
" <td>78_inv</td>\n",
|
1004 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
1005 |
+
" </tr>\n",
|
1006 |
+
" <tr>\n",
|
1007 |
+
" <th>253</th>\n",
|
1008 |
+
" <td>pareidolia_inv</td>\n",
|
1009 |
+
" <td>80_inv</td>\n",
|
1010 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
1011 |
+
" </tr>\n",
|
1012 |
+
" <tr>\n",
|
1013 |
+
" <th>254</th>\n",
|
1014 |
+
" <td>pareidolia_inv</td>\n",
|
1015 |
+
" <td>81_inv</td>\n",
|
1016 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
1017 |
+
" </tr>\n",
|
1018 |
+
" <tr>\n",
|
1019 |
+
" <th>255</th>\n",
|
1020 |
+
" <td>pareidolia_inv</td>\n",
|
1021 |
+
" <td>83_inv</td>\n",
|
1022 |
+
" <td>[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,...</td>\n",
|
1023 |
+
" </tr>\n",
|
1024 |
+
" </tbody>\n",
|
1025 |
+
"</table>\n",
|
1026 |
+
"<p>256 rows × 3 columns</p>\n",
|
1027 |
+
"</div>"
|
1028 |
+
],
|
1029 |
+
"text/plain": [
|
1030 |
+
" stim_folder stim_name \\\n",
|
1031 |
+
"0 faces face01 \n",
|
1032 |
+
"1 faces face02 \n",
|
1033 |
+
"2 faces face03 \n",
|
1034 |
+
"3 faces face04 \n",
|
1035 |
+
"4 faces face05 \n",
|
1036 |
+
".. ... ... \n",
|
1037 |
+
"251 pareidolia_inv 75_inv \n",
|
1038 |
+
"252 pareidolia_inv 78_inv \n",
|
1039 |
+
"253 pareidolia_inv 80_inv \n",
|
1040 |
+
"254 pareidolia_inv 81_inv \n",
|
1041 |
+
"255 pareidolia_inv 83_inv \n",
|
1042 |
+
"\n",
|
1043 |
+
" hg \n",
|
1044 |
+
"0 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
1045 |
+
"1 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
1046 |
+
"2 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
1047 |
+
"3 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
1048 |
+
"4 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
1049 |
+
".. ... \n",
|
1050 |
+
"251 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
1051 |
+
"252 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
1052 |
+
"253 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
1053 |
+
"254 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
1054 |
+
"255 [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... \n",
|
1055 |
+
"\n",
|
1056 |
+
"[256 rows x 3 columns]"
|
1057 |
+
]
|
1058 |
+
},
|
1059 |
+
"execution_count": 16,
|
1060 |
+
"metadata": {},
|
1061 |
+
"output_type": "execute_result"
|
1062 |
+
}
|
1063 |
+
],
|
1064 |
+
"source": [
|
1065 |
+
"loaded_df_csv"
|
1066 |
+
]
|
1067 |
+
},
|
1068 |
+
{
|
1069 |
+
"cell_type": "code",
|
1070 |
+
"execution_count": null,
|
1071 |
+
"id": "cad6488c",
|
1072 |
+
"metadata": {},
|
1073 |
+
"outputs": [],
|
1074 |
+
"source": []
|
1075 |
+
},
|
1076 |
+
{
|
1077 |
+
"cell_type": "code",
|
1078 |
+
"execution_count": null,
|
1079 |
+
"id": "90dcd74f",
|
1080 |
+
"metadata": {},
|
1081 |
+
"outputs": [],
|
1082 |
+
"source": []
|
1083 |
+
},
|
1084 |
+
{
|
1085 |
+
"cell_type": "code",
|
1086 |
+
"execution_count": null,
|
1087 |
+
"id": "3334d903",
|
1088 |
+
"metadata": {},
|
1089 |
+
"outputs": [],
|
1090 |
+
"source": []
|
1091 |
+
},
|
1092 |
+
{
|
1093 |
+
"cell_type": "code",
|
1094 |
+
"execution_count": null,
|
1095 |
+
"id": "d8eea8a4",
|
1096 |
+
"metadata": {},
|
1097 |
+
"outputs": [],
|
1098 |
+
"source": []
|
1099 |
+
},
|
1100 |
+
{
|
1101 |
+
"cell_type": "code",
|
1102 |
+
"execution_count": null,
|
1103 |
+
"id": "7a5b6082",
|
1104 |
+
"metadata": {},
|
1105 |
+
"outputs": [],
|
1106 |
+
"source": [
|
1107 |
+
"sp_corr = []\n",
|
1108 |
+
"for i in range(len(df['dg3'])):\n",
|
1109 |
+
" sp_corr.append(spearmanr(df['dg3'][i].flatten(), df['hg'][i].flatten())[0])\n",
|
1110 |
+
" #break\n"
|
1111 |
+
]
|
1112 |
+
},
|
1113 |
+
{
|
1114 |
+
"cell_type": "code",
|
1115 |
+
"execution_count": null,
|
1116 |
+
"id": "76a4cfab",
|
1117 |
+
"metadata": {},
|
1118 |
+
"outputs": [],
|
1119 |
+
"source": [
|
1120 |
+
"import pickle\n",
|
1121 |
+
"\n",
|
1122 |
+
"# Save the list to a file\n",
|
1123 |
+
"with open('/raid/pranjul/sp_corr_dg3_37_subs_c.pkl', 'wb') as file:\n",
|
1124 |
+
" pickle.dump(sp_corr, file)"
|
1125 |
+
]
|
1126 |
+
},
|
1127 |
+
{
|
1128 |
+
"cell_type": "code",
|
1129 |
+
"execution_count": null,
|
1130 |
+
"id": "19b45d8a",
|
1131 |
+
"metadata": {},
|
1132 |
+
"outputs": [],
|
1133 |
+
"source": [
|
1134 |
+
"# Load the list from the file\n",
|
1135 |
+
"with open('/raid/pranjul/sp_corr_dg3_37_subs_c.pkl', 'rb') as file:\n",
|
1136 |
+
" loaded_list = pickle.load(file)\n",
|
1137 |
+
"\n",
|
1138 |
+
"print(loaded_list)"
|
1139 |
+
]
|
1140 |
+
},
|
1141 |
+
{
|
1142 |
+
"cell_type": "code",
|
1143 |
+
"execution_count": null,
|
1144 |
+
"id": "9969e070",
|
1145 |
+
"metadata": {},
|
1146 |
+
"outputs": [],
|
1147 |
+
"source": [
|
1148 |
+
"df"
|
1149 |
+
]
|
1150 |
+
},
|
1151 |
+
{
|
1152 |
+
"cell_type": "code",
|
1153 |
+
"execution_count": null,
|
1154 |
+
"id": "98174519",
|
1155 |
+
"metadata": {},
|
1156 |
+
"outputs": [],
|
1157 |
+
"source": []
|
1158 |
+
},
|
1159 |
+
{
|
1160 |
+
"cell_type": "code",
|
1161 |
+
"execution_count": null,
|
1162 |
+
"id": "b86e879c",
|
1163 |
+
"metadata": {},
|
1164 |
+
"outputs": [],
|
1165 |
+
"source": []
|
1166 |
+
},
|
1167 |
+
{
|
1168 |
+
"cell_type": "code",
|
1169 |
+
"execution_count": null,
|
1170 |
+
"id": "a5aaf588",
|
1171 |
+
"metadata": {},
|
1172 |
+
"outputs": [],
|
1173 |
+
"source": [
|
1174 |
+
"# Add the Spearman correlation values to the DataFrame\n",
|
1175 |
+
"df['sp_corr'] = sp_corr"
|
1176 |
+
]
|
1177 |
+
},
|
1178 |
+
{
|
1179 |
+
"cell_type": "code",
|
1180 |
+
"execution_count": null,
|
1181 |
+
"id": "3393ccd0",
|
1182 |
+
"metadata": {},
|
1183 |
+
"outputs": [],
|
1184 |
+
"source": [
|
1185 |
+
"df = df.drop(columns=['dg3', 'hg'])"
|
1186 |
+
]
|
1187 |
+
},
|
1188 |
+
{
|
1189 |
+
"cell_type": "code",
|
1190 |
+
"execution_count": null,
|
1191 |
+
"id": "74823bb5",
|
1192 |
+
"metadata": {},
|
1193 |
+
"outputs": [],
|
1194 |
+
"source": [
|
1195 |
+
"len(df['sp_corr'])"
|
1196 |
+
]
|
1197 |
+
},
|
1198 |
+
{
|
1199 |
+
"cell_type": "code",
|
1200 |
+
"execution_count": null,
|
1201 |
+
"id": "41901f26",
|
1202 |
+
"metadata": {},
|
1203 |
+
"outputs": [],
|
1204 |
+
"source": [
|
1205 |
+
"df"
|
1206 |
+
]
|
1207 |
+
},
|
1208 |
+
{
|
1209 |
+
"cell_type": "code",
|
1210 |
+
"execution_count": null,
|
1211 |
+
"id": "f742b79b",
|
1212 |
+
"metadata": {},
|
1213 |
+
"outputs": [],
|
1214 |
+
"source": [
|
1215 |
+
"result_df"
|
1216 |
+
]
|
1217 |
+
},
|
1218 |
+
{
|
1219 |
+
"cell_type": "code",
|
1220 |
+
"execution_count": null,
|
1221 |
+
"id": "f060d3ba",
|
1222 |
+
"metadata": {},
|
1223 |
+
"outputs": [],
|
1224 |
+
"source": [
|
1225 |
+
"# Define the custom order\n",
|
1226 |
+
"custom_order = ['faces', 'faces_inv', 'objects', 'objects_inv', 'pareidolia', 'pareidolia_inv', 'pareidolia_art', 'pareidolia_art_inv']\n",
|
1227 |
+
"\n",
|
1228 |
+
"# Convert the 'stim_folder' column to a Categorical data type with the custom order\n",
|
1229 |
+
"result_df['stim_folder'] = pd.Categorical(result_df['stim_folder'], categories=custom_order, ordered=True)\n",
|
1230 |
+
"\n",
|
1231 |
+
"# Sort the DataFrame based on the custom order\n",
|
1232 |
+
"df_sorted = result_df.sort_values(by='stim_folder')\n",
|
1233 |
+
"\n",
|
1234 |
+
"# Print the sorted DataFrame\n",
|
1235 |
+
"print(df_sorted)"
|
1236 |
+
]
|
1237 |
+
},
|
1238 |
+
{
|
1239 |
+
"cell_type": "code",
|
1240 |
+
"execution_count": null,
|
1241 |
+
"id": "5a8fb762",
|
1242 |
+
"metadata": {},
|
1243 |
+
"outputs": [],
|
1244 |
+
"source": [
|
1245 |
+
"result_df"
|
1246 |
+
]
|
1247 |
+
},
|
1248 |
+
{
|
1249 |
+
"cell_type": "code",
|
1250 |
+
"execution_count": null,
|
1251 |
+
"id": "c6544090",
|
1252 |
+
"metadata": {},
|
1253 |
+
"outputs": [],
|
1254 |
+
"source": [
|
1255 |
+
"df['stim_folder']"
|
1256 |
+
]
|
1257 |
+
},
|
1258 |
+
{
|
1259 |
+
"cell_type": "code",
|
1260 |
+
"execution_count": null,
|
1261 |
+
"id": "588a1915",
|
1262 |
+
"metadata": {},
|
1263 |
+
"outputs": [],
|
1264 |
+
"source": [
|
1265 |
+
"df['stim_folder'].value_counts()"
|
1266 |
+
]
|
1267 |
+
},
|
1268 |
+
{
|
1269 |
+
"cell_type": "code",
|
1270 |
+
"execution_count": null,
|
1271 |
+
"id": "994c83f0",
|
1272 |
+
"metadata": {
|
1273 |
+
"scrolled": true
|
1274 |
+
},
|
1275 |
+
"outputs": [],
|
1276 |
+
"source": [
|
1277 |
+
"result_df['stim_folder'].value_counts()"
|
1278 |
+
]
|
1279 |
+
},
|
1280 |
+
{
|
1281 |
+
"cell_type": "code",
|
1282 |
+
"execution_count": null,
|
1283 |
+
"id": "c9ec7617",
|
1284 |
+
"metadata": {},
|
1285 |
+
"outputs": [],
|
1286 |
+
"source": []
|
1287 |
+
},
|
1288 |
+
{
|
1289 |
+
"cell_type": "code",
|
1290 |
+
"execution_count": null,
|
1291 |
+
"id": "7543ea0a",
|
1292 |
+
"metadata": {},
|
1293 |
+
"outputs": [],
|
1294 |
+
"source": []
|
1295 |
+
},
|
1296 |
+
{
|
1297 |
+
"cell_type": "code",
|
1298 |
+
"execution_count": null,
|
1299 |
+
"id": "86af740e",
|
1300 |
+
"metadata": {},
|
1301 |
+
"outputs": [],
|
1302 |
+
"source": []
|
1303 |
+
},
|
1304 |
+
{
|
1305 |
+
"cell_type": "code",
|
1306 |
+
"execution_count": null,
|
1307 |
+
"id": "2ca5da07",
|
1308 |
+
"metadata": {
|
1309 |
+
"scrolled": true
|
1310 |
+
},
|
1311 |
+
"outputs": [],
|
1312 |
+
"source": [
|
1313 |
+
"import pandas as pd\n",
|
1314 |
+
"import numpy as np\n",
|
1315 |
+
"\n",
|
1316 |
+
"# Assuming df is your original DataFrame\n",
|
1317 |
+
"# If you don't have a DataFrame, you can create a sample one\n",
|
1318 |
+
"# df = pd.DataFrame({'stim_folder': ['objects']*32 + ['faces']*32 + ['pareidolia']*31 + ['pareidolia_art_inv']*31 + ['pareidolia_inv']*31 + ['pareidolia_art']*31 + ['objects_inv']*31 + ['faces_inv']*30})\n",
|
1319 |
+
"\n",
|
1320 |
+
"# Get the unique values and their counts\n",
|
1321 |
+
"value_counts = df['stim_folder'].value_counts()\n",
|
1322 |
+
"\n",
|
1323 |
+
"# Find the minimum count\n",
|
1324 |
+
"min_count = value_counts.min()\n",
|
1325 |
+
"\n",
|
1326 |
+
"# Identify rows to be removed for each unique value\n",
|
1327 |
+
"rows_to_remove = []\n",
|
1328 |
+
"\n",
|
1329 |
+
"for stim_folder, count in value_counts.items():\n",
|
1330 |
+
" if count > min_count:\n",
|
1331 |
+
" indices = df[df['stim_folder'] == stim_folder].sample(n=count - min_count).index\n",
|
1332 |
+
" rows_to_remove.extend(indices)\n",
|
1333 |
+
"\n",
|
1334 |
+
"# Remove the identified rows\n",
|
1335 |
+
"result_df = df.drop(rows_to_remove)\n",
|
1336 |
+
"\n",
|
1337 |
+
"# Display the result DataFrame\n",
|
1338 |
+
"print(result_df)\n"
|
1339 |
+
]
|
1340 |
+
},
|
1341 |
+
{
|
1342 |
+
"cell_type": "code",
|
1343 |
+
"execution_count": null,
|
1344 |
+
"id": "76acbad9",
|
1345 |
+
"metadata": {},
|
1346 |
+
"outputs": [],
|
1347 |
+
"source": [
|
1348 |
+
"min_count"
|
1349 |
+
]
|
1350 |
+
},
|
1351 |
+
{
|
1352 |
+
"cell_type": "code",
|
1353 |
+
"execution_count": null,
|
1354 |
+
"id": "95468f6f",
|
1355 |
+
"metadata": {
|
1356 |
+
"scrolled": true
|
1357 |
+
},
|
1358 |
+
"outputs": [],
|
1359 |
+
"source": [
|
1360 |
+
"len(rows_to_remove)"
|
1361 |
+
]
|
1362 |
+
},
|
1363 |
+
{
|
1364 |
+
"cell_type": "code",
|
1365 |
+
"execution_count": null,
|
1366 |
+
"id": "f1716d59",
|
1367 |
+
"metadata": {},
|
1368 |
+
"outputs": [],
|
1369 |
+
"source": []
|
1370 |
+
},
|
1371 |
+
{
|
1372 |
+
"cell_type": "code",
|
1373 |
+
"execution_count": null,
|
1374 |
+
"id": "4811d462",
|
1375 |
+
"metadata": {},
|
1376 |
+
"outputs": [],
|
1377 |
+
"source": [
|
1378 |
+
"from itertools import combinations\n",
|
1379 |
+
"\n",
|
1380 |
+
"# 'Object_and_face_identification'\n",
|
1381 |
+
"# Given array\n",
|
1382 |
+
"task_array = ['faces', 'faces_inv', 'objects', 'objects_inv', 'pareidolia', 'pareidolia_inv', 'pareidolia_art', 'pareidolia_art_inv']\n",
|
1383 |
+
"\n",
|
1384 |
+
"# Generate all unique combinations of two tasks\n",
|
1385 |
+
"combinations_list = list(combinations(task_array, 2))\n",
|
1386 |
+
"\n",
|
1387 |
+
"# Display the result\n",
|
1388 |
+
"print(combinations_list)"
|
1389 |
+
]
|
1390 |
+
},
|
1391 |
+
{
|
1392 |
+
"cell_type": "code",
|
1393 |
+
"execution_count": null,
|
1394 |
+
"id": "fd3bbdaa",
|
1395 |
+
"metadata": {},
|
1396 |
+
"outputs": [],
|
1397 |
+
"source": [
|
1398 |
+
"len(df['sp_corr'])"
|
1399 |
+
]
|
1400 |
+
},
|
1401 |
+
{
|
1402 |
+
"cell_type": "code",
|
1403 |
+
"execution_count": null,
|
1404 |
+
"id": "345e9b3f",
|
1405 |
+
"metadata": {},
|
1406 |
+
"outputs": [],
|
1407 |
+
"source": [
|
1408 |
+
"df"
|
1409 |
+
]
|
1410 |
+
},
|
1411 |
+
{
|
1412 |
+
"cell_type": "code",
|
1413 |
+
"execution_count": null,
|
1414 |
+
"id": "65c5864f",
|
1415 |
+
"metadata": {},
|
1416 |
+
"outputs": [],
|
1417 |
+
"source": [
|
1418 |
+
"df[\"stim_folder\"]"
|
1419 |
+
]
|
1420 |
+
},
|
1421 |
+
{
|
1422 |
+
"cell_type": "code",
|
1423 |
+
"execution_count": null,
|
1424 |
+
"id": "c2ffd235",
|
1425 |
+
"metadata": {},
|
1426 |
+
"outputs": [],
|
1427 |
+
"source": [
|
1428 |
+
"df[\"sp_corr\"]"
|
1429 |
+
]
|
1430 |
+
},
|
1431 |
+
{
|
1432 |
+
"cell_type": "code",
|
1433 |
+
"execution_count": null,
|
1434 |
+
"id": "9163a8b5",
|
1435 |
+
"metadata": {},
|
1436 |
+
"outputs": [],
|
1437 |
+
"source": []
|
1438 |
+
},
|
1439 |
+
{
|
1440 |
+
"cell_type": "code",
|
1441 |
+
"execution_count": null,
|
1442 |
+
"id": "1af78875",
|
1443 |
+
"metadata": {},
|
1444 |
+
"outputs": [],
|
1445 |
+
"source": [
|
1446 |
+
"combinations_list"
|
1447 |
+
]
|
1448 |
+
},
|
1449 |
+
{
|
1450 |
+
"cell_type": "code",
|
1451 |
+
"execution_count": null,
|
1452 |
+
"id": "0bddc8f1",
|
1453 |
+
"metadata": {},
|
1454 |
+
"outputs": [],
|
1455 |
+
"source": [
|
1456 |
+
"result_df"
|
1457 |
+
]
|
1458 |
+
},
|
1459 |
+
{
|
1460 |
+
"cell_type": "code",
|
1461 |
+
"execution_count": null,
|
1462 |
+
"id": "fb842369",
|
1463 |
+
"metadata": {},
|
1464 |
+
"outputs": [],
|
1465 |
+
"source": [
|
1466 |
+
"df_sorted"
|
1467 |
+
]
|
1468 |
+
},
|
1469 |
+
{
|
1470 |
+
"cell_type": "code",
|
1471 |
+
"execution_count": null,
|
1472 |
+
"id": "d16e1945",
|
1473 |
+
"metadata": {},
|
1474 |
+
"outputs": [],
|
1475 |
+
"source": [
|
1476 |
+
"result_df"
|
1477 |
+
]
|
1478 |
+
},
|
1479 |
+
{
|
1480 |
+
"cell_type": "code",
|
1481 |
+
"execution_count": null,
|
1482 |
+
"id": "1eabdc8b",
|
1483 |
+
"metadata": {
|
1484 |
+
"scrolled": false
|
1485 |
+
},
|
1486 |
+
"outputs": [],
|
1487 |
+
"source": [
|
1488 |
+
"import matplotlib.pyplot as plt\n",
|
1489 |
+
"%matplotlib inline\n",
|
1490 |
+
"import seaborn as sns\n",
|
1491 |
+
"from statannotations.Annotator import Annotator\n",
|
1492 |
+
"\n",
|
1493 |
+
"x = \"stim_folder\"\n",
|
1494 |
+
"y = \"sp_corr\"\n",
|
1495 |
+
"\n",
|
1496 |
+
"# Filter the DataFrame based on the 'Time' condition\n",
|
1497 |
+
"subset_df = df_sorted\n",
|
1498 |
+
"\n",
|
1499 |
+
"# Increase the figure size and font size\n",
|
1500 |
+
"plt.figure(figsize=(6, 4))\n",
|
1501 |
+
"sns.set(style=\"white\", rc={\"axes.edgecolor\": \"black\", \"grid.color\": \"black\", \"grid.linestyle\": \":\"}, font_scale=1.5)\n",
|
1502 |
+
"\n",
|
1503 |
+
"# Create a palette with distinct colors\n",
|
1504 |
+
"palette = sns.color_palette(\"Set3\", n_colors=len(subset_df[x].unique())) # You can choose any other colormap\n",
|
1505 |
+
"\n",
|
1506 |
+
"# Create the barplot with the distinct color palette\n",
|
1507 |
+
"ax = sns.barplot(data=subset_df, x=x, y=y, palette=palette, capsize=0.1, errwidth=1.5) # Added capsize and errwidth for error bars\n",
|
1508 |
+
"#ax = sns.boxplot(data=subset_df, x=x, y=y, palette=palette) # Added capsize and errwidth for error bars\n",
|
1509 |
+
"\n",
|
1510 |
+
"'''\n",
|
1511 |
+
"# Add statistical annotations\n",
|
1512 |
+
"annot = Annotator(ax, combinations_list, data=subset_df, x=x, y=y)\n",
|
1513 |
+
"annot.new_plot(ax, combinations_list,\n",
|
1514 |
+
" data=subset_df, x=x, y=y)\n",
|
1515 |
+
"annot.configure(test='Kruskal', text_format='star', loc='outside',\n",
|
1516 |
+
" comparisons_correction=\"fdr_bh\",\n",
|
1517 |
+
" hide_non_significant=True,\n",
|
1518 |
+
" pvalue_thresholds=[[1e-3, '∗∗∗'], [1e-2, \"∗∗\"], [0.05, \"∗\"]], verbose=2)\n",
|
1519 |
+
"\n",
|
1520 |
+
"#annot.apply_test()\n",
|
1521 |
+
"\n",
|
1522 |
+
"# Adjust the position of stars between lines\n",
|
1523 |
+
"#annot.line_offset_to_group = 0.5\n",
|
1524 |
+
"#annot.line_offset = 0.3 # Adjust this value to move the stars closer to the lines\n",
|
1525 |
+
"#annot.text_offset = 0.05 # Adjust this value to move the stars closer to the lines\n",
|
1526 |
+
"#ax, test_results = annot.annotate(line_offset = 0.01)\n",
|
1527 |
+
"#ax, test_results = annot.annotate()\n",
|
1528 |
+
"\n",
|
1529 |
+
"ax, test_results = annot.apply_test().annotate(line_offset=0.001)\n",
|
1530 |
+
"'''\n",
|
1531 |
+
"# Remove top and right plot edges\n",
|
1532 |
+
"sns.despine()\n",
|
1533 |
+
"\n",
|
1534 |
+
"# Define explicit legend handles\n",
|
1535 |
+
"legend_labels = ['faces', 'faces_inv', 'objects', 'objects_inv', 'pareidolia', 'pareidolia_inv', 'pareidolia_art', 'pareidolia_art_inv']\n",
|
1536 |
+
"legend_handles = [plt.Rectangle((0, 0), 1, 1, color=color, label=label) for color, label in zip(palette, legend_labels)]\n",
|
1537 |
+
"\n",
|
1538 |
+
"# Create legend without edges and without error bars, and change the title to \"CNN\"\n",
|
1539 |
+
"legend = ax.legend(handles=legend_handles, title=\"\", title_fontsize='16', loc='upper left', bbox_to_anchor=(1, 1), frameon=False, fontsize=16)\n",
|
1540 |
+
"\n",
|
1541 |
+
"\n",
|
1542 |
+
"\n",
|
1543 |
+
"# Remove x-axis ticks and labels\n",
|
1544 |
+
"#ax.set_xticks([])\n",
|
1545 |
+
"#ax.set_xticklabels([])\n",
|
1546 |
+
"\n",
|
1547 |
+
"# Set y-axis limits from 0 to 1\n",
|
1548 |
+
"ax.set_ylim(0.25, 0.35)\n",
|
1549 |
+
"ax.set_yticks(np.linspace(0.25, 0.35, num=6))\n",
|
1550 |
+
"\n",
|
1551 |
+
"# Show the tick marks on the left side of the y-axis\n",
|
1552 |
+
"#ax.tick_params(axis='y', direction='out', length=5) # Adjust 'length' as needed\n",
|
1553 |
+
"ax.tick_params(tick1On=True)\n",
|
1554 |
+
"\n",
|
1555 |
+
"# Set font size for axis labels and title\n",
|
1556 |
+
"ax.set_ylabel('DG3 & HG correlation [Spearman\\'s r]', fontsize=16)\n",
|
1557 |
+
"#ax.set_ylabel('')\n",
|
1558 |
+
"ax.set_xlabel('2 (orientation) x 4 (stimuli condition)', fontsize=16)\n",
|
1559 |
+
"\n",
|
1560 |
+
"#ax.set_title('255ms:lay13-15', fontsize=18)\n",
|
1561 |
+
"\n",
|
1562 |
+
"# Set font size for tick labels\n",
|
1563 |
+
"ax.tick_params(axis='both', labelsize=16)\n",
|
1564 |
+
"\n",
|
1565 |
+
"# Uncomment the following lines to show y-axis ticks and tick labels\n",
|
1566 |
+
"# ax.set_yticks(np.linspace(0, 1.0, num=11)) # Uncomment if not already set\n",
|
1567 |
+
"# ax.set_yticklabels(['0.0', '0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1.0'])\n",
|
1568 |
+
"\n",
|
1569 |
+
"#plt.savefig('fig_5_3.png', dpi= 600, bbox_inches='tight')\n",
|
1570 |
+
"#plt.savefig('fig_5_3.png', dpi= 600)\n",
|
1571 |
+
"\n",
|
1572 |
+
"\n",
|
1573 |
+
"# Show the plot\n",
|
1574 |
+
"plt.show()\n"
|
1575 |
+
]
|
1576 |
+
},
|
1577 |
+
{
|
1578 |
+
"cell_type": "code",
|
1579 |
+
"execution_count": null,
|
1580 |
+
"id": "1999e662",
|
1581 |
+
"metadata": {
|
1582 |
+
"scrolled": true
|
1583 |
+
},
|
1584 |
+
"outputs": [],
|
1585 |
+
"source": [
|
1586 |
+
"import matplotlib.pyplot as plt\n",
|
1587 |
+
"%matplotlib inline\n",
|
1588 |
+
"import seaborn as sns\n",
|
1589 |
+
"from statannotations.Annotator import Annotator\n",
|
1590 |
+
"\n",
|
1591 |
+
"x = \"stim_folder\"\n",
|
1592 |
+
"y = \"sp_corr\"\n",
|
1593 |
+
"\n",
|
1594 |
+
"# Filter the DataFrame based on the 'Time' condition\n",
|
1595 |
+
"subset_df = result_df\n",
|
1596 |
+
"\n",
|
1597 |
+
"# Increase the figure size and font size\n",
|
1598 |
+
"plt.figure(figsize=(6, 4))\n",
|
1599 |
+
"sns.set(style=\"white\", rc={\"axes.edgecolor\": \"black\", \"grid.color\": \"black\", \"grid.linestyle\": \":\"}, font_scale=1.5)\n",
|
1600 |
+
"\n",
|
1601 |
+
"# Create a palette with distinct colors\n",
|
1602 |
+
"palette = sns.color_palette(\"Set3\", n_colors=len(subset_df[x].unique())) # You can choose any other colormap\n",
|
1603 |
+
"\n",
|
1604 |
+
"# Create the barplot with the distinct color palette\n",
|
1605 |
+
"ax = sns.barplot(data=subset_df, x=x, y=y, palette=palette, capsize=0.1, errwidth=1.5) # Added capsize and errwidth for error bars\n",
|
1606 |
+
"# ax = sns.boxplot(data=subset_df, x=x, y=y, palette=palette) # Added capsize and errwidth for error bars\n",
|
1607 |
+
"\n",
|
1608 |
+
"\n",
|
1609 |
+
"# Add statistical annotations\n",
|
1610 |
+
"annot = Annotator(ax, combinations_list, data=subset_df, x=x, y=y)\n",
|
1611 |
+
"annot.new_plot(ax, combinations_list,\n",
|
1612 |
+
" data=subset_df, x=x, y=y)\n",
|
1613 |
+
"annot.configure(test='Kruskal', text_format='star', loc='outside',\n",
|
1614 |
+
" comparisons_correction=\"fdr_bh\",\n",
|
1615 |
+
" hide_non_significant=True,\n",
|
1616 |
+
" pvalue_thresholds=[[1e-3, '∗∗∗'], [1e-2, \"∗∗\"], [0.05, \"∗\"]], verbose=2, line_height = .05)\n",
|
1617 |
+
"\n",
|
1618 |
+
"#annot.apply_test()\n",
|
1619 |
+
"\n",
|
1620 |
+
"# Adjust the position of stars between lines\n",
|
1621 |
+
"#annot.line_offset_to_group = 0.5\n",
|
1622 |
+
"#annot.line_offset = 0.3 # Adjust this value to move the stars closer to the lines\n",
|
1623 |
+
"#annot.text_offset = 0.05 # Adjust this value to move the stars closer to the lines\n",
|
1624 |
+
"#ax, test_results = annot.annotate(line_offset = 0.01)\n",
|
1625 |
+
"#ax, test_results = annot.annotate()\n",
|
1626 |
+
"\n",
|
1627 |
+
"ax, test_results = annot.apply_test().annotate(line_offset=0.001)\n",
|
1628 |
+
"\n",
|
1629 |
+
"# Remove top and right plot edges\n",
|
1630 |
+
"sns.despine()\n",
|
1631 |
+
"\n",
|
1632 |
+
"# Define explicit legend handles\n",
|
1633 |
+
"legend_labels = ['faces', 'faces_inv', 'objects', 'objects_inv', 'pareidolia', 'pareidolia_inv', 'pareidolia_art', 'pareidolia_art_inv']\n",
|
1634 |
+
"legend_handles = [plt.Rectangle((0, 0), 1, 1, color=color, label=label) for color, label in zip(palette, legend_labels)]\n",
|
1635 |
+
"\n",
|
1636 |
+
"# Create legend without edges and without error bars, and change the title to \"CNN\"\n",
|
1637 |
+
"legend = ax.legend(handles=legend_handles, title=\"\", title_fontsize='16', loc='upper left', bbox_to_anchor=(1, 1), frameon=False, fontsize=16)\n",
|
1638 |
+
"\n",
|
1639 |
+
"\n",
|
1640 |
+
"\n",
|
1641 |
+
"# Remove x-axis ticks and labels\n",
|
1642 |
+
"#ax.set_xticks([])\n",
|
1643 |
+
"#ax.set_xticklabels([])\n",
|
1644 |
+
"\n",
|
1645 |
+
"# Set y-axis limits from 0 to 1\n",
|
1646 |
+
"#ax.set_ylim(0.25, 0.35)\n",
|
1647 |
+
"#ax.set_yticks(np.linspace(0.25, 0.35, num=6))\n",
|
1648 |
+
"\n",
|
1649 |
+
"# Show the tick marks on the left side of the y-axis\n",
|
1650 |
+
"#ax.tick_params(axis='y', direction='out', length=5) # Adjust 'length' as needed\n",
|
1651 |
+
"ax.tick_params(tick1On=True)\n",
|
1652 |
+
"\n",
|
1653 |
+
"# Set font size for axis labels and title\n",
|
1654 |
+
"ax.set_ylabel('DG3 & HG correlation [Spearman\\'s r]', fontsize=16)\n",
|
1655 |
+
"#ax.set_ylabel('')\n",
|
1656 |
+
"#ax.set_xlabel('2 (orientation) x 4 (stimuli condition)', fontsize=16)\n",
|
1657 |
+
"ax.set_xticklabels(ax.get_xticklabels(), rotation=90)\n",
|
1658 |
+
"\n",
|
1659 |
+
"\n",
|
1660 |
+
"#ax.set_title('255ms:lay13-15', fontsize=18)\n",
|
1661 |
+
"\n",
|
1662 |
+
"# Set font size for tick labels\n",
|
1663 |
+
"ax.tick_params(axis='both', labelsize=16)\n",
|
1664 |
+
"\n",
|
1665 |
+
"# Uncomment the following lines to show y-axis ticks and tick labels\n",
|
1666 |
+
"# ax.set_yticks(np.linspace(0, 1.0, num=11)) # Uncomment if not already set\n",
|
1667 |
+
"#ax.set_yticklabels(['0.0', '0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1.0'])\n",
|
1668 |
+
"\n",
|
1669 |
+
"#plt.savefig('fig_5_3.png', dpi= 600, bbox_inches='tight')\n",
|
1670 |
+
"#plt.savefig('fig_5_3.png', dpi= 600)\n",
|
1671 |
+
"\n",
|
1672 |
+
"\n",
|
1673 |
+
"# Show the plot\n",
|
1674 |
+
"plt.show()\n"
|
1675 |
+
]
|
1676 |
+
},
|
1677 |
+
{
|
1678 |
+
"cell_type": "code",
|
1679 |
+
"execution_count": null,
|
1680 |
+
"id": "b2dc4e82",
|
1681 |
+
"metadata": {},
|
1682 |
+
"outputs": [],
|
1683 |
+
"source": [
|
1684 |
+
"print(\"Length of x:\", len(subset_df[x]))\n",
|
1685 |
+
"print(\"Length of y:\", len(subset_df[y]))"
|
1686 |
+
]
|
1687 |
+
},
|
1688 |
+
{
|
1689 |
+
"cell_type": "code",
|
1690 |
+
"execution_count": null,
|
1691 |
+
"id": "68b2c5b2",
|
1692 |
+
"metadata": {},
|
1693 |
+
"outputs": [],
|
1694 |
+
"source": []
|
1695 |
+
},
|
1696 |
+
{
|
1697 |
+
"cell_type": "code",
|
1698 |
+
"execution_count": null,
|
1699 |
+
"id": "bf6f386d",
|
1700 |
+
"metadata": {},
|
1701 |
+
"outputs": [],
|
1702 |
+
"source": [
|
1703 |
+
"loaded_df_csv"
|
1704 |
+
]
|
1705 |
+
},
|
1706 |
+
{
|
1707 |
+
"cell_type": "code",
|
1708 |
+
"execution_count": null,
|
1709 |
+
"id": "c57e732a",
|
1710 |
+
"metadata": {},
|
1711 |
+
"outputs": [],
|
1712 |
+
"source": [
|
1713 |
+
"df_agg_hg = loaded_df_csv"
|
1714 |
+
]
|
1715 |
+
},
|
1716 |
+
{
|
1717 |
+
"cell_type": "code",
|
1718 |
+
"execution_count": null,
|
1719 |
+
"id": "aa645e29",
|
1720 |
+
"metadata": {},
|
1721 |
+
"outputs": [],
|
1722 |
+
"source": [
|
1723 |
+
"import numpy as np\n",
|
1724 |
+
"from scipy.misc import face\n",
|
1725 |
+
"from scipy.ndimage import zoom\n",
|
1726 |
+
"from scipy.special import logsumexp\n",
|
1727 |
+
"import torch\n",
|
1728 |
+
"import matplotlib.pyplot as plt\n",
|
1729 |
+
"\n",
|
1730 |
+
"import deepgaze_pytorch\n",
|
1731 |
+
"\n",
|
1732 |
+
"DEVICE = 'cuda'\n",
|
1733 |
+
"\n",
|
1734 |
+
"# you can use DeepGazeI or DeepGazeIIE\n",
|
1735 |
+
"model = deepgaze_pytorch.DeepGazeIIE(pretrained=True).to(DEVICE)\n",
|
1736 |
+
"\n",
|
1737 |
+
"# image = face()\n",
|
1738 |
+
"\n",
|
1739 |
+
"x = []\n",
|
1740 |
+
"\n",
|
1741 |
+
"\n",
|
1742 |
+
"for i in range(len(df_agg_hg)):\n",
|
1743 |
+
" \n",
|
1744 |
+
" stim_folder_name = df_agg_hg['stim_folder'][i]\n",
|
1745 |
+
" stim_image_name = df_agg_hg['stim_name'][i]\n",
|
1746 |
+
" \n",
|
1747 |
+
" folder_path = '/home/pranjul/DeepGaze/Bachelorarbeit_Christine_Huschens/DG2E_HG_heatmaps_c/'\n",
|
1748 |
+
" \n",
|
1749 |
+
" image = cv2.imread('/home/pranjul/DeepGaze/Bachelorarbeit_Christine_Huschens/stimuli/' + stim_folder_name + '/' + stim_image_name + '.tif')\n",
|
1750 |
+
" #create_folder(os.path.join(folder_path, stim_folder_name))\n",
|
1751 |
+
"\n",
|
1752 |
+
" #image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n",
|
1753 |
+
" image = cv2.resize(image, (1200, 1200)) \n",
|
1754 |
+
" \n",
|
1755 |
+
" # load precomputed centerbias log density (from MIT1003) over a 1024x1024 image\n",
|
1756 |
+
" # you can download the centerbias from https://github.com/matthias-k/DeepGaze/releases/download/v1.0.0/centerbias_mit1003.npy\n",
|
1757 |
+
" # alternatively, you can use a uniform centerbias via `centerbias_template = np.zeros((1024, 1024))`.\n",
|
1758 |
+
" centerbias_template = np.load('centerbias_mit1003.npy')\n",
|
1759 |
+
" # centerbias_template = np.zeros((1024, 1024))\n",
|
1760 |
+
" # rescale to match image size\n",
|
1761 |
+
" centerbias = zoom(centerbias_template, (image.shape[0]/centerbias_template.shape[0], image.shape[1]/centerbias_template.shape[1]), order=0, mode='nearest')\n",
|
1762 |
+
" # renormalize log density\n",
|
1763 |
+
" centerbias -= logsumexp(centerbias)\n",
|
1764 |
+
"\n",
|
1765 |
+
" image_tensor = torch.tensor([image.transpose(2, 0, 1)]).to(DEVICE)\n",
|
1766 |
+
" centerbias_tensor = torch.tensor([centerbias]).to(DEVICE)\n",
|
1767 |
+
"\n",
|
1768 |
+
" log_density_prediction = model(image_tensor, centerbias_tensor)\n",
|
1769 |
+
" \n",
|
1770 |
+
" a = log_density_prediction.detach().cpu().numpy()[0,0]\n",
|
1771 |
+
" \n",
|
1772 |
+
" x.append(a)\n",
|
1773 |
+
" \n",
|
1774 |
+
" '''\n",
|
1775 |
+
" f, axs = plt.subplots(nrows=1, ncols=2, figsize=(16, 9))\n",
|
1776 |
+
" axs[0].imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))\n",
|
1777 |
+
" # axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1778 |
+
" # axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1779 |
+
" axs[0].set_axis_off()\n",
|
1780 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
1781 |
+
" # axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1782 |
+
" # axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='yellow', zorder=100)\n",
|
1783 |
+
" axs[1].set_axis_off()\n",
|
1784 |
+
" # plt.savefig(os.path.join('DG2_heatmaps', '{0}.jpg'.format(i)))\n",
|
1785 |
+
" \n",
|
1786 |
+
" \n",
|
1787 |
+
" f, axs = plt.subplots(nrows=1, ncols=3, figsize=(16, 9))\n",
|
1788 |
+
" axs[0].imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))\n",
|
1789 |
+
" #axs[0].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1790 |
+
" #axs[0].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='white', zorder=100)\n",
|
1791 |
+
" axs[0].set_axis_off()\n",
|
1792 |
+
" axs[1].matshow(log_density_prediction.detach().cpu().numpy()[0, 0]) # first image in batch, first (and only) channel\n",
|
1793 |
+
" #axs[1].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1794 |
+
" #axs[1].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='white', zorder=100)\n",
|
1795 |
+
" axs[1].set_axis_off()\n",
|
1796 |
+
" axs[2].matshow(df_agg_hg['hg'][i])\n",
|
1797 |
+
" #axs[2].plot(fixation_history_x, fixation_history_y, 'o-', color='red')\n",
|
1798 |
+
" #axs[2].scatter(fixation_history_x[-1], fixation_history_y[-1], 100, color='white', zorder=100)\n",
|
1799 |
+
" axs[2].set_axis_off()\n",
|
1800 |
+
" plt.tight_layout()\n",
|
1801 |
+
" plt.savefig(os.path.join(folder_path, stim_folder_name, stim_image_name + '.png'))\n",
|
1802 |
+
" #plt.show()\n",
|
1803 |
+
" plt.close()\n",
|
1804 |
+
" '''\n",
|
1805 |
+
" \n",
|
1806 |
+
" #break"
|
1807 |
+
]
|
1808 |
+
},
|
1809 |
+
{
|
1810 |
+
"cell_type": "code",
|
1811 |
+
"execution_count": null,
|
1812 |
+
"id": "61eaa85b",
|
1813 |
+
"metadata": {},
|
1814 |
+
"outputs": [],
|
1815 |
+
"source": []
|
1816 |
+
},
|
1817 |
+
{
|
1818 |
+
"cell_type": "code",
|
1819 |
+
"execution_count": null,
|
1820 |
+
"id": "91bef121",
|
1821 |
+
"metadata": {},
|
1822 |
+
"outputs": [],
|
1823 |
+
"source": [
|
1824 |
+
"len(x)"
|
1825 |
+
]
|
1826 |
+
},
|
1827 |
+
{
|
1828 |
+
"cell_type": "code",
|
1829 |
+
"execution_count": null,
|
1830 |
+
"id": "6bc2fa05",
|
1831 |
+
"metadata": {},
|
1832 |
+
"outputs": [],
|
1833 |
+
"source": []
|
1834 |
+
},
|
1835 |
+
{
|
1836 |
+
"cell_type": "code",
|
1837 |
+
"execution_count": null,
|
1838 |
+
"id": "24f5fd26",
|
1839 |
+
"metadata": {},
|
1840 |
+
"outputs": [],
|
1841 |
+
"source": [
|
1842 |
+
"# Add the Spearman correlation values to the DataFrame\n",
|
1843 |
+
"df_agg_hg['dg2'] = x"
|
1844 |
+
]
|
1845 |
+
},
|
1846 |
+
{
|
1847 |
+
"cell_type": "code",
|
1848 |
+
"execution_count": null,
|
1849 |
+
"id": "6d007260",
|
1850 |
+
"metadata": {},
|
1851 |
+
"outputs": [],
|
1852 |
+
"source": [
|
1853 |
+
"df_agg_hg"
|
1854 |
+
]
|
1855 |
+
},
|
1856 |
+
{
|
1857 |
+
"cell_type": "code",
|
1858 |
+
"execution_count": null,
|
1859 |
+
"id": "7fecd938",
|
1860 |
+
"metadata": {},
|
1861 |
+
"outputs": [],
|
1862 |
+
"source": []
|
1863 |
+
},
|
1864 |
+
{
|
1865 |
+
"cell_type": "code",
|
1866 |
+
"execution_count": null,
|
1867 |
+
"id": "fda8ef1e",
|
1868 |
+
"metadata": {},
|
1869 |
+
"outputs": [],
|
1870 |
+
"source": []
|
1871 |
+
},
|
1872 |
+
{
|
1873 |
+
"cell_type": "code",
|
1874 |
+
"execution_count": null,
|
1875 |
+
"id": "c030811c",
|
1876 |
+
"metadata": {},
|
1877 |
+
"outputs": [],
|
1878 |
+
"source": []
|
1879 |
+
},
|
1880 |
+
{
|
1881 |
+
"cell_type": "code",
|
1882 |
+
"execution_count": null,
|
1883 |
+
"id": "f707fe40",
|
1884 |
+
"metadata": {},
|
1885 |
+
"outputs": [],
|
1886 |
+
"source": [
|
1887 |
+
"\n",
|
1888 |
+
"\n",
|
1889 |
+
"# Define a function to serialize the 2D arrays\n",
|
1890 |
+
"def serialize_array(arr):\n",
|
1891 |
+
" return base64.b64encode(pickle.dumps(arr)).decode('utf-8')\n",
|
1892 |
+
"\n",
|
1893 |
+
"# Apply the serialization function to the column\n",
|
1894 |
+
"df_agg_hg['hg'] = df_agg_hg['hg'].apply(serialize_array)\n",
|
1895 |
+
"\n",
|
1896 |
+
"# Apply the serialization function to the column\n",
|
1897 |
+
"df_agg_hg['dg2'] = df_agg_hg['dg2'].apply(serialize_array)\n",
|
1898 |
+
"\n",
|
1899 |
+
"# Save the DataFrame to a CSV file\n",
|
1900 |
+
"df_agg_hg.to_csv('/raid/pranjul/agg_hg_dg2_26_subs_c.csv', index=False)"
|
1901 |
+
]
|
1902 |
+
},
|
1903 |
+
{
|
1904 |
+
"cell_type": "code",
|
1905 |
+
"execution_count": null,
|
1906 |
+
"id": "412a8aa4",
|
1907 |
+
"metadata": {},
|
1908 |
+
"outputs": [],
|
1909 |
+
"source": [
|
1910 |
+
"import base64\n",
|
1911 |
+
"\n",
|
1912 |
+
"# Load the DataFrame from the CSV file\n",
|
1913 |
+
"loaded_df_csv = pd.read_csv('/raid/pranjul/agg_hg_dg2_26_subs_c.csv')\n",
|
1914 |
+
"\n",
|
1915 |
+
"# Define a function to deserialize the 2D arrays\n",
|
1916 |
+
"def deserialize_array(serialized_arr):\n",
|
1917 |
+
" return pickle.loads(base64.b64decode(serialized_arr.encode('utf-8')))\n",
|
1918 |
+
"\n",
|
1919 |
+
"# Apply the deserialization function to the column\n",
|
1920 |
+
"loaded_df_csv['hg'] = loaded_df_csv['hg'].apply(deserialize_array)\n",
|
1921 |
+
"\n",
|
1922 |
+
"# Apply the deserialization function to the column\n",
|
1923 |
+
"loaded_df_csv['dg2'] = loaded_df_csv['dg2'].apply(deserialize_array)\n",
|
1924 |
+
"\n",
|
1925 |
+
"# Now, loaded_df contains the original DataFrame with 2D arrays in 'Array_Column'"
|
1926 |
+
]
|
1927 |
+
},
|
1928 |
+
{
|
1929 |
+
"cell_type": "code",
|
1930 |
+
"execution_count": null,
|
1931 |
+
"id": "51936049",
|
1932 |
+
"metadata": {},
|
1933 |
+
"outputs": [],
|
1934 |
+
"source": [
|
1935 |
+
"loaded_df_csv"
|
1936 |
+
]
|
1937 |
+
},
|
1938 |
+
{
|
1939 |
+
"cell_type": "code",
|
1940 |
+
"execution_count": null,
|
1941 |
+
"id": "c9ff6f39",
|
1942 |
+
"metadata": {},
|
1943 |
+
"outputs": [],
|
1944 |
+
"source": []
|
1945 |
+
},
|
1946 |
+
{
|
1947 |
+
"cell_type": "code",
|
1948 |
+
"execution_count": null,
|
1949 |
+
"id": "42e4c616",
|
1950 |
+
"metadata": {},
|
1951 |
+
"outputs": [],
|
1952 |
+
"source": []
|
1953 |
+
},
|
1954 |
+
{
|
1955 |
+
"cell_type": "code",
|
1956 |
+
"execution_count": null,
|
1957 |
+
"id": "2db1eb6d",
|
1958 |
+
"metadata": {},
|
1959 |
+
"outputs": [],
|
1960 |
+
"source": [
|
1961 |
+
"import pandas as pd\n",
|
1962 |
+
"\n",
|
1963 |
+
"# Create two sample dataframes\n",
|
1964 |
+
"data1 = {'SharedColumn': [1, 2, 3, 4, 5],\n",
|
1965 |
+
" 'Data1_Column': ['A', 'B', 'C', 'D', 'E']}\n",
|
1966 |
+
"df1 = pd.DataFrame(data1)\n",
|
1967 |
+
"\n",
|
1968 |
+
"data2 = {'SharedColumn': [1, 1, 2, 2, 3],\n",
|
1969 |
+
" 'Data2_Column': [10, 20, 30, 40, 50]}\n",
|
1970 |
+
"df2 = pd.DataFrame(data2)\n",
|
1971 |
+
"\n",
|
1972 |
+
"# Merge dataframes based on the shared column\n",
|
1973 |
+
"merged_df = pd.merge(df1, df2, on='SharedColumn', how='outer')\n",
|
1974 |
+
"\n",
|
1975 |
+
"# Divide the dataframes based on unique values in the 'SharedColumn'\n",
|
1976 |
+
"unique_values_df1 = merged_df[merged_df['Data2_Column'].isnull()].drop('Data2_Column', axis=1)\n",
|
1977 |
+
"repeated_values_df2 = merged_df[merged_df['Data1_Column'].notnull()].drop('Data1_Column', axis=1)\n",
|
1978 |
+
"\n",
|
1979 |
+
"# Display the results\n",
|
1980 |
+
"print(\"Unique Values in df1:\")\n",
|
1981 |
+
"print(unique_values_df1)\n",
|
1982 |
+
"\n",
|
1983 |
+
"print(\"\\nRepeated Values in df2:\")\n",
|
1984 |
+
"print(repeated_values_df2)\n"
|
1985 |
+
]
|
1986 |
+
},
|
1987 |
+
{
|
1988 |
+
"cell_type": "code",
|
1989 |
+
"execution_count": null,
|
1990 |
+
"id": "3fbe8c57",
|
1991 |
+
"metadata": {},
|
1992 |
+
"outputs": [],
|
1993 |
+
"source": [
|
1994 |
+
"df1"
|
1995 |
+
]
|
1996 |
+
},
|
1997 |
+
{
|
1998 |
+
"cell_type": "code",
|
1999 |
+
"execution_count": null,
|
2000 |
+
"id": "3964aa7b",
|
2001 |
+
"metadata": {},
|
2002 |
+
"outputs": [],
|
2003 |
+
"source": [
|
2004 |
+
"df2"
|
2005 |
+
]
|
2006 |
+
},
|
2007 |
+
{
|
2008 |
+
"cell_type": "code",
|
2009 |
+
"execution_count": null,
|
2010 |
+
"id": "72ad2dbf",
|
2011 |
+
"metadata": {},
|
2012 |
+
"outputs": [],
|
2013 |
+
"source": []
|
2014 |
+
},
|
2015 |
+
{
|
2016 |
+
"cell_type": "code",
|
2017 |
+
"execution_count": null,
|
2018 |
+
"id": "fba47112",
|
2019 |
+
"metadata": {},
|
2020 |
+
"outputs": [],
|
2021 |
+
"source": [
|
2022 |
+
"pd.merge(loaded_df_csv, df_sh, on='stim_folder', how='outer')"
|
2023 |
+
]
|
2024 |
+
},
|
2025 |
+
{
|
2026 |
+
"cell_type": "code",
|
2027 |
+
"execution_count": null,
|
2028 |
+
"id": "6873e2b2",
|
2029 |
+
"metadata": {},
|
2030 |
+
"outputs": [],
|
2031 |
+
"source": []
|
2032 |
+
},
|
2033 |
+
{
|
2034 |
+
"cell_type": "code",
|
2035 |
+
"execution_count": null,
|
2036 |
+
"id": "b568d804",
|
2037 |
+
"metadata": {},
|
2038 |
+
"outputs": [],
|
2039 |
+
"source": []
|
2040 |
+
},
|
2041 |
+
{
|
2042 |
+
"cell_type": "code",
|
2043 |
+
"execution_count": null,
|
2044 |
+
"id": "0ec6401a",
|
2045 |
+
"metadata": {},
|
2046 |
+
"outputs": [],
|
2047 |
+
"source": []
|
2048 |
+
},
|
2049 |
+
{
|
2050 |
+
"cell_type": "code",
|
2051 |
+
"execution_count": null,
|
2052 |
+
"id": "5fbccdc1",
|
2053 |
+
"metadata": {},
|
2054 |
+
"outputs": [],
|
2055 |
+
"source": []
|
2056 |
+
},
|
2057 |
+
{
|
2058 |
+
"cell_type": "code",
|
2059 |
+
"execution_count": null,
|
2060 |
+
"id": "e79d4b83",
|
2061 |
+
"metadata": {},
|
2062 |
+
"outputs": [],
|
2063 |
+
"source": []
|
2064 |
+
},
|
2065 |
+
{
|
2066 |
+
"cell_type": "code",
|
2067 |
+
"execution_count": null,
|
2068 |
+
"id": "05bf148f",
|
2069 |
+
"metadata": {},
|
2070 |
+
"outputs": [],
|
2071 |
+
"source": []
|
2072 |
+
},
|
2073 |
+
{
|
2074 |
+
"cell_type": "code",
|
2075 |
+
"execution_count": null,
|
2076 |
+
"id": "3492dab1",
|
2077 |
+
"metadata": {},
|
2078 |
+
"outputs": [],
|
2079 |
+
"source": [
|
2080 |
+
"sp_corr_dg2 = []\n",
|
2081 |
+
"for i in range(len(loaded_df_csv)):\n",
|
2082 |
+
" sp_corr_dg2.append(spearmanr(loaded_df_csv['dg2'][i].flatten(), loaded_df_csv['hg'][i].flatten())[0])\n",
|
2083 |
+
" #break"
|
2084 |
+
]
|
2085 |
+
},
|
2086 |
+
{
|
2087 |
+
"cell_type": "code",
|
2088 |
+
"execution_count": null,
|
2089 |
+
"id": "1cb4d2a9",
|
2090 |
+
"metadata": {},
|
2091 |
+
"outputs": [],
|
2092 |
+
"source": [
|
2093 |
+
"# Add the Spearman correlation values to the DataFrame\n",
|
2094 |
+
"loaded_df_csv['sp_corr_dg2'] = sp_corr_dg2"
|
2095 |
+
]
|
2096 |
+
},
|
2097 |
+
{
|
2098 |
+
"cell_type": "code",
|
2099 |
+
"execution_count": null,
|
2100 |
+
"id": "e9809da0",
|
2101 |
+
"metadata": {},
|
2102 |
+
"outputs": [],
|
2103 |
+
"source": [
|
2104 |
+
"loaded_df_csv"
|
2105 |
+
]
|
2106 |
+
},
|
2107 |
+
{
|
2108 |
+
"cell_type": "code",
|
2109 |
+
"execution_count": null,
|
2110 |
+
"id": "0d679042",
|
2111 |
+
"metadata": {},
|
2112 |
+
"outputs": [],
|
2113 |
+
"source": [
|
2114 |
+
"loaded_df_csv = loaded_df_csv.drop(columns=['dg2', 'hg'])"
|
2115 |
+
]
|
2116 |
+
},
|
2117 |
+
{
|
2118 |
+
"cell_type": "code",
|
2119 |
+
"execution_count": null,
|
2120 |
+
"id": "db0c138a",
|
2121 |
+
"metadata": {},
|
2122 |
+
"outputs": [],
|
2123 |
+
"source": [
|
2124 |
+
"loaded_df_csv"
|
2125 |
+
]
|
2126 |
+
},
|
2127 |
+
{
|
2128 |
+
"cell_type": "code",
|
2129 |
+
"execution_count": null,
|
2130 |
+
"id": "feb185b0",
|
2131 |
+
"metadata": {},
|
2132 |
+
"outputs": [],
|
2133 |
+
"source": [
|
2134 |
+
"loaded_df_csv['stim_folder'].value_counts()"
|
2135 |
+
]
|
2136 |
+
},
|
2137 |
+
{
|
2138 |
+
"cell_type": "code",
|
2139 |
+
"execution_count": null,
|
2140 |
+
"id": "36efceb1",
|
2141 |
+
"metadata": {},
|
2142 |
+
"outputs": [],
|
2143 |
+
"source": [
|
2144 |
+
"# Define the custom order\n",
|
2145 |
+
"custom_order = ['faces', 'faces_inv', 'objects', 'objects_inv', 'pareidolia', 'pareidolia_inv', 'pareidolia_art', 'pareidolia_art_inv']\n",
|
2146 |
+
"\n",
|
2147 |
+
"# Convert the 'stim_folder' column to a Categorical data type with the custom order\n",
|
2148 |
+
"loaded_df_csv['stim_folder'] = pd.Categorical(loaded_df_csv['stim_folder'], categories=custom_order, ordered=True)\n",
|
2149 |
+
"\n",
|
2150 |
+
"# Sort the DataFrame based on the custom order\n",
|
2151 |
+
"df_sorted = loaded_df_csv.sort_values(by='stim_folder')\n",
|
2152 |
+
"\n",
|
2153 |
+
"# Print the sorted DataFrame\n",
|
2154 |
+
"print(df_sorted)"
|
2155 |
+
]
|
2156 |
+
},
|
2157 |
+
{
|
2158 |
+
"cell_type": "code",
|
2159 |
+
"execution_count": null,
|
2160 |
+
"id": "3d9bcec6",
|
2161 |
+
"metadata": {},
|
2162 |
+
"outputs": [],
|
2163 |
+
"source": [
|
2164 |
+
"df_sorted"
|
2165 |
+
]
|
2166 |
+
},
|
2167 |
+
{
|
2168 |
+
"cell_type": "code",
|
2169 |
+
"execution_count": null,
|
2170 |
+
"id": "02efe074",
|
2171 |
+
"metadata": {},
|
2172 |
+
"outputs": [],
|
2173 |
+
"source": [
|
2174 |
+
"df_sorted_sh = pd.merge(df_sorted, df_sh, on='stim_folder', how='outer')"
|
2175 |
+
]
|
2176 |
+
},
|
2177 |
+
{
|
2178 |
+
"cell_type": "code",
|
2179 |
+
"execution_count": null,
|
2180 |
+
"id": "293790d5",
|
2181 |
+
"metadata": {},
|
2182 |
+
"outputs": [],
|
2183 |
+
"source": [
|
2184 |
+
"df_sorted_sh"
|
2185 |
+
]
|
2186 |
+
},
|
2187 |
+
{
|
2188 |
+
"cell_type": "code",
|
2189 |
+
"execution_count": null,
|
2190 |
+
"id": "7cea2334",
|
2191 |
+
"metadata": {},
|
2192 |
+
"outputs": [],
|
2193 |
+
"source": [
|
2194 |
+
"# Divide Column1 by Column2\n",
|
2195 |
+
"df_sorted_sh['sh_corrected'] = df_sorted_sh['sp_corr_dg2'] / df_sorted_sh['sp_corr_splt_hlf']"
|
2196 |
+
]
|
2197 |
+
},
|
2198 |
+
{
|
2199 |
+
"cell_type": "code",
|
2200 |
+
"execution_count": null,
|
2201 |
+
"id": "af406de8",
|
2202 |
+
"metadata": {},
|
2203 |
+
"outputs": [],
|
2204 |
+
"source": [
|
2205 |
+
"df_sorted_sh"
|
2206 |
+
]
|
2207 |
+
},
|
2208 |
+
{
|
2209 |
+
"cell_type": "code",
|
2210 |
+
"execution_count": null,
|
2211 |
+
"id": "5f2aa57c",
|
2212 |
+
"metadata": {
|
2213 |
+
"scrolled": false
|
2214 |
+
},
|
2215 |
+
"outputs": [],
|
2216 |
+
"source": [
|
2217 |
+
"import matplotlib.pyplot as plt\n",
|
2218 |
+
"%matplotlib inline\n",
|
2219 |
+
"import seaborn as sns\n",
|
2220 |
+
"from statannotations.Annotator import Annotator\n",
|
2221 |
+
"\n",
|
2222 |
+
"x = \"stim_folder\"\n",
|
2223 |
+
"y = \"sh_corrected\"\n",
|
2224 |
+
"\n",
|
2225 |
+
"# Filter the DataFrame based on the 'Time' condition\n",
|
2226 |
+
"subset_df = df_sorted_sh\n",
|
2227 |
+
"\n",
|
2228 |
+
"# Increase the figure size and font size\n",
|
2229 |
+
"plt.figure(figsize=(6, 4))\n",
|
2230 |
+
"sns.set(style=\"white\", rc={\"axes.edgecolor\": \"black\", \"grid.color\": \"black\", \"grid.linestyle\": \":\"}, font_scale=1.5)\n",
|
2231 |
+
"\n",
|
2232 |
+
"# Create a palette with distinct colors\n",
|
2233 |
+
"palette = sns.color_palette(\"Set3\", n_colors=len(subset_df[x].unique())) # You can choose any other colormap\n",
|
2234 |
+
"\n",
|
2235 |
+
"# Create the barplot with the distinct color palette\n",
|
2236 |
+
"ax = sns.barplot(data=subset_df, x=x, y=y, palette=palette, capsize=0.1, errwidth=1.5) # Added capsize and errwidth for error bars\n",
|
2237 |
+
"# ax = sns.boxplot(data=subset_df, x=x, y=y, palette=palette) # Added capsize and errwidth for error bars\n",
|
2238 |
+
"\n",
|
2239 |
+
"\n",
|
2240 |
+
"# Add statistical annotations\n",
|
2241 |
+
"annot = Annotator(ax, combinations_list, data=subset_df, x=x, y=y)\n",
|
2242 |
+
"annot.new_plot(ax, combinations_list,\n",
|
2243 |
+
" data=subset_df, x=x, y=y)\n",
|
2244 |
+
"annot.configure(test='Kruskal', text_format='star', loc='outside',\n",
|
2245 |
+
" comparisons_correction=\"fdr_bh\",\n",
|
2246 |
+
" hide_non_significant=True,\n",
|
2247 |
+
" pvalue_thresholds=[[1e-3, '∗∗∗'], [1e-2, \"∗∗\"], [0.05, \"∗\"]], verbose=2, line_height = .05)\n",
|
2248 |
+
"\n",
|
2249 |
+
"#annot.apply_test()\n",
|
2250 |
+
"\n",
|
2251 |
+
"# Adjust the position of stars between lines\n",
|
2252 |
+
"#annot.line_offset_to_group = 0.5\n",
|
2253 |
+
"#annot.line_offset = 0.3 # Adjust this value to move the stars closer to the lines\n",
|
2254 |
+
"#annot.text_offset = 0.05 # Adjust this value to move the stars closer to the lines\n",
|
2255 |
+
"#ax, test_results = annot.annotate(line_offset = 0.01)\n",
|
2256 |
+
"#ax, test_results = annot.annotate()\n",
|
2257 |
+
"\n",
|
2258 |
+
"ax, test_results = annot.apply_test().annotate(line_offset=0.2)\n",
|
2259 |
+
"\n",
|
2260 |
+
"# Remove top and right plot edges\n",
|
2261 |
+
"sns.despine()\n",
|
2262 |
+
"\n",
|
2263 |
+
"# Define explicit legend handles\n",
|
2264 |
+
"legend_labels = ['faces', 'faces_inv', 'objects', 'objects_inv', 'pareidolia', 'pareidolia_inv', 'pareidolia_art', 'pareidolia_art_inv']\n",
|
2265 |
+
"legend_handles = [plt.Rectangle((0, 0), 1, 1, color=color, label=label) for color, label in zip(palette, legend_labels)]\n",
|
2266 |
+
"\n",
|
2267 |
+
"# Create legend without edges and without error bars, and change the title to \"CNN\"\n",
|
2268 |
+
"legend = ax.legend(handles=legend_handles, title=\"\", title_fontsize='16', loc='upper left', bbox_to_anchor=(1, 1), frameon=False, fontsize=16)\n",
|
2269 |
+
"\n",
|
2270 |
+
"\n",
|
2271 |
+
"\n",
|
2272 |
+
"# Remove x-axis ticks and labels\n",
|
2273 |
+
"#ax.set_xticks([])\n",
|
2274 |
+
"#ax.set_xticklabels([])\n",
|
2275 |
+
"\n",
|
2276 |
+
"# Set y-axis limits from 0 to 1\n",
|
2277 |
+
"ax.set_ylim(0.9, 1.1)\n",
|
2278 |
+
"ax.set_yticks(np.linspace(0.9, 1.1, num=11))\n",
|
2279 |
+
"\n",
|
2280 |
+
"# Show the tick marks on the left side of the y-axis\n",
|
2281 |
+
"#ax.tick_params(axis='y', direction='out', length=5) # Adjust 'length' as needed\n",
|
2282 |
+
"ax.tick_params(tick1On=True)\n",
|
2283 |
+
"\n",
|
2284 |
+
"# Set font size for axis labels and title\n",
|
2285 |
+
"ax.set_ylabel('S-H corrected DG2E & HG correlation \\n [Spearman\\'s r]', fontsize=16)\n",
|
2286 |
+
"#ax.set_ylabel('')\n",
|
2287 |
+
"#ax.set_xlabel('2 (orientation) x 4 (stimuli condition)', fontsize=16)\n",
|
2288 |
+
"ax.set_xticklabels(ax.get_xticklabels(), rotation=90)\n",
|
2289 |
+
"\n",
|
2290 |
+
"\n",
|
2291 |
+
"#ax.set_title('255ms:lay13-15', fontsize=18)\n",
|
2292 |
+
"\n",
|
2293 |
+
"# Set font size for tick labels\n",
|
2294 |
+
"ax.tick_params(axis='both', labelsize=16)\n",
|
2295 |
+
"\n",
|
2296 |
+
"# Uncomment the following lines to show y-axis ticks and tick labels\n",
|
2297 |
+
"# ax.set_yticks(np.linspace(0, 1.0, num=11)) # Uncomment if not already set\n",
|
2298 |
+
"#ax.set_yticklabels(['0.0', '0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1.0'])\n",
|
2299 |
+
"\n",
|
2300 |
+
"#plt.savefig('fig_5_3.png', dpi= 600, bbox_inches='tight')\n",
|
2301 |
+
"#plt.savefig('fig_5_3.png', dpi= 600)\n",
|
2302 |
+
"\n",
|
2303 |
+
"\n",
|
2304 |
+
"# Show the plot\n",
|
2305 |
+
"plt.show()\n"
|
2306 |
+
]
|
2307 |
+
},
|
2308 |
+
{
|
2309 |
+
"cell_type": "code",
|
2310 |
+
"execution_count": null,
|
2311 |
+
"id": "24057961",
|
2312 |
+
"metadata": {},
|
2313 |
+
"outputs": [],
|
2314 |
+
"source": []
|
2315 |
+
},
|
2316 |
+
{
|
2317 |
+
"cell_type": "code",
|
2318 |
+
"execution_count": null,
|
2319 |
+
"id": "5877b510",
|
2320 |
+
"metadata": {},
|
2321 |
+
"outputs": [],
|
2322 |
+
"source": []
|
2323 |
+
},
|
2324 |
+
{
|
2325 |
+
"cell_type": "code",
|
2326 |
+
"execution_count": null,
|
2327 |
+
"id": "a9a4da8a",
|
2328 |
+
"metadata": {},
|
2329 |
+
"outputs": [],
|
2330 |
+
"source": []
|
2331 |
+
},
|
2332 |
+
{
|
2333 |
+
"cell_type": "code",
|
2334 |
+
"execution_count": null,
|
2335 |
+
"id": "edfab771",
|
2336 |
+
"metadata": {},
|
2337 |
+
"outputs": [],
|
2338 |
+
"source": []
|
2339 |
+
},
|
2340 |
+
{
|
2341 |
+
"cell_type": "code",
|
2342 |
+
"execution_count": null,
|
2343 |
+
"id": "8f454bd9",
|
2344 |
+
"metadata": {},
|
2345 |
+
"outputs": [],
|
2346 |
+
"source": []
|
2347 |
+
},
|
2348 |
+
{
|
2349 |
+
"cell_type": "code",
|
2350 |
+
"execution_count": null,
|
2351 |
+
"id": "b7559c80",
|
2352 |
+
"metadata": {
|
2353 |
+
"scrolled": true
|
2354 |
+
},
|
2355 |
+
"outputs": [],
|
2356 |
+
"source": [
|
2357 |
+
"# Get all unique values in the 'sub' column\n",
|
2358 |
+
"unique_subs = df['sub'].unique()\n",
|
2359 |
+
"unique_subs"
|
2360 |
+
]
|
2361 |
+
},
|
2362 |
+
{
|
2363 |
+
"cell_type": "code",
|
2364 |
+
"execution_count": null,
|
2365 |
+
"id": "cc285653",
|
2366 |
+
"metadata": {},
|
2367 |
+
"outputs": [],
|
2368 |
+
"source": [
|
2369 |
+
"# Randomly shuffle the unique values\n",
|
2370 |
+
"np.random.shuffle(unique_subs)\n",
|
2371 |
+
"unique_subs"
|
2372 |
+
]
|
2373 |
+
},
|
2374 |
+
{
|
2375 |
+
"cell_type": "code",
|
2376 |
+
"execution_count": null,
|
2377 |
+
"id": "486cf66c",
|
2378 |
+
"metadata": {},
|
2379 |
+
"outputs": [],
|
2380 |
+
"source": [
|
2381 |
+
"# Calculate the index to split at (half of the unique values)\n",
|
2382 |
+
"split_index = len(unique_subs) // 2\n",
|
2383 |
+
"split_index"
|
2384 |
+
]
|
2385 |
+
},
|
2386 |
+
{
|
2387 |
+
"cell_type": "code",
|
2388 |
+
"execution_count": null,
|
2389 |
+
"id": "162006ff",
|
2390 |
+
"metadata": {
|
2391 |
+
"scrolled": false
|
2392 |
+
},
|
2393 |
+
"outputs": [],
|
2394 |
+
"source": [
|
2395 |
+
"# Select the first half of unique values\n",
|
2396 |
+
"selected_subs_df1 = unique_subs[:split_index]\n",
|
2397 |
+
"selected_subs_df1"
|
2398 |
+
]
|
2399 |
+
},
|
2400 |
+
{
|
2401 |
+
"cell_type": "code",
|
2402 |
+
"execution_count": null,
|
2403 |
+
"id": "e9ad53ad",
|
2404 |
+
"metadata": {},
|
2405 |
+
"outputs": [],
|
2406 |
+
"source": [
|
2407 |
+
"# Split the DataFrame into two based on the selected unique values\n",
|
2408 |
+
"df1 = df[df['sub'].isin(selected_subs_df1)]\n",
|
2409 |
+
"df2 = df[~df['sub'].isin(selected_subs_df1)]"
|
2410 |
+
]
|
2411 |
+
},
|
2412 |
+
{
|
2413 |
+
"cell_type": "code",
|
2414 |
+
"execution_count": null,
|
2415 |
+
"id": "783a8dd0",
|
2416 |
+
"metadata": {},
|
2417 |
+
"outputs": [],
|
2418 |
+
"source": [
|
2419 |
+
"df1"
|
2420 |
+
]
|
2421 |
+
},
|
2422 |
+
{
|
2423 |
+
"cell_type": "code",
|
2424 |
+
"execution_count": null,
|
2425 |
+
"id": "40436fc4",
|
2426 |
+
"metadata": {},
|
2427 |
+
"outputs": [],
|
2428 |
+
"source": [
|
2429 |
+
"df2"
|
2430 |
+
]
|
2431 |
+
},
|
2432 |
+
{
|
2433 |
+
"cell_type": "code",
|
2434 |
+
"execution_count": null,
|
2435 |
+
"id": "9d683c68",
|
2436 |
+
"metadata": {},
|
2437 |
+
"outputs": [],
|
2438 |
+
"source": [
|
2439 |
+
"df1_hg = df1.groupby(['stim_folder', 'stim_name'])['hg'].apply(lambda x: np.mean(x.tolist(), axis=0)).reset_index()\n",
|
2440 |
+
"\n",
|
2441 |
+
"# Rename the column 'old_col_name' to 'new_col_name'\n",
|
2442 |
+
"df1_hg = df1_hg.rename(columns={'hg': 'hg_1'})\n",
|
2443 |
+
"df1_hg"
|
2444 |
+
]
|
2445 |
+
},
|
2446 |
+
{
|
2447 |
+
"cell_type": "code",
|
2448 |
+
"execution_count": null,
|
2449 |
+
"id": "6c8fa6bb",
|
2450 |
+
"metadata": {},
|
2451 |
+
"outputs": [],
|
2452 |
+
"source": [
|
2453 |
+
"df2_hg = df2.groupby(['stim_folder', 'stim_name'])['hg'].apply(lambda x: np.mean(x.tolist(), axis=0)).reset_index()\n",
|
2454 |
+
"\n",
|
2455 |
+
"# Rename the column 'old_col_name' to 'new_col_name'\n",
|
2456 |
+
"df2_hg = df2_hg.rename(columns={'hg': 'hg_2'})\n",
|
2457 |
+
"df2_hg"
|
2458 |
+
]
|
2459 |
+
},
|
2460 |
+
{
|
2461 |
+
"cell_type": "code",
|
2462 |
+
"execution_count": null,
|
2463 |
+
"id": "0b460ad5",
|
2464 |
+
"metadata": {},
|
2465 |
+
"outputs": [],
|
2466 |
+
"source": [
|
2467 |
+
"# Merge the DataFrames based on 'stim_folder' and 'stim_name'\n",
|
2468 |
+
"merged_df = pd.merge(df1_hg, df2_hg, on=['stim_folder', 'stim_name'], how='inner')\n",
|
2469 |
+
"\n",
|
2470 |
+
"# Display the resulting merged DataFrame\n",
|
2471 |
+
"print(merged_df)"
|
2472 |
+
]
|
2473 |
+
},
|
2474 |
+
{
|
2475 |
+
"cell_type": "code",
|
2476 |
+
"execution_count": null,
|
2477 |
+
"id": "3be7535f",
|
2478 |
+
"metadata": {},
|
2479 |
+
"outputs": [],
|
2480 |
+
"source": [
|
2481 |
+
"plt.imshow(merged_df['hg_1'][1])"
|
2482 |
+
]
|
2483 |
+
},
|
2484 |
+
{
|
2485 |
+
"cell_type": "code",
|
2486 |
+
"execution_count": null,
|
2487 |
+
"id": "48eb82a8",
|
2488 |
+
"metadata": {},
|
2489 |
+
"outputs": [],
|
2490 |
+
"source": [
|
2491 |
+
"plt.imshow(merged_df['hg_2'][1])"
|
2492 |
+
]
|
2493 |
+
},
|
2494 |
+
{
|
2495 |
+
"cell_type": "code",
|
2496 |
+
"execution_count": null,
|
2497 |
+
"id": "778da74b",
|
2498 |
+
"metadata": {},
|
2499 |
+
"outputs": [],
|
2500 |
+
"source": []
|
2501 |
+
},
|
2502 |
+
{
|
2503 |
+
"cell_type": "code",
|
2504 |
+
"execution_count": null,
|
2505 |
+
"id": "955721a6",
|
2506 |
+
"metadata": {},
|
2507 |
+
"outputs": [],
|
2508 |
+
"source": [
|
2509 |
+
"sp_corr_splt_hlf = []\n",
|
2510 |
+
"for i in range(len(merged_df)):\n",
|
2511 |
+
" sp_corr_splt_hlf.append(spearmanr(merged_df['hg_1'][i].flatten(), merged_df['hg_2'][i].flatten())[0])\n",
|
2512 |
+
" #break"
|
2513 |
+
]
|
2514 |
+
},
|
2515 |
+
{
|
2516 |
+
"cell_type": "code",
|
2517 |
+
"execution_count": null,
|
2518 |
+
"id": "3cf2d0f9",
|
2519 |
+
"metadata": {},
|
2520 |
+
"outputs": [],
|
2521 |
+
"source": [
|
2522 |
+
"# Add the Spearman correlation values to the DataFrame\n",
|
2523 |
+
"merged_df['sp_corr_splt_hlf'] = sp_corr_splt_hlf"
|
2524 |
+
]
|
2525 |
+
},
|
2526 |
+
{
|
2527 |
+
"cell_type": "code",
|
2528 |
+
"execution_count": null,
|
2529 |
+
"id": "8e0ead15",
|
2530 |
+
"metadata": {},
|
2531 |
+
"outputs": [],
|
2532 |
+
"source": [
|
2533 |
+
"merged_df = merged_df.drop(columns=['hg_1', 'hg_2'])"
|
2534 |
+
]
|
2535 |
+
},
|
2536 |
+
{
|
2537 |
+
"cell_type": "code",
|
2538 |
+
"execution_count": null,
|
2539 |
+
"id": "0a2c8570",
|
2540 |
+
"metadata": {},
|
2541 |
+
"outputs": [],
|
2542 |
+
"source": [
|
2543 |
+
"merged_df"
|
2544 |
+
]
|
2545 |
+
},
|
2546 |
+
{
|
2547 |
+
"cell_type": "code",
|
2548 |
+
"execution_count": null,
|
2549 |
+
"id": "d302dc86",
|
2550 |
+
"metadata": {},
|
2551 |
+
"outputs": [],
|
2552 |
+
"source": [
|
2553 |
+
"merged_df = merged_df.groupby('stim_folder')['sp_corr_splt_hlf'].mean().reset_index()\n",
|
2554 |
+
"merged_df"
|
2555 |
+
]
|
2556 |
+
},
|
2557 |
+
{
|
2558 |
+
"cell_type": "code",
|
2559 |
+
"execution_count": null,
|
2560 |
+
"id": "9dbab573",
|
2561 |
+
"metadata": {},
|
2562 |
+
"outputs": [],
|
2563 |
+
"source": [
|
2564 |
+
"# Define the custom order\n",
|
2565 |
+
"custom_order = ['faces', 'faces_inv', 'objects', 'objects_inv', 'pareidolia', 'pareidolia_inv', 'pareidolia_art', 'pareidolia_art_inv']\n",
|
2566 |
+
"\n",
|
2567 |
+
"# Convert the 'stim_folder' column to a Categorical data type with the custom order\n",
|
2568 |
+
"merged_df['stim_folder'] = pd.Categorical(merged_df['stim_folder'], categories=custom_order, ordered=True)\n",
|
2569 |
+
"\n",
|
2570 |
+
"# Sort the DataFrame based on the custom order\n",
|
2571 |
+
"merged_df_sorted = merged_df.sort_values(by='stim_folder')\n",
|
2572 |
+
"\n",
|
2573 |
+
"# Print the sorted DataFrame\n",
|
2574 |
+
"print(merged_df_sorted)"
|
2575 |
+
]
|
2576 |
+
},
|
2577 |
+
{
|
2578 |
+
"cell_type": "code",
|
2579 |
+
"execution_count": null,
|
2580 |
+
"id": "150d3228",
|
2581 |
+
"metadata": {},
|
2582 |
+
"outputs": [],
|
2583 |
+
"source": [
|
2584 |
+
"# Extract the 'sp_corr_splt_hlf' column and save it to a NumPy array\n",
|
2585 |
+
"sp_corr_splt_hlf_array = merged_df_sorted['sp_corr_splt_hlf'].to_numpy()"
|
2586 |
+
]
|
2587 |
+
},
|
2588 |
+
{
|
2589 |
+
"cell_type": "code",
|
2590 |
+
"execution_count": null,
|
2591 |
+
"id": "01253db8",
|
2592 |
+
"metadata": {},
|
2593 |
+
"outputs": [],
|
2594 |
+
"source": [
|
2595 |
+
"sp_corr_splt_hlf_array"
|
2596 |
+
]
|
2597 |
+
},
|
2598 |
+
{
|
2599 |
+
"cell_type": "code",
|
2600 |
+
"execution_count": null,
|
2601 |
+
"id": "30d27acc",
|
2602 |
+
"metadata": {},
|
2603 |
+
"outputs": [],
|
2604 |
+
"source": []
|
2605 |
+
},
|
2606 |
+
{
|
2607 |
+
"cell_type": "code",
|
2608 |
+
"execution_count": null,
|
2609 |
+
"id": "f2d9d05e",
|
2610 |
+
"metadata": {},
|
2611 |
+
"outputs": [],
|
2612 |
+
"source": []
|
2613 |
+
},
|
2614 |
+
{
|
2615 |
+
"cell_type": "code",
|
2616 |
+
"execution_count": null,
|
2617 |
+
"id": "d751aabb",
|
2618 |
+
"metadata": {},
|
2619 |
+
"outputs": [],
|
2620 |
+
"source": []
|
2621 |
+
},
|
2622 |
+
{
|
2623 |
+
"cell_type": "code",
|
2624 |
+
"execution_count": null,
|
2625 |
+
"id": "2bcf36b3",
|
2626 |
+
"metadata": {},
|
2627 |
+
"outputs": [],
|
2628 |
+
"source": []
|
2629 |
+
},
|
2630 |
+
{
|
2631 |
+
"cell_type": "code",
|
2632 |
+
"execution_count": null,
|
2633 |
+
"id": "e2ce5789",
|
2634 |
+
"metadata": {},
|
2635 |
+
"outputs": [],
|
2636 |
+
"source": [
|
2637 |
+
"# Number of times to perform the bootstrap sampling\n",
|
2638 |
+
"num_iterations = 50\n",
|
2639 |
+
"sp_corr_splt_hlf_array = []\n",
|
2640 |
+
"\n",
|
2641 |
+
"for _ in range(num_iterations):\n",
|
2642 |
+
"\n",
|
2643 |
+
" # Get all unique values in the 'sub' column\n",
|
2644 |
+
" unique_subs = df['sub'].unique()\n",
|
2645 |
+
" #print(unique_subs)\n",
|
2646 |
+
"\n",
|
2647 |
+
" # Randomly shuffle the unique values\n",
|
2648 |
+
" np.random.shuffle(unique_subs)\n",
|
2649 |
+
" print(unique_subs)\n",
|
2650 |
+
"\n",
|
2651 |
+
" # Calculate the index to split at (half of the unique values)\n",
|
2652 |
+
" split_index = len(unique_subs) // 2\n",
|
2653 |
+
" #print(split_index)\n",
|
2654 |
+
"\n",
|
2655 |
+
" # Select the first half of unique values\n",
|
2656 |
+
" selected_subs_df1 = unique_subs[:split_index]\n",
|
2657 |
+
" #selected_subs_df1\n",
|
2658 |
+
"\n",
|
2659 |
+
" # Split the DataFrame into two based on the selected unique values\n",
|
2660 |
+
" df1 = df[df['sub'].isin(selected_subs_df1)]\n",
|
2661 |
+
" df2 = df[~df['sub'].isin(selected_subs_df1)]\n",
|
2662 |
+
"\n",
|
2663 |
+
" df1_hg = df1.groupby(['stim_folder', 'stim_name'])['hg'].apply(lambda x: np.mean(x.tolist(), axis=0)).reset_index()\n",
|
2664 |
+
"\n",
|
2665 |
+
" # Rename the column 'old_col_name' to 'new_col_name'\n",
|
2666 |
+
" df1_hg = df1_hg.rename(columns={'hg': 'hg_1'})\n",
|
2667 |
+
" #df1_hg\n",
|
2668 |
+
"\n",
|
2669 |
+
" df2_hg = df2.groupby(['stim_folder', 'stim_name'])['hg'].apply(lambda x: np.mean(x.tolist(), axis=0)).reset_index()\n",
|
2670 |
+
"\n",
|
2671 |
+
" # Rename the column 'old_col_name' to 'new_col_name'\n",
|
2672 |
+
" df2_hg = df2_hg.rename(columns={'hg': 'hg_2'})\n",
|
2673 |
+
" #df2_hg\n",
|
2674 |
+
"\n",
|
2675 |
+
" # Merge the DataFrames based on 'stim_folder' and 'stim_name'\n",
|
2676 |
+
" merged_df = pd.merge(df1_hg, df2_hg, on=['stim_folder', 'stim_name'], how='inner')\n",
|
2677 |
+
"\n",
|
2678 |
+
" # Display the resulting merged DataFrame\n",
|
2679 |
+
" #print(merged_df)\n",
|
2680 |
+
"\n",
|
2681 |
+
" sp_corr_splt_hlf = []\n",
|
2682 |
+
" for i in range(len(merged_df)):\n",
|
2683 |
+
" sp_corr_splt_hlf.append(spearmanr(merged_df['hg_1'][i].flatten(), merged_df['hg_2'][i].flatten())[0])\n",
|
2684 |
+
" #break\n",
|
2685 |
+
"\n",
|
2686 |
+
" # Add the Spearman correlation values to the DataFrame\n",
|
2687 |
+
" merged_df['sp_corr_splt_hlf'] = sp_corr_splt_hlf\n",
|
2688 |
+
"\n",
|
2689 |
+
" merged_df = merged_df.drop(columns=['hg_1', 'hg_2'])\n",
|
2690 |
+
"\n",
|
2691 |
+
" merged_df = merged_df.groupby('stim_folder')['sp_corr_splt_hlf'].mean().reset_index()\n",
|
2692 |
+
"\n",
|
2693 |
+
" # Define the custom order\n",
|
2694 |
+
" custom_order = ['faces', 'faces_inv', 'objects', 'objects_inv', 'pareidolia', 'pareidolia_inv', 'pareidolia_art', 'pareidolia_art_inv']\n",
|
2695 |
+
"\n",
|
2696 |
+
" # Convert the 'stim_folder' column to a Categorical data type with the custom order\n",
|
2697 |
+
" merged_df['stim_folder'] = pd.Categorical(merged_df['stim_folder'], categories=custom_order, ordered=True)\n",
|
2698 |
+
"\n",
|
2699 |
+
" # Sort the DataFrame based on the custom order\n",
|
2700 |
+
" merged_df_sorted = merged_df.sort_values(by='stim_folder')\n",
|
2701 |
+
"\n",
|
2702 |
+
" # Print the sorted DataFrame\n",
|
2703 |
+
" #print(merged_df_sorted)\n",
|
2704 |
+
"\n",
|
2705 |
+
" # Extract the 'sp_corr_splt_hlf' column and save it to a NumPy array\n",
|
2706 |
+
" sp_corr_splt_hlf_array.append(merged_df_sorted['sp_corr_splt_hlf'].to_numpy())\n",
|
2707 |
+
"\n",
|
2708 |
+
"print(sp_corr_splt_hlf_array)\n"
|
2709 |
+
]
|
2710 |
+
},
|
2711 |
+
{
|
2712 |
+
"cell_type": "code",
|
2713 |
+
"execution_count": null,
|
2714 |
+
"id": "3fa9422a",
|
2715 |
+
"metadata": {},
|
2716 |
+
"outputs": [],
|
2717 |
+
"source": [
|
2718 |
+
"np.mean(sp_corr_splt_hlf_array, axis=0)"
|
2719 |
+
]
|
2720 |
+
},
|
2721 |
+
{
|
2722 |
+
"cell_type": "code",
|
2723 |
+
"execution_count": null,
|
2724 |
+
"id": "10718a78",
|
2725 |
+
"metadata": {},
|
2726 |
+
"outputs": [],
|
2727 |
+
"source": [
|
2728 |
+
"len(sp_corr_splt_hlf_array)"
|
2729 |
+
]
|
2730 |
+
},
|
2731 |
+
{
|
2732 |
+
"cell_type": "code",
|
2733 |
+
"execution_count": null,
|
2734 |
+
"id": "1ac85240",
|
2735 |
+
"metadata": {},
|
2736 |
+
"outputs": [],
|
2737 |
+
"source": [
|
2738 |
+
"from tabulate import tabulate\n",
|
2739 |
+
"\n",
|
2740 |
+
"mapping = ['faces', 'faces_inv', 'objects', 'objects_inv', 'pareidolia', 'pareidolia_inv', 'pareidolia_art', 'pareidolia_art_inv']\n",
|
2741 |
+
"values = [0.64045339, 0.63962363, 0.65247639, 0.64685355, 0.69212828, 0.68226111, 0.63446804, 0.64820666]\n",
|
2742 |
+
"\n",
|
2743 |
+
"array_result = np.array(values)\n",
|
2744 |
+
"\n",
|
2745 |
+
"table = list(zip(mapping, array_result))\n",
|
2746 |
+
"headers = [\"Conditions\", \"S-H rho\"]\n",
|
2747 |
+
"\n",
|
2748 |
+
"print(tabulate(table, headers=headers))"
|
2749 |
+
]
|
2750 |
+
},
|
2751 |
+
{
|
2752 |
+
"cell_type": "code",
|
2753 |
+
"execution_count": null,
|
2754 |
+
"id": "3b4c3fe0",
|
2755 |
+
"metadata": {},
|
2756 |
+
"outputs": [],
|
2757 |
+
"source": [
|
2758 |
+
"# Given data\n",
|
2759 |
+
"mapping = ['faces', 'faces_inv', 'objects', 'objects_inv', 'pareidolia', 'pareidolia_inv', 'pareidolia_art', 'pareidolia_art_inv']\n",
|
2760 |
+
"values = [0.64045339, 0.63962363, 0.65247639, 0.64685355, 0.69212828, 0.68226111, 0.63446804, 0.64820666]\n",
|
2761 |
+
"\n",
|
2762 |
+
"# Create a DataFrame\n",
|
2763 |
+
"df_sh = pd.DataFrame({'stim_folder': mapping, 'sp_corr_splt_hlf': values})\n",
|
2764 |
+
"\n",
|
2765 |
+
"# Print the DataFrame\n",
|
2766 |
+
"print(df_sh)"
|
2767 |
+
]
|
2768 |
+
},
|
2769 |
+
{
|
2770 |
+
"cell_type": "code",
|
2771 |
+
"execution_count": null,
|
2772 |
+
"id": "04fd3c07",
|
2773 |
+
"metadata": {},
|
2774 |
+
"outputs": [],
|
2775 |
+
"source": []
|
2776 |
+
},
|
2777 |
+
{
|
2778 |
+
"cell_type": "code",
|
2779 |
+
"execution_count": null,
|
2780 |
+
"id": "10ac43f4",
|
2781 |
+
"metadata": {},
|
2782 |
+
"outputs": [],
|
2783 |
+
"source": []
|
2784 |
+
},
|
2785 |
+
{
|
2786 |
+
"cell_type": "code",
|
2787 |
+
"execution_count": null,
|
2788 |
+
"id": "a60ccce0",
|
2789 |
+
"metadata": {},
|
2790 |
+
"outputs": [],
|
2791 |
+
"source": []
|
2792 |
+
},
|
2793 |
+
{
|
2794 |
+
"cell_type": "code",
|
2795 |
+
"execution_count": null,
|
2796 |
+
"id": "873461b1",
|
2797 |
+
"metadata": {},
|
2798 |
+
"outputs": [],
|
2799 |
+
"source": []
|
2800 |
+
},
|
2801 |
+
{
|
2802 |
+
"cell_type": "code",
|
2803 |
+
"execution_count": null,
|
2804 |
+
"id": "dbda9f4b",
|
2805 |
+
"metadata": {},
|
2806 |
+
"outputs": [],
|
2807 |
+
"source": []
|
2808 |
+
},
|
2809 |
+
{
|
2810 |
+
"cell_type": "code",
|
2811 |
+
"execution_count": null,
|
2812 |
+
"id": "7ae9f2d9",
|
2813 |
+
"metadata": {},
|
2814 |
+
"outputs": [],
|
2815 |
+
"source": [
|
2816 |
+
"\n",
|
2817 |
+
"correlation_coef_objects_iter_img = []\n",
|
2818 |
+
"\n",
|
2819 |
+
"for keys in y_objects:\n",
|
2820 |
+
" mmm = []\n",
|
2821 |
+
" print(keys)\n",
|
2822 |
+
" for i in range(len(y_objects_subs)):\n",
|
2823 |
+
" if y_objects_subs[i][0][0] == keys:\n",
|
2824 |
+
" mmm.append(y_objects_subs[i][1])\n",
|
2825 |
+
" #print(y_faces_subs[i][1])\n",
|
2826 |
+
"\n",
|
2827 |
+
" # Number of times to perform the bootstrap sampling\n",
|
2828 |
+
" num_iterations = 50\n",
|
2829 |
+
" correlation_coef_objects_iter = []\n",
|
2830 |
+
"\n",
|
2831 |
+
" for _ in range(num_iterations):\n",
|
2832 |
+
"\n",
|
2833 |
+
" # Define your dataset\n",
|
2834 |
+
" dataset = list(range(len(mmm)))\n",
|
2835 |
+
"\n",
|
2836 |
+
" # Perform bootstrap sampling without replacement until no dataset is left\n",
|
2837 |
+
" bootstrap_samples = []\n",
|
2838 |
+
" correlation_coef_objects = []\n",
|
2839 |
+
"\n",
|
2840 |
+
" while dataset:\n",
|
2841 |
+
" bootstrap_sample = random.sample(dataset, len(dataset))\n",
|
2842 |
+
" bootstrap_samples.append(bootstrap_sample)\n",
|
2843 |
+
" dataset = [x for x in dataset if x not in bootstrap_sample]\n",
|
2844 |
+
"\n",
|
2845 |
+
" # Print the bootstrap samples\n",
|
2846 |
+
" #for i, sample in enumerate(bootstrap_samples):\n",
|
2847 |
+
" # print(f\"Bootstrap Sample {k + 1}: {sample}\")\n",
|
2848 |
+
" \n",
|
2849 |
+
" temp1 = []\n",
|
2850 |
+
" temp2 = []\n",
|
2851 |
+
"\n",
|
2852 |
+
" for i in bootstrap_samples[0][:int(len(bootstrap_samples[0])/2)]:\n",
|
2853 |
+
" temp1.append(mmm[i])\n",
|
2854 |
+
"\n",
|
2855 |
+
" for i in bootstrap_samples[0][int(len(bootstrap_samples[0])/2):]:\n",
|
2856 |
+
" temp2.append(mmm[i])\n",
|
2857 |
+
"\n",
|
2858 |
+
" #print(temp1)\n",
|
2859 |
+
" temp1 = np.mean(temp1, axis=0)\n",
|
2860 |
+
" temp2 = np.mean(temp2, axis=0)\n",
|
2861 |
+
" \n",
|
2862 |
+
" #plt.matshow(mmm[sample[i]])\n",
|
2863 |
+
" #plt.matshow(mmm[sample[i+1]])\n",
|
2864 |
+
" correlation_coef_objects.append(spearmanr(temp1.flatten(),\n",
|
2865 |
+
" temp2.flatten())[0])\n",
|
2866 |
+
"\n",
|
2867 |
+
" correlation_coef_objects_iter.append(np.mean(correlation_coef_objects))\n",
|
2868 |
+
" \n",
|
2869 |
+
" #break\n",
|
2870 |
+
" \n",
|
2871 |
+
"\n",
|
2872 |
+
" correlation_coef_objects_iter_img.append(np.mean(correlation_coef_objects_iter))\n",
|
2873 |
+
" \n",
|
2874 |
+
" #break\n",
|
2875 |
+
" "
|
2876 |
+
]
|
2877 |
+
},
|
2878 |
+
{
|
2879 |
+
"cell_type": "code",
|
2880 |
+
"execution_count": null,
|
2881 |
+
"id": "f59ec104",
|
2882 |
+
"metadata": {},
|
2883 |
+
"outputs": [],
|
2884 |
+
"source": []
|
2885 |
+
},
|
2886 |
+
{
|
2887 |
+
"cell_type": "code",
|
2888 |
+
"execution_count": null,
|
2889 |
+
"id": "27c5282e",
|
2890 |
+
"metadata": {},
|
2891 |
+
"outputs": [],
|
2892 |
+
"source": []
|
2893 |
+
},
|
2894 |
+
{
|
2895 |
+
"cell_type": "code",
|
2896 |
+
"execution_count": null,
|
2897 |
+
"id": "55fccdef",
|
2898 |
+
"metadata": {},
|
2899 |
+
"outputs": [],
|
2900 |
+
"source": []
|
2901 |
+
},
|
2902 |
+
{
|
2903 |
+
"cell_type": "code",
|
2904 |
+
"execution_count": null,
|
2905 |
+
"id": "856344fb",
|
2906 |
+
"metadata": {},
|
2907 |
+
"outputs": [],
|
2908 |
+
"source": []
|
2909 |
+
},
|
2910 |
+
{
|
2911 |
+
"cell_type": "code",
|
2912 |
+
"execution_count": null,
|
2913 |
+
"id": "68144351",
|
2914 |
+
"metadata": {},
|
2915 |
+
"outputs": [],
|
2916 |
+
"source": []
|
2917 |
+
},
|
2918 |
+
{
|
2919 |
+
"cell_type": "code",
|
2920 |
+
"execution_count": null,
|
2921 |
+
"id": "031db151",
|
2922 |
+
"metadata": {},
|
2923 |
+
"outputs": [],
|
2924 |
+
"source": []
|
2925 |
+
},
|
2926 |
+
{
|
2927 |
+
"cell_type": "code",
|
2928 |
+
"execution_count": null,
|
2929 |
+
"id": "6a111361",
|
2930 |
+
"metadata": {},
|
2931 |
+
"outputs": [],
|
2932 |
+
"source": []
|
2933 |
+
},
|
2934 |
+
{
|
2935 |
+
"cell_type": "code",
|
2936 |
+
"execution_count": null,
|
2937 |
+
"id": "3fcfb699",
|
2938 |
+
"metadata": {},
|
2939 |
+
"outputs": [],
|
2940 |
+
"source": []
|
2941 |
+
},
|
2942 |
+
{
|
2943 |
+
"cell_type": "code",
|
2944 |
+
"execution_count": null,
|
2945 |
+
"id": "9a181318",
|
2946 |
+
"metadata": {},
|
2947 |
+
"outputs": [],
|
2948 |
+
"source": []
|
2949 |
+
},
|
2950 |
+
{
|
2951 |
+
"cell_type": "code",
|
2952 |
+
"execution_count": null,
|
2953 |
+
"id": "abbe38bb",
|
2954 |
+
"metadata": {},
|
2955 |
+
"outputs": [],
|
2956 |
+
"source": []
|
2957 |
+
},
|
2958 |
+
{
|
2959 |
+
"cell_type": "code",
|
2960 |
+
"execution_count": null,
|
2961 |
+
"id": "eba2327a",
|
2962 |
+
"metadata": {},
|
2963 |
+
"outputs": [],
|
2964 |
+
"source": []
|
2965 |
+
},
|
2966 |
+
{
|
2967 |
+
"cell_type": "code",
|
2968 |
+
"execution_count": null,
|
2969 |
+
"id": "084d5689",
|
2970 |
+
"metadata": {},
|
2971 |
+
"outputs": [],
|
2972 |
+
"source": []
|
2973 |
+
},
|
2974 |
+
{
|
2975 |
+
"cell_type": "code",
|
2976 |
+
"execution_count": null,
|
2977 |
+
"id": "36cc322a",
|
2978 |
+
"metadata": {},
|
2979 |
+
"outputs": [],
|
2980 |
+
"source": []
|
2981 |
+
},
|
2982 |
+
{
|
2983 |
+
"cell_type": "code",
|
2984 |
+
"execution_count": null,
|
2985 |
+
"id": "5841029d",
|
2986 |
+
"metadata": {},
|
2987 |
+
"outputs": [],
|
2988 |
+
"source": []
|
2989 |
+
},
|
2990 |
+
{
|
2991 |
+
"cell_type": "code",
|
2992 |
+
"execution_count": null,
|
2993 |
+
"id": "973779fb",
|
2994 |
+
"metadata": {},
|
2995 |
+
"outputs": [],
|
2996 |
+
"source": []
|
2997 |
+
},
|
2998 |
+
{
|
2999 |
+
"cell_type": "code",
|
3000 |
+
"execution_count": null,
|
3001 |
+
"id": "1594f5f5",
|
3002 |
+
"metadata": {},
|
3003 |
+
"outputs": [],
|
3004 |
+
"source": []
|
3005 |
+
},
|
3006 |
+
{
|
3007 |
+
"cell_type": "code",
|
3008 |
+
"execution_count": null,
|
3009 |
+
"id": "2d1b2423",
|
3010 |
+
"metadata": {},
|
3011 |
+
"outputs": [],
|
3012 |
+
"source": []
|
3013 |
+
},
|
3014 |
+
{
|
3015 |
+
"cell_type": "code",
|
3016 |
+
"execution_count": null,
|
3017 |
+
"id": "893d2965",
|
3018 |
+
"metadata": {},
|
3019 |
+
"outputs": [],
|
3020 |
+
"source": []
|
3021 |
+
},
|
3022 |
+
{
|
3023 |
+
"cell_type": "code",
|
3024 |
+
"execution_count": null,
|
3025 |
+
"id": "b54a54cd",
|
3026 |
+
"metadata": {},
|
3027 |
+
"outputs": [],
|
3028 |
+
"source": []
|
3029 |
+
},
|
3030 |
+
{
|
3031 |
+
"cell_type": "code",
|
3032 |
+
"execution_count": null,
|
3033 |
+
"id": "92934490",
|
3034 |
+
"metadata": {},
|
3035 |
+
"outputs": [],
|
3036 |
+
"source": []
|
3037 |
+
},
|
3038 |
+
{
|
3039 |
+
"cell_type": "code",
|
3040 |
+
"execution_count": null,
|
3041 |
+
"id": "520e6c25",
|
3042 |
+
"metadata": {},
|
3043 |
+
"outputs": [],
|
3044 |
+
"source": []
|
3045 |
+
},
|
3046 |
+
{
|
3047 |
+
"cell_type": "code",
|
3048 |
+
"execution_count": null,
|
3049 |
+
"id": "6d8f569b",
|
3050 |
+
"metadata": {},
|
3051 |
+
"outputs": [],
|
3052 |
+
"source": []
|
3053 |
+
},
|
3054 |
+
{
|
3055 |
+
"cell_type": "code",
|
3056 |
+
"execution_count": null,
|
3057 |
+
"id": "08b42deb",
|
3058 |
+
"metadata": {},
|
3059 |
+
"outputs": [],
|
3060 |
+
"source": []
|
3061 |
+
},
|
3062 |
+
{
|
3063 |
+
"cell_type": "code",
|
3064 |
+
"execution_count": null,
|
3065 |
+
"id": "c30b8314",
|
3066 |
+
"metadata": {},
|
3067 |
+
"outputs": [],
|
3068 |
+
"source": []
|
3069 |
+
}
|
3070 |
+
],
|
3071 |
+
"metadata": {
|
3072 |
+
"kernelspec": {
|
3073 |
+
"display_name": "Python 3",
|
3074 |
+
"language": "python",
|
3075 |
+
"name": "python3"
|
3076 |
+
},
|
3077 |
+
"language_info": {
|
3078 |
+
"codemirror_mode": {
|
3079 |
+
"name": "ipython",
|
3080 |
+
"version": 3
|
3081 |
+
},
|
3082 |
+
"file_extension": ".py",
|
3083 |
+
"mimetype": "text/x-python",
|
3084 |
+
"name": "python",
|
3085 |
+
"nbconvert_exporter": "python",
|
3086 |
+
"pygments_lexer": "ipython3",
|
3087 |
+
"version": "3.8.5"
|
3088 |
+
}
|
3089 |
+
},
|
3090 |
+
"nbformat": 4,
|
3091 |
+
"nbformat_minor": 5
|
3092 |
+
}
|
DeepGaze/.ipynb_checkpoints/helena_data_masks-checkpoint.ipynb
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [],
|
3 |
+
"metadata": {},
|
4 |
+
"nbformat": 4,
|
5 |
+
"nbformat_minor": 5
|
6 |
+
}
|
DeepGaze/.ipynb_checkpoints/mask corrs-checkpoint.ipynb
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [],
|
3 |
+
"metadata": {},
|
4 |
+
"nbformat": 4,
|
5 |
+
"nbformat_minor": 5
|
6 |
+
}
|
DeepGaze/1448_face_mask.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/1448_face_mask.json
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": "5.4.1",
|
3 |
+
"flags": {},
|
4 |
+
"shapes": [
|
5 |
+
{
|
6 |
+
"label": "1448_face_mask",
|
7 |
+
"points": [
|
8 |
+
[
|
9 |
+
484.7682119205298,
|
10 |
+
178.1456953642384
|
11 |
+
],
|
12 |
+
[
|
13 |
+
495.36423841059604,
|
14 |
+
174.83443708609272
|
15 |
+
],
|
16 |
+
[
|
17 |
+
513.2450331125829,
|
18 |
+
167.5496688741722
|
19 |
+
],
|
20 |
+
[
|
21 |
+
518.5430463576159,
|
22 |
+
160.26490066225165
|
23 |
+
],
|
24 |
+
[
|
25 |
+
526.4900662251656,
|
26 |
+
150.33112582781456
|
27 |
+
],
|
28 |
+
[
|
29 |
+
537.748344370861,
|
30 |
+
149.0066225165563
|
31 |
+
],
|
32 |
+
[
|
33 |
+
544.3708609271523,
|
34 |
+
149.66887417218544
|
35 |
+
],
|
36 |
+
[
|
37 |
+
545.6953642384107,
|
38 |
+
162.91390728476821
|
39 |
+
],
|
40 |
+
[
|
41 |
+
556.2913907284768,
|
42 |
+
167.5496688741722
|
43 |
+
],
|
44 |
+
[
|
45 |
+
560.2649006622516,
|
46 |
+
174.17218543046357
|
47 |
+
],
|
48 |
+
[
|
49 |
+
563.5761589403974,
|
50 |
+
188.74172185430464
|
51 |
+
],
|
52 |
+
[
|
53 |
+
564.2384105960265,
|
54 |
+
202.64900662251657
|
55 |
+
],
|
56 |
+
[
|
57 |
+
560.9271523178808,
|
58 |
+
218.54304635761588
|
59 |
+
],
|
60 |
+
[
|
61 |
+
558.9403973509934,
|
62 |
+
230.46357615894038
|
63 |
+
],
|
64 |
+
[
|
65 |
+
550.9933774834437,
|
66 |
+
238.41059602649005
|
67 |
+
],
|
68 |
+
[
|
69 |
+
540.3973509933775,
|
70 |
+
250.9933774834437
|
71 |
+
],
|
72 |
+
[
|
73 |
+
538.4105960264901,
|
74 |
+
268.87417218543044
|
75 |
+
],
|
76 |
+
[
|
77 |
+
533.1125827814569,
|
78 |
+
275.49668874172187
|
79 |
+
],
|
80 |
+
[
|
81 |
+
523.1788079470199,
|
82 |
+
276.8211920529801
|
83 |
+
],
|
84 |
+
[
|
85 |
+
511.2582781456954,
|
86 |
+
280.79470198675494
|
87 |
+
],
|
88 |
+
[
|
89 |
+
499.3377483443709,
|
90 |
+
284.10596026490066
|
91 |
+
],
|
92 |
+
[
|
93 |
+
486.09271523178813,
|
94 |
+
282.11920529801324
|
95 |
+
],
|
96 |
+
[
|
97 |
+
476.158940397351,
|
98 |
+
270.86092715231786
|
99 |
+
],
|
100 |
+
[
|
101 |
+
463.57615894039736,
|
102 |
+
252.98013245033113
|
103 |
+
],
|
104 |
+
[
|
105 |
+
454.9668874172186,
|
106 |
+
242.3841059602649
|
107 |
+
],
|
108 |
+
[
|
109 |
+
446.3576158940398,
|
110 |
+
227.1523178807947
|
111 |
+
],
|
112 |
+
[
|
113 |
+
438.4105960264901,
|
114 |
+
213.90728476821192
|
115 |
+
],
|
116 |
+
[
|
117 |
+
433.1125827814569,
|
118 |
+
196.6887417218543
|
119 |
+
],
|
120 |
+
[
|
121 |
+
429.8013245033113,
|
122 |
+
180.79470198675497
|
123 |
+
],
|
124 |
+
[
|
125 |
+
430.46357615894044,
|
126 |
+
166.2251655629139
|
127 |
+
],
|
128 |
+
[
|
129 |
+
431.7880794701987,
|
130 |
+
164.90066225165563
|
131 |
+
],
|
132 |
+
[
|
133 |
+
454.9668874172186,
|
134 |
+
170.19867549668874
|
135 |
+
],
|
136 |
+
[
|
137 |
+
468.87417218543044,
|
138 |
+
175.49668874172184
|
139 |
+
]
|
140 |
+
],
|
141 |
+
"group_id": null,
|
142 |
+
"description": "",
|
143 |
+
"shape_type": "polygon",
|
144 |
+
"flags": {},
|
145 |
+
"mask": null
|
146 |
+
}
|
147 |
+
],
|
148 |
+
"imagePath": "Bachelorarbeit Pareidolie\\stimuli\\faces\\1448.jpg",
|
149 |
+
"imageData": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAJYAyADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3A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U0NCEd6MZoopjAijFFFAABSEe1FFAxOaWiigAo+tFFACYooooABQaKKYCYpelFFAxMUmOaKKAAjikoopjP/9k=",
|
150 |
+
"imageHeight": 600,
|
151 |
+
"imageWidth": 800
|
152 |
+
}
|
DeepGaze/1448_face_mask.png
ADDED
![]() |
DeepGaze/4_pareidolia_dg2.png
ADDED
![]() |
DeepGaze/4_pareidolia_hg.png
ADDED
![]() |
DeepGaze/4_pareidolia_s02_dg3.png
ADDED
![]() |
DeepGaze/4_pareidolia_s02_hg.png
ADDED
![]() |
DeepGaze/8_pareidolia_inv_dg2.png
ADDED
![]() |
DeepGaze/8_pareidolia_inv_hg.png
ADDED
![]() |
DeepGaze/8_pareidolia_inv_s04_dg3.png
ADDED
![]() |
DeepGaze/8_pareidolia_inv_s04_hg.png
ADDED
![]() |
DeepGaze/DG1_RSA.png
ADDED
![]() |
DeepGaze/DG1_arch.txt
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
DeepGazeI(
|
2 |
+
(features): FeatureExtractor(
|
3 |
+
(features): RGBalexnet(
|
4 |
+
(0): Normalizer()
|
5 |
+
(1): AlexNet(
|
6 |
+
(features): Sequential(
|
7 |
+
(0): Conv2d(3, 64, kernel_size=(11, 11), stride=(4, 4), padding=(2, 2))
|
8 |
+
(1): ReLU(inplace=True)
|
9 |
+
(2): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)
|
10 |
+
(3): Conv2d(64, 192, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))
|
11 |
+
(4): ReLU(inplace=True)
|
12 |
+
(5): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)
|
13 |
+
(6): Conv2d(192, 384, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
|
14 |
+
(7): ReLU(inplace=True)
|
15 |
+
(8): Conv2d(384, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
|
16 |
+
(9): ReLU(inplace=True)
|
17 |
+
(10): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
|
18 |
+
(11): ReLU(inplace=True)
|
19 |
+
(12): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)
|
20 |
+
)
|
21 |
+
(avgpool): AdaptiveAvgPool2d(output_size=(6, 6))
|
22 |
+
(classifier): Sequential(
|
23 |
+
(0): Dropout(p=0.5, inplace=False)
|
24 |
+
(1): Linear(in_features=9216, out_features=4096, bias=True)
|
25 |
+
(2): ReLU(inplace=True)
|
26 |
+
(3): Dropout(p=0.5, inplace=False)
|
27 |
+
(4): Linear(in_features=4096, out_features=4096, bias=True)
|
28 |
+
(5): ReLU(inplace=True)
|
29 |
+
(6): Linear(in_features=4096, out_features=1000, bias=True)
|
30 |
+
)
|
31 |
+
)
|
32 |
+
)
|
33 |
+
)
|
34 |
+
(readout_network): Sequential(
|
35 |
+
(conv0): Conv2d(256, 1, kernel_size=(1, 1), stride=(1, 1), bias=False)
|
36 |
+
)
|
37 |
+
(finalizer): Finalizer(
|
38 |
+
(gauss): GaussianFilterNd()
|
39 |
+
)
|
40 |
+
)
|
DeepGaze/DG2E_RSA_400.png
ADDED
![]() |
Git LFS Details
|
DeepGaze/DG2E_arch.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
DeepGaze/DG2_heatmaps/0.jpg
ADDED
![]() |
DeepGaze/DG2_heatmaps/1.jpg
ADDED
![]() |
DeepGaze/DG2_heatmaps/10.jpg
ADDED
![]() |
DeepGaze/DG2_heatmaps/100.jpg
ADDED
![]() |
DeepGaze/DG2_heatmaps/101.jpg
ADDED
![]() |
DeepGaze/DG2_heatmaps/102.jpg
ADDED
![]() |
DeepGaze/DG2_heatmaps/103.jpg
ADDED
![]() |
DeepGaze/DG2_heatmaps/104.jpg
ADDED
![]() |
DeepGaze/DG2_heatmaps/105.jpg
ADDED
![]() |