|
2 | 2 | "cells": [
|
3 | 3 | {
|
4 | 4 | "cell_type": "code",
|
5 |
| - "execution_count": 2, |
| 5 | + "execution_count": 1, |
6 | 6 | "metadata": {},
|
7 | 7 | "outputs": [
|
8 | 8 | {
|
|
22 | 22 | },
|
23 | 23 | {
|
24 | 24 | "cell_type": "code",
|
25 |
| - "execution_count": 8, |
| 25 | + "execution_count": 2, |
26 | 26 | "metadata": {
|
27 | 27 | "scrolled": true
|
28 | 28 | },
|
|
45 | 45 | },
|
46 | 46 | {
|
47 | 47 | "cell_type": "code",
|
48 |
| - "execution_count": 9, |
| 48 | + "execution_count": 4, |
49 | 49 | "metadata": {},
|
50 | 50 | "outputs": [
|
51 | 51 | {
|
|
146 | 146 | "5 14 464 1775 2268 0.38394 yellowBag"
|
147 | 147 | ]
|
148 | 148 | },
|
149 |
| - "execution_count": 9, |
| 149 | + "execution_count": 4, |
150 | 150 | "metadata": {},
|
151 | 151 | "output_type": "execute_result"
|
152 | 152 | }
|
|
157 | 157 | },
|
158 | 158 | {
|
159 | 159 | "cell_type": "code",
|
160 |
| - "execution_count": 10, |
| 160 | + "execution_count": 16, |
161 | 161 | "metadata": {},
|
162 | 162 | "outputs": [],
|
163 | 163 | "source": [
|
164 |
| - "Labels = pd.DataFrame({'person_as_time':[],'img':[],'term':[],'category':[],'score':[]})\n", |
165 |
| - "start_time = pd.to_datetime('1/1/2019')\n", |
166 |
| - "for file_name in glob.iglob('./**/*.csv', recursive=True):\n", |
| 164 | + "Labels = pd.DataFrame({'Person':[],'Image':[],'Label':[],'Score':[]})\n", |
| 165 | + "for file_name in glob.iglob('./MC2-Image-Data/**/*.csv', recursive=True):\n", |
167 | 166 | " personIndex = file_name.split('\\\\')[-2].replace('Person','')\n",
|
168 |
| - " time = start_time + pd.to_timedelta(personIndex+' days')\n", |
169 | 167 | " df = pd.read_csv(file_name,encoding = \"ISO-8859-1\")\n",
|
170 | 168 | " img = file_name.split('\\\\')[-1].split('.csv')[0]\n",
|
171 |
| - " term = []\n", |
172 |
| - " category = []\n", |
173 |
| - " score = []\n", |
174 | 169 | " for index in range(0,df.shape[0]):\n",
|
175 | 170 | " row = df.loc[index]\n",
|
176 | 171 | " label = row['Label']\n",
|
177 |
| - " term.append(label)\n", |
178 |
| - " category.append('label')\n", |
179 |
| - " score.append(label+':'+str(row['Score']))\n", |
180 |
| - " Labels = Labels.append({'person_as_time':time,'img':img,'term':'|'.join(term),'category':'|'.join(category),'score':';'.join(score)},ignore_index=True)" |
| 172 | + " Labels = Labels.append({'Person':personIndex,'Image':img,'Label':label,'Score':row['Score']},ignore_index=True)" |
181 | 173 | ]
|
182 | 174 | },
|
183 | 175 | {
|
184 | 176 | "cell_type": "code",
|
185 |
| - "execution_count": 11, |
| 177 | + "execution_count": 17, |
186 | 178 | "metadata": {},
|
187 | 179 | "outputs": [
|
188 | 180 | {
|
|
206 | 198 | " <thead>\n",
|
207 | 199 | " <tr style=\"text-align: right;\">\n",
|
208 | 200 | " <th></th>\n",
|
209 |
| - " <th>person_as_time</th>\n", |
210 |
| - " <th>img</th>\n", |
211 |
| - " <th>term</th>\n", |
212 |
| - " <th>category</th>\n", |
213 |
| - " <th>score</th>\n", |
| 201 | + " <th>Person</th>\n", |
| 202 | + " <th>Image</th>\n", |
| 203 | + " <th>Label</th>\n", |
| 204 | + " <th>Score</th>\n", |
214 | 205 | " </tr>\n",
|
215 | 206 | " </thead>\n",
|
216 | 207 | " <tbody>\n",
|
217 | 208 | " <tr>\n",
|
218 | 209 | " <th>0</th>\n",
|
219 |
| - " <td>2019-01-02</td>\n", |
| 210 | + " <td>1</td>\n", |
220 | 211 | " <td>Person1_1</td>\n",
|
221 |
| - " <td>birdCall|eyeball|pinkCandle|pumpkinNotes|blueS...</td>\n", |
222 |
| - " <td>label|label|label|label|label|label</td>\n", |
223 |
| - " <td>birdCall:0.33860999999999997;eyeball:0.2813900...</td>\n", |
| 212 | + " <td>birdCall</td>\n", |
| 213 | + " <td>0.33861</td>\n", |
224 | 214 | " </tr>\n",
|
225 | 215 | " <tr>\n",
|
226 | 216 | " <th>1</th>\n",
|
227 |
| - " <td>2019-01-02</td>\n", |
228 |
| - " <td>Person1_10</td>\n", |
229 |
| - " <td>birdCall|eyeball|pinkCandle|sign|blueSunglasse...</td>\n", |
230 |
| - " <td>label|label|label|label|label|label|label</td>\n", |
231 |
| - " <td>birdCall:0.31486;eyeball:0.34418000000000004;p...</td>\n", |
| 217 | + " <td>1</td>\n", |
| 218 | + " <td>Person1_1</td>\n", |
| 219 | + " <td>eyeball</td>\n", |
| 220 | + " <td>0.28139</td>\n", |
232 | 221 | " </tr>\n",
|
233 | 222 | " <tr>\n",
|
234 | 223 | " <th>2</th>\n",
|
235 |
| - " <td>2019-01-02</td>\n", |
236 |
| - " <td>Person1_11</td>\n", |
237 |
| - " <td>birdCall|cupcakePaper|sign</td>\n", |
238 |
| - " <td>label|label|label</td>\n", |
239 |
| - " <td>birdCall:0.31745999999999996;cupcakePaper:0.32...</td>\n", |
| 224 | + " <td>1</td>\n", |
| 225 | + " <td>Person1_1</td>\n", |
| 226 | + " <td>pinkCandle</td>\n", |
| 227 | + " <td>0.34569</td>\n", |
240 | 228 | " </tr>\n",
|
241 | 229 | " <tr>\n",
|
242 | 230 | " <th>3</th>\n",
|
243 |
| - " <td>2019-01-02</td>\n", |
244 |
| - " <td>Person1_2</td>\n", |
245 |
| - " <td>cloudSign|eyeball|pinkCandle|redWhistle|sign|y...</td>\n", |
246 |
| - " <td>label|label|label|label|label|label</td>\n", |
247 |
| - " <td>cloudSign:0.26761999999999997;eyeball:0.288890...</td>\n", |
| 231 | + " <td>1</td>\n", |
| 232 | + " <td>Person1_1</td>\n", |
| 233 | + " <td>pumpkinNotes</td>\n", |
| 234 | + " <td>0.42683</td>\n", |
248 | 235 | " </tr>\n",
|
249 | 236 | " <tr>\n",
|
250 | 237 | " <th>4</th>\n",
|
251 |
| - " <td>2019-01-02</td>\n", |
252 |
| - " <td>Person1_3</td>\n", |
253 |
| - " <td>birdCall|cloudSign|eyeball|partyFavor|pinkCand...</td>\n", |
254 |
| - " <td>label|label|label|label|label|label|label|label</td>\n", |
255 |
| - " <td>birdCall:0.32366999999999996;cloudSign:0.28574...</td>\n", |
| 238 | + " <td>1</td>\n", |
| 239 | + " <td>Person1_1</td>\n", |
| 240 | + " <td>blueSunglasses</td>\n", |
| 241 | + " <td>0.32564</td>\n", |
256 | 242 | " </tr>\n",
|
257 | 243 | " <tr>\n",
|
258 | 244 | " <th>...</th>\n",
|
259 | 245 | " <td>...</td>\n",
|
260 | 246 | " <td>...</td>\n",
|
261 | 247 | " <td>...</td>\n",
|
262 | 248 | " <td>...</td>\n",
|
263 |
| - " <td>...</td>\n", |
264 | 249 | " </tr>\n",
|
265 | 250 | " <tr>\n",
|
266 |
| - " <th>902</th>\n", |
267 |
| - " <td>2019-01-10</td>\n", |
268 |
| - " <td>Person9_5</td>\n", |
269 |
| - " <td>birdCall|pinkCandle|sign|yellowBag</td>\n", |
270 |
| - " <td>label|label|label|label</td>\n", |
271 |
| - " <td>birdCall:0.32993;pinkCandle:0.6486;sign:0.6548...</td>\n", |
| 251 | + " <th>4486</th>\n", |
| 252 | + " <td>9</td>\n", |
| 253 | + " <td>Person9_8</td>\n", |
| 254 | + " <td>hairClip</td>\n", |
| 255 | + " <td>0.43419</td>\n", |
272 | 256 | " </tr>\n",
|
273 | 257 | " <tr>\n",
|
274 |
| - " <th>903</th>\n", |
275 |
| - " <td>2019-01-10</td>\n", |
276 |
| - " <td>Person9_6</td>\n", |
277 |
| - " <td>eyeball|blueSunglasses</td>\n", |
278 |
| - " <td>label|label</td>\n", |
279 |
| - " <td>eyeball:0.40166999999999997;blueSunglasses:0.3...</td>\n", |
| 258 | + " <th>4487</th>\n", |
| 259 | + " <td>9</td>\n", |
| 260 | + " <td>Person9_8</td>\n", |
| 261 | + " <td>yellowBag</td>\n", |
| 262 | + " <td>0.38954</td>\n", |
280 | 263 | " </tr>\n",
|
281 | 264 | " <tr>\n",
|
282 |
| - " <th>904</th>\n", |
283 |
| - " <td>2019-01-10</td>\n", |
284 |
| - " <td>Person9_7</td>\n", |
285 |
| - " <td>eyeball|pumpkinNotes|blueSunglasses|yellowBag</td>\n", |
286 |
| - " <td>label|label|label|label</td>\n", |
287 |
| - " <td>eyeball:0.32503000000000004;pumpkinNotes:0.286...</td>\n", |
| 265 | + " <th>4488</th>\n", |
| 266 | + " <td>9</td>\n", |
| 267 | + " <td>Person9_9</td>\n", |
| 268 | + " <td>birdCall</td>\n", |
| 269 | + " <td>0.44903</td>\n", |
288 | 270 | " </tr>\n",
|
289 | 271 | " <tr>\n",
|
290 |
| - " <th>905</th>\n", |
291 |
| - " <td>2019-01-10</td>\n", |
292 |
| - " <td>Person9_8</td>\n", |
293 |
| - " <td>eyeball|pumpkinNotes|redWhistle|trophy|blueSun...</td>\n", |
294 |
| - " <td>label|label|label|label|label|label|label</td>\n", |
295 |
| - " <td>eyeball:0.4456;pumpkinNotes:0.29717;redWhistle...</td>\n", |
| 272 | + " <th>4489</th>\n", |
| 273 | + " <td>9</td>\n", |
| 274 | + " <td>Person9_9</td>\n", |
| 275 | + " <td>eyeball</td>\n", |
| 276 | + " <td>0.25527</td>\n", |
296 | 277 | " </tr>\n",
|
297 | 278 | " <tr>\n",
|
298 |
| - " <th>906</th>\n", |
299 |
| - " <td>2019-01-10</td>\n", |
| 279 | + " <th>4490</th>\n", |
| 280 | + " <td>9</td>\n", |
300 | 281 | " <td>Person9_9</td>\n",
|
301 |
| - " <td>birdCall|eyeball|blueSunglasses</td>\n", |
302 |
| - " <td>label|label|label</td>\n", |
303 |
| - " <td>birdCall:0.44903000000000004;eyeball:0.25527;b...</td>\n", |
| 282 | + " <td>blueSunglasses</td>\n", |
| 283 | + " <td>0.36897</td>\n", |
304 | 284 | " </tr>\n",
|
305 | 285 | " </tbody>\n",
|
306 | 286 | "</table>\n",
|
307 |
| - "<p>907 rows × 5 columns</p>\n", |
| 287 | + "<p>4491 rows × 4 columns</p>\n", |
308 | 288 | "</div>"
|
309 | 289 | ],
|
310 | 290 | "text/plain": [
|
311 |
| - " person_as_time img \\\n", |
312 |
| - "0 2019-01-02 Person1_1 \n", |
313 |
| - "1 2019-01-02 Person1_10 \n", |
314 |
| - "2 2019-01-02 Person1_11 \n", |
315 |
| - "3 2019-01-02 Person1_2 \n", |
316 |
| - "4 2019-01-02 Person1_3 \n", |
317 |
| - ".. ... ... \n", |
318 |
| - "902 2019-01-10 Person9_5 \n", |
319 |
| - "903 2019-01-10 Person9_6 \n", |
320 |
| - "904 2019-01-10 Person9_7 \n", |
321 |
| - "905 2019-01-10 Person9_8 \n", |
322 |
| - "906 2019-01-10 Person9_9 \n", |
323 |
| - "\n", |
324 |
| - " term \\\n", |
325 |
| - "0 birdCall|eyeball|pinkCandle|pumpkinNotes|blueS... \n", |
326 |
| - "1 birdCall|eyeball|pinkCandle|sign|blueSunglasse... \n", |
327 |
| - "2 birdCall|cupcakePaper|sign \n", |
328 |
| - "3 cloudSign|eyeball|pinkCandle|redWhistle|sign|y... \n", |
329 |
| - "4 birdCall|cloudSign|eyeball|partyFavor|pinkCand... \n", |
330 |
| - ".. ... \n", |
331 |
| - "902 birdCall|pinkCandle|sign|yellowBag \n", |
332 |
| - "903 eyeball|blueSunglasses \n", |
333 |
| - "904 eyeball|pumpkinNotes|blueSunglasses|yellowBag \n", |
334 |
| - "905 eyeball|pumpkinNotes|redWhistle|trophy|blueSun... \n", |
335 |
| - "906 birdCall|eyeball|blueSunglasses \n", |
336 |
| - "\n", |
337 |
| - " category \\\n", |
338 |
| - "0 label|label|label|label|label|label \n", |
339 |
| - "1 label|label|label|label|label|label|label \n", |
340 |
| - "2 label|label|label \n", |
341 |
| - "3 label|label|label|label|label|label \n", |
342 |
| - "4 label|label|label|label|label|label|label|label \n", |
343 |
| - ".. ... \n", |
344 |
| - "902 label|label|label|label \n", |
345 |
| - "903 label|label \n", |
346 |
| - "904 label|label|label|label \n", |
347 |
| - "905 label|label|label|label|label|label|label \n", |
348 |
| - "906 label|label|label \n", |
| 291 | + " Person Image Label Score\n", |
| 292 | + "0 1 Person1_1 birdCall 0.33861\n", |
| 293 | + "1 1 Person1_1 eyeball 0.28139\n", |
| 294 | + "2 1 Person1_1 pinkCandle 0.34569\n", |
| 295 | + "3 1 Person1_1 pumpkinNotes 0.42683\n", |
| 296 | + "4 1 Person1_1 blueSunglasses 0.32564\n", |
| 297 | + "... ... ... ... ...\n", |
| 298 | + "4486 9 Person9_8 hairClip 0.43419\n", |
| 299 | + "4487 9 Person9_8 yellowBag 0.38954\n", |
| 300 | + "4488 9 Person9_9 birdCall 0.44903\n", |
| 301 | + "4489 9 Person9_9 eyeball 0.25527\n", |
| 302 | + "4490 9 Person9_9 blueSunglasses 0.36897\n", |
349 | 303 | "\n",
|
350 |
| - " score \n", |
351 |
| - "0 birdCall:0.33860999999999997;eyeball:0.2813900... \n", |
352 |
| - "1 birdCall:0.31486;eyeball:0.34418000000000004;p... \n", |
353 |
| - "2 birdCall:0.31745999999999996;cupcakePaper:0.32... \n", |
354 |
| - "3 cloudSign:0.26761999999999997;eyeball:0.288890... \n", |
355 |
| - "4 birdCall:0.32366999999999996;cloudSign:0.28574... \n", |
356 |
| - ".. ... \n", |
357 |
| - "902 birdCall:0.32993;pinkCandle:0.6486;sign:0.6548... \n", |
358 |
| - "903 eyeball:0.40166999999999997;blueSunglasses:0.3... \n", |
359 |
| - "904 eyeball:0.32503000000000004;pumpkinNotes:0.286... \n", |
360 |
| - "905 eyeball:0.4456;pumpkinNotes:0.29717;redWhistle... \n", |
361 |
| - "906 birdCall:0.44903000000000004;eyeball:0.25527;b... \n", |
362 |
| - "\n", |
363 |
| - "[907 rows x 5 columns]" |
| 304 | + "[4491 rows x 4 columns]" |
364 | 305 | ]
|
365 | 306 | },
|
366 |
| - "execution_count": 11, |
| 307 | + "execution_count": 17, |
367 | 308 | "metadata": {},
|
368 | 309 | "output_type": "execute_result"
|
369 | 310 | }
|
|
374 | 315 | },
|
375 | 316 | {
|
376 | 317 | "cell_type": "code",
|
377 |
| - "execution_count": 12, |
| 318 | + "execution_count": 18, |
378 | 319 | "metadata": {},
|
379 | 320 | "outputs": [],
|
380 | 321 | "source": [
|
381 |
| - "Labels.to_csv('data.csv',index=False)" |
| 322 | + "Labels.to_csv('..\\..\\..\\miniChalenge2_2020_ViolinMatrix\\src\\data\\data.csv',index=False)" |
| 323 | + ] |
| 324 | + }, |
| 325 | + { |
| 326 | + "cell_type": "markdown", |
| 327 | + "metadata": {}, |
| 328 | + "source": [ |
| 329 | + "## True state" |
382 | 330 | ]
|
383 | 331 | },
|
| 332 | + { |
| 333 | + "cell_type": "code", |
| 334 | + "execution_count": 19, |
| 335 | + "metadata": {}, |
| 336 | + "outputs": [], |
| 337 | + "source": [ |
| 338 | + "for file_name in glob.iglob('./Manual Correction Results/*.csv', recursive=True):\n", |
| 339 | + " try:\n", |
| 340 | + " df = pd.read_csv(file_name)\n", |
| 341 | + " except:\n", |
| 342 | + " print(file_name)" |
| 343 | + ] |
| 344 | + }, |
| 345 | + { |
| 346 | + "cell_type": "code", |
| 347 | + "execution_count": null, |
| 348 | + "metadata": {}, |
| 349 | + "outputs": [], |
| 350 | + "source": [ |
| 351 | + "Labels = pd.DataFrame({'Person':[],'Image':[],'Label':[],'Score':[]})\n", |
| 352 | + "for file_name in glob.iglob('./Manual Correction Results/*.csv', recursive=True):\n", |
| 353 | + " personIndex = file_name.split('\\\\')[-2].replace('Person','').replace('_manual.csv','')\n", |
| 354 | + " df = pd.read_csv(file_name,encoding = \"ISO-8859-1\")\n", |
| 355 | + " for index in range(0,df.shape[0]):\n", |
| 356 | + " row = df.loc[index]\n", |
| 357 | + " img = 'Person'+personIndex+'_'+str(row['Image'])\n", |
| 358 | + " for col in df.columns:\n", |
| 359 | + " if (col != 'Image'):\n", |
| 360 | + " label = row[col]\n", |
| 361 | + " try:\n", |
| 362 | + " math.isnan(label)\n", |
| 363 | + " except:\n", |
| 364 | + " Labels = Labels.append({'Person':personIndex,'Image':img,'Label':label,'Score':1},ignore_index=True)" |
| 365 | + ] |
| 366 | + }, |
| 367 | + { |
| 368 | + "cell_type": "code", |
| 369 | + "execution_count": null, |
| 370 | + "metadata": {}, |
| 371 | + "outputs": [], |
| 372 | + "source": [] |
| 373 | + }, |
| 374 | + { |
| 375 | + "cell_type": "code", |
| 376 | + "execution_count": null, |
| 377 | + "metadata": {}, |
| 378 | + "outputs": [], |
| 379 | + "source": [] |
| 380 | + }, |
384 | 381 | {
|
385 | 382 | "cell_type": "code",
|
386 | 383 | "execution_count": null,
|
|
0 commit comments