swapniel99 commited on
Commit
c976bd4
·
1 Parent(s): 375ca58

Upload 4 files

Browse files
Files changed (3) hide show
  1. S12_incorrect.csv +742 -0
  2. app.py +94 -0
  3. requirements.txt +15 -0
S12_incorrect.csv ADDED
@@ -0,0 +1,742 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ indices,ground_truths,predicted_vals
2
+ 24,5,4
3
+ 35,2,3
4
+ 58,4,5
5
+ 59,6,3
6
+ 61,3,5
7
+ 86,2,7
8
+ 118,2,6
9
+ 143,3,5
10
+ 147,2,5
11
+ 158,5,3
12
+ 169,0,8
13
+ 178,5,2
14
+ 188,4,2
15
+ 226,6,0
16
+ 237,0,9
17
+ 275,5,3
18
+ 277,3,2
19
+ 308,1,9
20
+ 313,0,2
21
+ 376,0,9
22
+ 378,0,8
23
+ 384,2,5
24
+ 394,9,1
25
+ 422,0,8
26
+ 426,3,6
27
+ 428,0,6
28
+ 456,3,4
29
+ 470,3,5
30
+ 483,5,3
31
+ 497,2,5
32
+ 508,9,1
33
+ 531,0,3
34
+ 537,2,6
35
+ 551,5,3
36
+ 567,7,3
37
+ 577,9,8
38
+ 598,5,3
39
+ 618,2,3
40
+ 642,0,2
41
+ 655,2,4
42
+ 665,8,0
43
+ 672,6,2
44
+ 679,5,3
45
+ 683,8,0
46
+ 711,8,0
47
+ 725,2,0
48
+ 727,3,0
49
+ 731,2,0
50
+ 739,3,5
51
+ 751,2,0
52
+ 770,6,4
53
+ 771,1,8
54
+ 776,2,3
55
+ 779,5,6
56
+ 793,4,5
57
+ 799,2,4
58
+ 810,5,2
59
+ 811,3,2
60
+ 828,5,4
61
+ 845,3,2
62
+ 850,7,5
63
+ 863,3,5
64
+ 878,3,4
65
+ 882,3,0
66
+ 888,0,8
67
+ 893,6,3
68
+ 948,3,4
69
+ 972,2,6
70
+ 982,0,4
71
+ 997,1,9
72
+ 1040,7,5
73
+ 1042,5,2
74
+ 1057,7,5
75
+ 1066,9,1
76
+ 1072,0,8
77
+ 1074,3,6
78
+ 1088,3,5
79
+ 1090,0,8
80
+ 1095,2,6
81
+ 1100,7,5
82
+ 1118,4,7
83
+ 1126,2,0
84
+ 1129,3,5
85
+ 1131,1,9
86
+ 1137,0,9
87
+ 1147,6,9
88
+ 1163,3,5
89
+ 1177,9,1
90
+ 1224,7,4
91
+ 1227,3,5
92
+ 1230,5,3
93
+ 1265,9,1
94
+ 1292,4,3
95
+ 1304,4,8
96
+ 1325,2,4
97
+ 1334,3,2
98
+ 1346,3,5
99
+ 1391,7,5
100
+ 1393,4,2
101
+ 1394,6,5
102
+ 1416,3,5
103
+ 1442,3,5
104
+ 1445,3,4
105
+ 1461,0,9
106
+ 1470,7,3
107
+ 1492,9,1
108
+ 1494,7,3
109
+ 1495,2,0
110
+ 1501,2,6
111
+ 1503,4,3
112
+ 1506,5,7
113
+ 1536,5,3
114
+ 1552,3,5
115
+ 1580,6,2
116
+ 1620,5,8
117
+ 1628,4,7
118
+ 1644,2,3
119
+ 1684,1,8
120
+ 1685,8,2
121
+ 1718,0,8
122
+ 1723,2,5
123
+ 1727,9,1
124
+ 1731,5,3
125
+ 1732,9,1
126
+ 1734,9,1
127
+ 1741,4,5
128
+ 1746,2,0
129
+ 1779,3,5
130
+ 1803,2,3
131
+ 1804,5,0
132
+ 1812,5,3
133
+ 1823,0,2
134
+ 1830,3,5
135
+ 1845,7,4
136
+ 1858,4,7
137
+ 1862,5,4
138
+ 1884,7,5
139
+ 1885,5,3
140
+ 1886,8,2
141
+ 1895,8,2
142
+ 1897,8,0
143
+ 1909,3,4
144
+ 1935,6,2
145
+ 1938,8,0
146
+ 1939,6,7
147
+ 1945,4,7
148
+ 1957,3,5
149
+ 1969,1,9
150
+ 1983,8,2
151
+ 2001,5,4
152
+ 2010,7,2
153
+ 2034,3,4
154
+ 2036,5,3
155
+ 2059,9,8
156
+ 2061,5,3
157
+ 2067,7,4
158
+ 2078,2,6
159
+ 2111,9,1
160
+ 2128,4,6
161
+ 2157,3,5
162
+ 2161,5,3
163
+ 2165,2,0
164
+ 2172,5,2
165
+ 2175,3,5
166
+ 2187,5,3
167
+ 2216,2,3
168
+ 2226,2,6
169
+ 2232,0,3
170
+ 2248,0,8
171
+ 2251,6,3
172
+ 2253,3,5
173
+ 2270,2,4
174
+ 2271,9,0
175
+ 2293,8,1
176
+ 2299,6,3
177
+ 2300,3,0
178
+ 2350,3,0
179
+ 2362,3,4
180
+ 2363,2,6
181
+ 2379,0,8
182
+ 2386,4,3
183
+ 2405,3,6
184
+ 2409,4,2
185
+ 2413,4,6
186
+ 2442,4,3
187
+ 2447,6,2
188
+ 2472,5,3
189
+ 2473,0,8
190
+ 2495,9,8
191
+ 2511,8,1
192
+ 2525,5,2
193
+ 2532,0,1
194
+ 2533,8,9
195
+ 2535,0,8
196
+ 2542,2,0
197
+ 2580,6,3
198
+ 2586,7,3
199
+ 2590,5,0
200
+ 2592,2,7
201
+ 2597,2,3
202
+ 2634,1,9
203
+ 2650,5,0
204
+ 2675,2,6
205
+ 2705,8,0
206
+ 2719,4,3
207
+ 2729,5,3
208
+ 2770,7,3
209
+ 2779,3,5
210
+ 2785,4,5
211
+ 2798,3,5
212
+ 2804,3,5
213
+ 2831,3,0
214
+ 2843,1,8
215
+ 2844,4,3
216
+ 2845,5,2
217
+ 2854,9,1
218
+ 2895,7,5
219
+ 2912,2,6
220
+ 2923,3,5
221
+ 2937,3,5
222
+ 2940,3,0
223
+ 2948,5,4
224
+ 2958,0,8
225
+ 2960,9,0
226
+ 3013,3,5
227
+ 3019,5,3
228
+ 3025,2,6
229
+ 3026,5,7
230
+ 3032,2,6
231
+ 3049,3,5
232
+ 3051,8,2
233
+ 3052,3,6
234
+ 3059,5,3
235
+ 3068,2,0
236
+ 3075,6,3
237
+ 3083,5,3
238
+ 3094,2,0
239
+ 3095,4,6
240
+ 3107,5,3
241
+ 3115,5,3
242
+ 3150,1,9
243
+ 3158,0,8
244
+ 3180,3,5
245
+ 3183,3,5
246
+ 3192,5,4
247
+ 3202,5,3
248
+ 3231,3,5
249
+ 3236,5,3
250
+ 3301,8,2
251
+ 3342,0,8
252
+ 3354,3,5
253
+ 3359,7,3
254
+ 3390,3,5
255
+ 3400,6,0
256
+ 3412,0,3
257
+ 3416,7,4
258
+ 3439,4,6
259
+ 3443,4,2
260
+ 3444,0,2
261
+ 3450,9,1
262
+ 3459,9,8
263
+ 3496,5,3
264
+ 3514,2,7
265
+ 3524,5,4
266
+ 3550,0,4
267
+ 3560,1,9
268
+ 3574,5,3
269
+ 3584,3,5
270
+ 3594,3,8
271
+ 3596,2,4
272
+ 3600,4,3
273
+ 3601,0,7
274
+ 3607,3,2
275
+ 3615,6,0
276
+ 3653,8,0
277
+ 3658,2,4
278
+ 3669,5,3
279
+ 3696,4,3
280
+ 3704,5,4
281
+ 3708,4,3
282
+ 3716,3,6
283
+ 3726,5,3
284
+ 3728,2,4
285
+ 3735,5,3
286
+ 3753,4,6
287
+ 3774,5,3
288
+ 3779,3,0
289
+ 3785,6,2
290
+ 3789,9,1
291
+ 3799,3,5
292
+ 3801,2,0
293
+ 3821,8,3
294
+ 3828,1,0
295
+ 3887,2,4
296
+ 3899,6,2
297
+ 3957,9,0
298
+ 3977,3,6
299
+ 3980,9,0
300
+ 3995,7,3
301
+ 3996,6,2
302
+ 4000,8,7
303
+ 4003,2,0
304
+ 4012,3,5
305
+ 4013,1,9
306
+ 4036,7,0
307
+ 4051,5,3
308
+ 4054,7,0
309
+ 4055,1,0
310
+ 4071,3,2
311
+ 4101,2,0
312
+ 4106,3,4
313
+ 4112,4,5
314
+ 4125,8,0
315
+ 4135,1,0
316
+ 4137,4,3
317
+ 4139,5,0
318
+ 4140,5,3
319
+ 4152,5,3
320
+ 4169,3,5
321
+ 4190,3,5
322
+ 4244,2,7
323
+ 4251,8,0
324
+ 4255,9,6
325
+ 4276,9,1
326
+ 4302,2,5
327
+ 4309,7,5
328
+ 4315,6,0
329
+ 4404,3,4
330
+ 4409,8,1
331
+ 4423,6,2
332
+ 4446,0,8
333
+ 4463,5,2
334
+ 4483,2,6
335
+ 4485,3,7
336
+ 4526,3,5
337
+ 4545,3,4
338
+ 4546,2,0
339
+ 4574,3,4
340
+ 4590,9,0
341
+ 4599,8,1
342
+ 4606,0,3
343
+ 4614,3,5
344
+ 4618,3,6
345
+ 4628,5,7
346
+ 4630,2,6
347
+ 4652,3,5
348
+ 4669,6,4
349
+ 4710,3,7
350
+ 4729,2,3
351
+ 4740,5,3
352
+ 4744,6,0
353
+ 4748,0,3
354
+ 4749,2,3
355
+ 4754,3,8
356
+ 4760,3,0
357
+ 4776,3,5
358
+ 4784,0,8
359
+ 4786,6,3
360
+ 4794,4,2
361
+ 4795,5,3
362
+ 4862,3,0
363
+ 4887,5,3
364
+ 4892,7,4
365
+ 4906,5,3
366
+ 4917,5,3
367
+ 4921,5,6
368
+ 4931,9,1
369
+ 4942,5,8
370
+ 4964,5,4
371
+ 4965,3,4
372
+ 4970,2,3
373
+ 4995,2,3
374
+ 4996,3,5
375
+ 5006,7,2
376
+ 5068,4,5
377
+ 5098,5,2
378
+ 5117,7,3
379
+ 5119,5,0
380
+ 5134,5,3
381
+ 5151,9,3
382
+ 5162,7,0
383
+ 5176,3,9
384
+ 5183,4,3
385
+ 5187,4,5
386
+ 5193,4,2
387
+ 5206,3,5
388
+ 5211,7,4
389
+ 5218,3,5
390
+ 5224,0,3
391
+ 5229,5,3
392
+ 5238,2,0
393
+ 5279,0,9
394
+ 5290,3,7
395
+ 5292,4,7
396
+ 5324,2,4
397
+ 5330,7,5
398
+ 5340,3,4
399
+ 5369,4,6
400
+ 5388,6,3
401
+ 5398,8,0
402
+ 5410,3,5
403
+ 5416,9,1
404
+ 5417,4,3
405
+ 5426,5,3
406
+ 5433,3,5
407
+ 5454,0,2
408
+ 5455,9,1
409
+ 5458,3,6
410
+ 5468,5,3
411
+ 5511,3,6
412
+ 5537,2,3
413
+ 5548,8,0
414
+ 5565,3,6
415
+ 5582,4,3
416
+ 5603,5,4
417
+ 5607,6,0
418
+ 5609,5,3
419
+ 5628,8,1
420
+ 5632,3,5
421
+ 5642,5,4
422
+ 5659,2,6
423
+ 5708,2,5
424
+ 5709,2,4
425
+ 5718,1,8
426
+ 5730,5,3
427
+ 5745,5,3
428
+ 5747,8,0
429
+ 5749,5,3
430
+ 5794,7,0
431
+ 5808,5,3
432
+ 5830,5,3
433
+ 5835,3,5
434
+ 5856,3,5
435
+ 5859,2,3
436
+ 5862,2,3
437
+ 5870,7,4
438
+ 5881,3,5
439
+ 5886,2,4
440
+ 5908,3,6
441
+ 5910,2,5
442
+ 5915,5,3
443
+ 5924,4,2
444
+ 5927,6,2
445
+ 5960,2,6
446
+ 5987,3,7
447
+ 5991,3,5
448
+ 5992,4,7
449
+ 6008,3,0
450
+ 6014,5,4
451
+ 6025,6,3
452
+ 6028,8,2
453
+ 6051,4,7
454
+ 6063,6,4
455
+ 6068,5,3
456
+ 6070,8,9
457
+ 6083,2,3
458
+ 6127,5,2
459
+ 6144,7,5
460
+ 6145,2,5
461
+ 6146,0,9
462
+ 6151,7,6
463
+ 6160,2,0
464
+ 6162,0,9
465
+ 6174,3,5
466
+ 6180,0,8
467
+ 6202,3,2
468
+ 6210,4,6
469
+ 6243,4,6
470
+ 6257,5,2
471
+ 6283,3,5
472
+ 6305,6,3
473
+ 6382,4,3
474
+ 6396,4,6
475
+ 6401,4,7
476
+ 6423,5,4
477
+ 6439,3,4
478
+ 6446,4,2
479
+ 6466,8,0
480
+ 6480,0,8
481
+ 6498,4,6
482
+ 6499,7,3
483
+ 6522,9,1
484
+ 6545,9,8
485
+ 6559,2,4
486
+ 6562,5,3
487
+ 6588,0,8
488
+ 6596,3,2
489
+ 6653,0,2
490
+ 6669,5,4
491
+ 6709,3,5
492
+ 6729,0,7
493
+ 6741,9,0
494
+ 6748,0,6
495
+ 6750,4,3
496
+ 6753,4,2
497
+ 6759,1,9
498
+ 6783,3,2
499
+ 6792,3,9
500
+ 6859,3,1
501
+ 6861,8,0
502
+ 6876,7,9
503
+ 6901,2,9
504
+ 6912,3,5
505
+ 6942,3,2
506
+ 6962,7,4
507
+ 6969,2,6
508
+ 6970,0,2
509
+ 6973,3,5
510
+ 6979,5,4
511
+ 6980,0,8
512
+ 6994,3,4
513
+ 7000,2,8
514
+ 7002,3,4
515
+ 7004,3,7
516
+ 7005,1,9
517
+ 7035,1,9
518
+ 7037,7,5
519
+ 7040,7,0
520
+ 7068,2,0
521
+ 7090,2,5
522
+ 7099,3,5
523
+ 7107,2,6
524
+ 7112,2,0
525
+ 7143,4,2
526
+ 7150,3,6
527
+ 7168,5,3
528
+ 7214,3,5
529
+ 7217,8,6
530
+ 7228,3,2
531
+ 7265,5,7
532
+ 7274,1,9
533
+ 7311,1,9
534
+ 7367,3,5
535
+ 7384,3,5
536
+ 7395,2,3
537
+ 7398,5,2
538
+ 7399,3,5
539
+ 7400,3,5
540
+ 7408,4,5
541
+ 7411,5,3
542
+ 7414,8,0
543
+ 7420,3,5
544
+ 7444,9,1
545
+ 7496,3,4
546
+ 7509,3,5
547
+ 7519,2,8
548
+ 7524,3,8
549
+ 7545,5,3
550
+ 7556,2,0
551
+ 7559,8,1
552
+ 7561,2,3
553
+ 7562,2,3
554
+ 7590,2,4
555
+ 7600,8,1
556
+ 7605,2,6
557
+ 7617,2,0
558
+ 7620,5,3
559
+ 7644,3,5
560
+ 7657,2,5
561
+ 7685,9,0
562
+ 7705,7,5
563
+ 7711,6,2
564
+ 7744,4,8
565
+ 7760,2,0
566
+ 7761,2,3
567
+ 7763,4,2
568
+ 7784,7,2
569
+ 7792,9,1
570
+ 7797,3,6
571
+ 7815,0,2
572
+ 7816,0,4
573
+ 7827,3,5
574
+ 7839,3,4
575
+ 7852,5,7
576
+ 7853,3,2
577
+ 7881,3,4
578
+ 7892,1,9
579
+ 7924,3,5
580
+ 7941,5,2
581
+ 7947,2,3
582
+ 7958,5,3
583
+ 7967,9,1
584
+ 7983,6,8
585
+ 8014,2,4
586
+ 8030,2,0
587
+ 8033,3,5
588
+ 8046,8,9
589
+ 8058,4,7
590
+ 8084,5,3
591
+ 8115,5,3
592
+ 8119,6,2
593
+ 8131,3,6
594
+ 8166,2,6
595
+ 8198,4,0
596
+ 8209,2,4
597
+ 8236,5,2
598
+ 8245,3,5
599
+ 8254,8,0
600
+ 8266,5,3
601
+ 8269,8,0
602
+ 8281,3,5
603
+ 8295,3,0
604
+ 8300,5,3
605
+ 8305,4,3
606
+ 8314,6,3
607
+ 8317,5,3
608
+ 8324,3,5
609
+ 8362,3,5
610
+ 8363,2,6
611
+ 8420,3,6
612
+ 8428,5,6
613
+ 8433,3,6
614
+ 8451,5,7
615
+ 8457,2,4
616
+ 8473,2,4
617
+ 8480,2,6
618
+ 8490,3,5
619
+ 8507,8,0
620
+ 8514,7,3
621
+ 8521,9,8
622
+ 8529,0,9
623
+ 8536,1,9
624
+ 8542,2,6
625
+ 8548,3,4
626
+ 8573,6,0
627
+ 8576,2,0
628
+ 8577,3,6
629
+ 8578,2,5
630
+ 8598,3,2
631
+ 8629,7,4
632
+ 8633,3,8
633
+ 8644,8,0
634
+ 8650,2,5
635
+ 8671,4,6
636
+ 8699,4,5
637
+ 8723,5,4
638
+ 8727,9,0
639
+ 8728,6,5
640
+ 8735,3,2
641
+ 8743,0,8
642
+ 8757,8,0
643
+ 8773,6,2
644
+ 8778,3,0
645
+ 8779,7,5
646
+ 8803,3,5
647
+ 8827,2,5
648
+ 8840,2,3
649
+ 8847,5,3
650
+ 8848,3,7
651
+ 8854,4,8
652
+ 8858,6,4
653
+ 8898,7,0
654
+ 8901,5,7
655
+ 8928,4,2
656
+ 8930,3,8
657
+ 8932,6,2
658
+ 8941,0,3
659
+ 8943,7,5
660
+ 8958,6,2
661
+ 8976,7,2
662
+ 8977,0,8
663
+ 8983,3,4
664
+ 8985,9,0
665
+ 8993,0,9
666
+ 9026,9,0
667
+ 9031,0,8
668
+ 9034,2,4
669
+ 9039,2,6
670
+ 9067,9,1
671
+ 9080,3,5
672
+ 9082,2,3
673
+ 9090,2,4
674
+ 9105,8,0
675
+ 9107,5,4
676
+ 9132,2,6
677
+ 9145,1,9
678
+ 9148,3,5
679
+ 9157,3,5
680
+ 9190,3,4
681
+ 9209,9,1
682
+ 9216,6,3
683
+ 9218,3,5
684
+ 9223,1,9
685
+ 9225,5,8
686
+ 9227,1,9
687
+ 9231,7,2
688
+ 9254,7,5
689
+ 9260,5,3
690
+ 9294,6,3
691
+ 9305,5,7
692
+ 9319,3,5
693
+ 9336,3,5
694
+ 9360,5,3
695
+ 9369,5,4
696
+ 9375,3,5
697
+ 9385,7,3
698
+ 9386,4,2
699
+ 9414,5,3
700
+ 9431,3,5
701
+ 9497,3,6
702
+ 9501,6,0
703
+ 9503,2,4
704
+ 9505,3,5
705
+ 9506,4,2
706
+ 9518,9,1
707
+ 9522,3,2
708
+ 9535,1,9
709
+ 9563,1,5
710
+ 9587,7,5
711
+ 9616,5,3
712
+ 9625,2,0
713
+ 9633,0,3
714
+ 9641,6,3
715
+ 9643,9,0
716
+ 9657,5,3
717
+ 9665,3,5
718
+ 9704,2,3
719
+ 9707,5,7
720
+ 9729,4,6
721
+ 9734,4,7
722
+ 9750,2,3
723
+ 9753,3,2
724
+ 9786,6,1
725
+ 9787,8,0
726
+ 9805,2,0
727
+ 9812,3,8
728
+ 9817,9,1
729
+ 9819,3,5
730
+ 9832,2,5
731
+ 9840,4,7
732
+ 9842,6,4
733
+ 9853,5,6
734
+ 9857,0,1
735
+ 9884,9,1
736
+ 9901,3,6
737
+ 9910,4,7
738
+ 9949,3,2
739
+ 9960,2,0
740
+ 9968,3,5
741
+ 9982,2,6
742
+ 9989,2,4
app.py ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import pandas as pd
3
+ import numpy as np
4
+ import gradio as gr
5
+ from PIL import Image
6
+ from torch.nn import functional as F
7
+ from collections import OrderedDict
8
+ from torchvision import transforms
9
+ from pytorch_grad_cam import GradCAM
10
+ from pytorch_grad_cam.utils.image import show_cam_on_image
11
+ from pytorch_grad_cam.utils.model_targets import ClassifierOutputTarget
12
+
13
+ from models.custom_resnet import Model
14
+ from datasets import CIFAR10
15
+
16
+ cifar10 = CIFAR10(normalize=False, shuffle=False, augment=False)
17
+ _ = cifar10.test_data
18
+
19
+ missed_df = pd.read_csv('S12_incorrect.csv')
20
+ missed_df['ground_truths'] = missed_df['ground_truths'].map(cifar10.classes)
21
+ missed_df['predicted_vals'] = missed_df['predicted_vals'].map(cifar10.classes)
22
+ missed_df = missed_df.sample(frac=1)
23
+
24
+ model = Model(cifar10)
25
+ model.load_state_dict(torch.load('S12_model.pth', map_location='mps'))
26
+ model.eval()
27
+
28
+ transform = transforms.Compose([
29
+ transforms.ToTensor(),
30
+ transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.25, 0.25, 0.25])
31
+ ])
32
+
33
+ inv_transform = transforms.Normalize(mean=[-2, -2, -2], std=[4, 4, 4])
34
+
35
+
36
+ def image_classifier(input_image, top_classes=3, show_cam=True, target_layer=-1, transparency=0.5):
37
+ input = transform(input_image).unsqueeze(0)
38
+
39
+ output = model(input)
40
+ output = F.softmax(output.flatten(), dim=-1)
41
+
42
+ confidences = [(cifar10.classes[i], float(output[i])) for i in range(10)]
43
+ confidences.sort(key=lambda x: x[1], reverse=True)
44
+ confidences = OrderedDict(confidences[:top_classes])
45
+
46
+ label = torch.argmax(output).item()
47
+ target_layer = [model.network[4 + target_layer]]
48
+ grad_cam = GradCAM(model=model, target_layers=target_layer, use_cuda=False)
49
+ targets = [ClassifierOutputTarget(label)]
50
+ grayscale_cam = grad_cam(input_tensor=input, targets=targets)
51
+ grayscale_cam = grayscale_cam[0, :]
52
+ output_image = show_cam_on_image(input_image/255, grayscale_cam, use_rgb=True, image_weight=transparency)
53
+
54
+ return output_image if show_cam else input_image, confidences
55
+
56
+
57
+ demo1 = gr.Interface(
58
+ fn=image_classifier,
59
+ inputs=[
60
+ gr.Image(shape=(32, 32), label="Input Image", value='examples/cat.jpg'),
61
+ gr.Slider(1, 10, value = 3, step=1, label="Number of Top Classes"),
62
+ gr.Checkbox(label="Show GradCAM?", value=True),
63
+ gr.Slider(-4, -1, value = -1, step=1, label="Which Layer?"),
64
+ gr.Slider(0, 1, value = 0.7, label="Transparncy", step=0.1)
65
+ ],
66
+ outputs=[gr.Image(shape=(32, 32), label="Output Image"),
67
+ gr.Label(label='Top Classes')],
68
+ examples=[[f'examples/{k}.jpg'] for k in cifar10.classes.values()]
69
+ )
70
+
71
+
72
+ def show_incorrect(num_examples=10, show_cam=True, target_layer=-1, transparency=0.5):
73
+ result = list()
74
+ for index, row in missed_df.head(num_examples).iterrows():
75
+ image = np.asarray(Image.open(f'missed_examples/{index}.jpg'))
76
+ output_image, confidence = image_classifier(image, show_cam=show_cam, target_layer=target_layer, transparency=transparency)
77
+ predicted = list(confidence)[0]
78
+ result.append((output_image, f"{row['ground_truths']} / {predicted}"))
79
+ return result
80
+
81
+
82
+ demo2 = gr.Interface(
83
+ fn=show_incorrect,
84
+ inputs=[
85
+ gr.Number(value=10, minimum=1, maximum=len(missed_df), label="No. of missclassified Examples", precision=0),
86
+ gr.Checkbox(label="Show GradCAM?", value=True),
87
+ gr.Slider(-4, -1, value = -1, step=1, label="Which Layer?"),
88
+ gr.Slider(0, 1, value = 0.7, label="Transparncy", step=0.1),
89
+ ],
90
+ outputs=[gr.Gallery(label="Missclassified Images (Truth / Predicted)", columns=4)]
91
+ )
92
+
93
+ demo = gr.TabbedInterface([demo1, demo2], ["Examples", "Misclassified Examples"])
94
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ torch
2
+ torchvision
3
+ torchinfo
4
+ tqdm
5
+ matplotlib
6
+ albumentations
7
+ numpy
8
+ opencv-python
9
+ torch-lr-finder
10
+ grad-cam
11
+ pytorch-lightning
12
+ torchmetrics
13
+ pandas
14
+ gradio
15
+ Pillow