File size: 32,368 Bytes
3ec3ebe |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"\n",
"df = pd.read_parquet('object_annotations.parquet')"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>col_x</th>\n",
" <th>row_y</th>\n",
" <th>width</th>\n",
" <th>height</th>\n",
" <th>confidence</th>\n",
" <th>label</th>\n",
" <th>source</th>\n",
" <th>caption</th>\n",
" <th>filename</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>459.0</td>\n",
" <td>97.0</td>\n",
" <td>29.0</td>\n",
" <td>34.0</td>\n",
" <td>0.888</td>\n",
" <td>human face</td>\n",
" <td>VL</td>\n",
" <td>a man with a white shirt and a black tie</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_149.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>431.0</td>\n",
" <td>115.0</td>\n",
" <td>31.0</td>\n",
" <td>41.0</td>\n",
" <td>0.864</td>\n",
" <td>human face</td>\n",
" <td>VL</td>\n",
" <td>a woman with a blonde hair and a white shirt</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_149.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>160.0</td>\n",
" <td>76.0</td>\n",
" <td>63.0</td>\n",
" <td>79.0</td>\n",
" <td>0.377</td>\n",
" <td>human face</td>\n",
" <td>VL</td>\n",
" <td>a close up of a cat's face</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_149.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>446.0</td>\n",
" <td>85.0</td>\n",
" <td>173.0</td>\n",
" <td>203.0</td>\n",
" <td>0.379</td>\n",
" <td>human face</td>\n",
" <td>VL</td>\n",
" <td>a brown cat with green eyes</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_24.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>-0.0</td>\n",
" <td>223.0</td>\n",
" <td>163.0</td>\n",
" <td>277.0</td>\n",
" <td>0.822</td>\n",
" <td>human face</td>\n",
" <td>VL</td>\n",
" <td>a man wearing a hat</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_94.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14323</th>\n",
" <td>0.0</td>\n",
" <td>66.0</td>\n",
" <td>320.0</td>\n",
" <td>262.0</td>\n",
" <td>0.924</td>\n",
" <td>dog</td>\n",
" <td>VL</td>\n",
" <td>a small dog standing on a rock near a stream</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_97.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14324</th>\n",
" <td>156.0</td>\n",
" <td>366.0</td>\n",
" <td>179.0</td>\n",
" <td>134.0</td>\n",
" <td>0.693</td>\n",
" <td>log</td>\n",
" <td>VL</td>\n",
" <td>a bird sitting on a rock next to a stream</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_97.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14325</th>\n",
" <td>2.0</td>\n",
" <td>0.0</td>\n",
" <td>396.0</td>\n",
" <td>374.0</td>\n",
" <td>0.938</td>\n",
" <td>dog</td>\n",
" <td>VL</td>\n",
" <td>a small black and brown puppy is being held by...</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_58.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14326</th>\n",
" <td>0.0</td>\n",
" <td>224.0</td>\n",
" <td>230.0</td>\n",
" <td>151.0</td>\n",
" <td>0.310</td>\n",
" <td>person</td>\n",
" <td>VL</td>\n",
" <td>a small brown dog is being held by a person</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_58.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14327</th>\n",
" <td>137.0</td>\n",
" <td>79.0</td>\n",
" <td>216.0</td>\n",
" <td>152.0</td>\n",
" <td>0.974</td>\n",
" <td>dog</td>\n",
" <td>VL</td>\n",
" <td>a small black and gray dog standing in the grass</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_6.jpg</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>14328 rows × 9 columns</p>\n",
"</div>"
],
"text/plain": [
" col_x row_y width height confidence label source \\\n",
"0 459.0 97.0 29.0 34.0 0.888 human face VL \n",
"1 431.0 115.0 31.0 41.0 0.864 human face VL \n",
"2 160.0 76.0 63.0 79.0 0.377 human face VL \n",
"3 446.0 85.0 173.0 203.0 0.379 human face VL \n",
"4 -0.0 223.0 163.0 277.0 0.822 human face VL \n",
"... ... ... ... ... ... ... ... \n",
"14323 0.0 66.0 320.0 262.0 0.924 dog VL \n",
"14324 156.0 366.0 179.0 134.0 0.693 log VL \n",
"14325 2.0 0.0 396.0 374.0 0.938 dog VL \n",
"14326 0.0 224.0 230.0 151.0 0.310 person VL \n",
"14327 137.0 79.0 216.0 152.0 0.974 dog VL \n",
"\n",
" caption \\\n",
"0 a man with a white shirt and a black tie \n",
"1 a woman with a blonde hair and a white shirt \n",
"2 a close up of a cat's face \n",
"3 a brown cat with green eyes \n",
"4 a man wearing a hat \n",
"... ... \n",
"14323 a small dog standing on a rock near a stream \n",
"14324 a bird sitting on a rock next to a stream \n",
"14325 a small black and brown puppy is being held by... \n",
"14326 a small brown dog is being held by a person \n",
"14327 a small black and gray dog standing in the grass \n",
"\n",
" filename \n",
"0 oxford-iiit-pet/images/Abyssinian_149.jpg \n",
"1 oxford-iiit-pet/images/Abyssinian_149.jpg \n",
"2 oxford-iiit-pet/images/Abyssinian_149.jpg \n",
"3 oxford-iiit-pet/images/Abyssinian_24.jpg \n",
"4 oxford-iiit-pet/images/Abyssinian_94.jpg \n",
"... ... \n",
"14323 oxford-iiit-pet/images/yorkshire_terrier_97.jpg \n",
"14324 oxford-iiit-pet/images/yorkshire_terrier_97.jpg \n",
"14325 oxford-iiit-pet/images/yorkshire_terrier_58.jpg \n",
"14326 oxford-iiit-pet/images/yorkshire_terrier_58.jpg \n",
"14327 oxford-iiit-pet/images/yorkshire_terrier_6.jpg \n",
"\n",
"[14328 rows x 9 columns]"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>col_x</th>\n",
" <th>row_y</th>\n",
" <th>width</th>\n",
" <th>height</th>\n",
" <th>confidence</th>\n",
" <th>label</th>\n",
" <th>filename</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>459.0</td>\n",
" <td>97.0</td>\n",
" <td>29.0</td>\n",
" <td>34.0</td>\n",
" <td>0.888</td>\n",
" <td>human face</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_149.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>431.0</td>\n",
" <td>115.0</td>\n",
" <td>31.0</td>\n",
" <td>41.0</td>\n",
" <td>0.864</td>\n",
" <td>human face</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_149.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>160.0</td>\n",
" <td>76.0</td>\n",
" <td>63.0</td>\n",
" <td>79.0</td>\n",
" <td>0.377</td>\n",
" <td>human face</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_149.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>446.0</td>\n",
" <td>85.0</td>\n",
" <td>173.0</td>\n",
" <td>203.0</td>\n",
" <td>0.379</td>\n",
" <td>human face</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_24.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>-0.0</td>\n",
" <td>223.0</td>\n",
" <td>163.0</td>\n",
" <td>277.0</td>\n",
" <td>0.822</td>\n",
" <td>human face</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_94.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14323</th>\n",
" <td>0.0</td>\n",
" <td>66.0</td>\n",
" <td>320.0</td>\n",
" <td>262.0</td>\n",
" <td>0.924</td>\n",
" <td>dog</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_97.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14324</th>\n",
" <td>156.0</td>\n",
" <td>366.0</td>\n",
" <td>179.0</td>\n",
" <td>134.0</td>\n",
" <td>0.693</td>\n",
" <td>log</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_97.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14325</th>\n",
" <td>2.0</td>\n",
" <td>0.0</td>\n",
" <td>396.0</td>\n",
" <td>374.0</td>\n",
" <td>0.938</td>\n",
" <td>dog</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_58.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14326</th>\n",
" <td>0.0</td>\n",
" <td>224.0</td>\n",
" <td>230.0</td>\n",
" <td>151.0</td>\n",
" <td>0.310</td>\n",
" <td>person</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_58.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14327</th>\n",
" <td>137.0</td>\n",
" <td>79.0</td>\n",
" <td>216.0</td>\n",
" <td>152.0</td>\n",
" <td>0.974</td>\n",
" <td>dog</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_6.jpg</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>14328 rows × 7 columns</p>\n",
"</div>"
],
"text/plain": [
" col_x row_y width height confidence label \\\n",
"0 459.0 97.0 29.0 34.0 0.888 human face \n",
"1 431.0 115.0 31.0 41.0 0.864 human face \n",
"2 160.0 76.0 63.0 79.0 0.377 human face \n",
"3 446.0 85.0 173.0 203.0 0.379 human face \n",
"4 -0.0 223.0 163.0 277.0 0.822 human face \n",
"... ... ... ... ... ... ... \n",
"14323 0.0 66.0 320.0 262.0 0.924 dog \n",
"14324 156.0 366.0 179.0 134.0 0.693 log \n",
"14325 2.0 0.0 396.0 374.0 0.938 dog \n",
"14326 0.0 224.0 230.0 151.0 0.310 person \n",
"14327 137.0 79.0 216.0 152.0 0.974 dog \n",
"\n",
" filename \n",
"0 oxford-iiit-pet/images/Abyssinian_149.jpg \n",
"1 oxford-iiit-pet/images/Abyssinian_149.jpg \n",
"2 oxford-iiit-pet/images/Abyssinian_149.jpg \n",
"3 oxford-iiit-pet/images/Abyssinian_24.jpg \n",
"4 oxford-iiit-pet/images/Abyssinian_94.jpg \n",
"... ... \n",
"14323 oxford-iiit-pet/images/yorkshire_terrier_97.jpg \n",
"14324 oxford-iiit-pet/images/yorkshire_terrier_97.jpg \n",
"14325 oxford-iiit-pet/images/yorkshire_terrier_58.jpg \n",
"14326 oxford-iiit-pet/images/yorkshire_terrier_58.jpg \n",
"14327 oxford-iiit-pet/images/yorkshire_terrier_6.jpg \n",
"\n",
"[14328 rows x 7 columns]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = df.drop(columns=['source', 'caption'])\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>x_top_left</th>\n",
" <th>y_top_left</th>\n",
" <th>width</th>\n",
" <th>height</th>\n",
" <th>confidence</th>\n",
" <th>label</th>\n",
" <th>filename</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>459.0</td>\n",
" <td>97.0</td>\n",
" <td>29.0</td>\n",
" <td>34.0</td>\n",
" <td>0.888</td>\n",
" <td>human face</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_149.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>431.0</td>\n",
" <td>115.0</td>\n",
" <td>31.0</td>\n",
" <td>41.0</td>\n",
" <td>0.864</td>\n",
" <td>human face</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_149.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>160.0</td>\n",
" <td>76.0</td>\n",
" <td>63.0</td>\n",
" <td>79.0</td>\n",
" <td>0.377</td>\n",
" <td>human face</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_149.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>446.0</td>\n",
" <td>85.0</td>\n",
" <td>173.0</td>\n",
" <td>203.0</td>\n",
" <td>0.379</td>\n",
" <td>human face</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_24.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>-0.0</td>\n",
" <td>223.0</td>\n",
" <td>163.0</td>\n",
" <td>277.0</td>\n",
" <td>0.822</td>\n",
" <td>human face</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_94.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14323</th>\n",
" <td>0.0</td>\n",
" <td>66.0</td>\n",
" <td>320.0</td>\n",
" <td>262.0</td>\n",
" <td>0.924</td>\n",
" <td>dog</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_97.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14324</th>\n",
" <td>156.0</td>\n",
" <td>366.0</td>\n",
" <td>179.0</td>\n",
" <td>134.0</td>\n",
" <td>0.693</td>\n",
" <td>log</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_97.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14325</th>\n",
" <td>2.0</td>\n",
" <td>0.0</td>\n",
" <td>396.0</td>\n",
" <td>374.0</td>\n",
" <td>0.938</td>\n",
" <td>dog</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_58.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14326</th>\n",
" <td>0.0</td>\n",
" <td>224.0</td>\n",
" <td>230.0</td>\n",
" <td>151.0</td>\n",
" <td>0.310</td>\n",
" <td>person</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_58.jpg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14327</th>\n",
" <td>137.0</td>\n",
" <td>79.0</td>\n",
" <td>216.0</td>\n",
" <td>152.0</td>\n",
" <td>0.974</td>\n",
" <td>dog</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_6.jpg</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>14328 rows × 7 columns</p>\n",
"</div>"
],
"text/plain": [
" x_top_left y_top_left width height confidence label \\\n",
"0 459.0 97.0 29.0 34.0 0.888 human face \n",
"1 431.0 115.0 31.0 41.0 0.864 human face \n",
"2 160.0 76.0 63.0 79.0 0.377 human face \n",
"3 446.0 85.0 173.0 203.0 0.379 human face \n",
"4 -0.0 223.0 163.0 277.0 0.822 human face \n",
"... ... ... ... ... ... ... \n",
"14323 0.0 66.0 320.0 262.0 0.924 dog \n",
"14324 156.0 366.0 179.0 134.0 0.693 log \n",
"14325 2.0 0.0 396.0 374.0 0.938 dog \n",
"14326 0.0 224.0 230.0 151.0 0.310 person \n",
"14327 137.0 79.0 216.0 152.0 0.974 dog \n",
"\n",
" filename \n",
"0 oxford-iiit-pet/images/Abyssinian_149.jpg \n",
"1 oxford-iiit-pet/images/Abyssinian_149.jpg \n",
"2 oxford-iiit-pet/images/Abyssinian_149.jpg \n",
"3 oxford-iiit-pet/images/Abyssinian_24.jpg \n",
"4 oxford-iiit-pet/images/Abyssinian_94.jpg \n",
"... ... \n",
"14323 oxford-iiit-pet/images/yorkshire_terrier_97.jpg \n",
"14324 oxford-iiit-pet/images/yorkshire_terrier_97.jpg \n",
"14325 oxford-iiit-pet/images/yorkshire_terrier_58.jpg \n",
"14326 oxford-iiit-pet/images/yorkshire_terrier_58.jpg \n",
"14327 oxford-iiit-pet/images/yorkshire_terrier_6.jpg \n",
"\n",
"[14328 rows x 7 columns]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = df.rename(columns={'col_x': 'x_top_left', 'row_y': 'y_top_left'})\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>video</th>\n",
" <th>frame_timestamp</th>\n",
" <th>filename</th>\n",
" <th>caption</th>\n",
" <th>ann_index</th>\n",
" <th>label</th>\n",
" <th>class_id</th>\n",
" <th>vl_label</th>\n",
" <th>vl_class_id</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>None</td>\n",
" <td>NaN</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_144.jpg</td>\n",
" <td>a cat standing on a wooden floor next to a glass</td>\n",
" <td>49.0</td>\n",
" <td>[cat]</td>\n",
" <td>[1]</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>None</td>\n",
" <td>NaN</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_10.jpg</td>\n",
" <td>a cat laying on a bed</td>\n",
" <td>11.0</td>\n",
" <td>[cat]</td>\n",
" <td>[1]</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>None</td>\n",
" <td>NaN</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_155.jpg</td>\n",
" <td>a cat yawning on a couch</td>\n",
" <td>1856.0</td>\n",
" <td>[cat]</td>\n",
" <td>[1]</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>None</td>\n",
" <td>NaN</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_101.jpg</td>\n",
" <td>a cat with green eyes is laying on a green bla...</td>\n",
" <td>2.0</td>\n",
" <td>[cat]</td>\n",
" <td>[1]</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>None</td>\n",
" <td>NaN</td>\n",
" <td>oxford-iiit-pet/images/Abyssinian_156.jpg</td>\n",
" <td>a cat is sitting on a couch</td>\n",
" <td>1857.0</td>\n",
" <td>[cat]</td>\n",
" <td>[1]</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7304</th>\n",
" <td>None</td>\n",
" <td>NaN</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_99.jpg</td>\n",
" <td>a small dog standing on a sidewalk</td>\n",
" <td>7348.0</td>\n",
" <td>[dog]</td>\n",
" <td>[2]</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7305</th>\n",
" <td>None</td>\n",
" <td>NaN</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_56.jpg</td>\n",
" <td>a small dog is standing in the grass</td>\n",
" <td>7301.0</td>\n",
" <td>[dog]</td>\n",
" <td>[2]</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7306</th>\n",
" <td>None</td>\n",
" <td>NaN</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_97.jpg</td>\n",
" <td>a small dog is standing on a rock</td>\n",
" <td>7346.0</td>\n",
" <td>[dog]</td>\n",
" <td>[2]</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7307</th>\n",
" <td>None</td>\n",
" <td>NaN</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_58.jpg</td>\n",
" <td>a small black and brown puppy is being held by...</td>\n",
" <td>7303.0</td>\n",
" <td>[dog]</td>\n",
" <td>[2]</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7308</th>\n",
" <td>None</td>\n",
" <td>NaN</td>\n",
" <td>oxford-iiit-pet/images/yorkshire_terrier_6.jpg</td>\n",
" <td>a small black and gray dog standing in the grass</td>\n",
" <td>7316.0</td>\n",
" <td>[dog]</td>\n",
" <td>[2]</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>7309 rows × 9 columns</p>\n",
"</div>"
],
"text/plain": [
" video frame_timestamp filename \\\n",
"0 None NaN oxford-iiit-pet/images/Abyssinian_144.jpg \n",
"1 None NaN oxford-iiit-pet/images/Abyssinian_10.jpg \n",
"2 None NaN oxford-iiit-pet/images/Abyssinian_155.jpg \n",
"3 None NaN oxford-iiit-pet/images/Abyssinian_101.jpg \n",
"4 None NaN oxford-iiit-pet/images/Abyssinian_156.jpg \n",
"... ... ... ... \n",
"7304 None NaN oxford-iiit-pet/images/yorkshire_terrier_99.jpg \n",
"7305 None NaN oxford-iiit-pet/images/yorkshire_terrier_56.jpg \n",
"7306 None NaN oxford-iiit-pet/images/yorkshire_terrier_97.jpg \n",
"7307 None NaN oxford-iiit-pet/images/yorkshire_terrier_58.jpg \n",
"7308 None NaN oxford-iiit-pet/images/yorkshire_terrier_6.jpg \n",
"\n",
" caption ann_index label \\\n",
"0 a cat standing on a wooden floor next to a glass 49.0 [cat] \n",
"1 a cat laying on a bed 11.0 [cat] \n",
"2 a cat yawning on a couch 1856.0 [cat] \n",
"3 a cat with green eyes is laying on a green bla... 2.0 [cat] \n",
"4 a cat is sitting on a couch 1857.0 [cat] \n",
"... ... ... ... \n",
"7304 a small dog standing on a sidewalk 7348.0 [dog] \n",
"7305 a small dog is standing in the grass 7301.0 [dog] \n",
"7306 a small dog is standing on a rock 7346.0 [dog] \n",
"7307 a small black and brown puppy is being held by... 7303.0 [dog] \n",
"7308 a small black and gray dog standing in the grass 7316.0 [dog] \n",
"\n",
" class_id vl_label vl_class_id \n",
"0 [1] None None \n",
"1 [1] None None \n",
"2 [1] None None \n",
"3 [1] None None \n",
"4 [1] None None \n",
"... ... ... ... \n",
"7304 [2] None None \n",
"7305 [2] None None \n",
"7306 [2] None None \n",
"7307 [2] None None \n",
"7308 [2] None None \n",
"\n",
"[7309 rows x 9 columns]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = pd.read_parquet('image_annotations.parquet')\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|