{ "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": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
col_xrow_ywidthheightconfidencelabelsourcecaptionfilename
0459.097.029.034.00.888human faceVLa man with a white shirt and a black tieoxford-iiit-pet/images/Abyssinian_149.jpg
1431.0115.031.041.00.864human faceVLa woman with a blonde hair and a white shirtoxford-iiit-pet/images/Abyssinian_149.jpg
2160.076.063.079.00.377human faceVLa close up of a cat's faceoxford-iiit-pet/images/Abyssinian_149.jpg
3446.085.0173.0203.00.379human faceVLa brown cat with green eyesoxford-iiit-pet/images/Abyssinian_24.jpg
4-0.0223.0163.0277.00.822human faceVLa man wearing a hatoxford-iiit-pet/images/Abyssinian_94.jpg
..............................
143230.066.0320.0262.00.924dogVLa small dog standing on a rock near a streamoxford-iiit-pet/images/yorkshire_terrier_97.jpg
14324156.0366.0179.0134.00.693logVLa bird sitting on a rock next to a streamoxford-iiit-pet/images/yorkshire_terrier_97.jpg
143252.00.0396.0374.00.938dogVLa small black and brown puppy is being held by...oxford-iiit-pet/images/yorkshire_terrier_58.jpg
143260.0224.0230.0151.00.310personVLa small brown dog is being held by a personoxford-iiit-pet/images/yorkshire_terrier_58.jpg
14327137.079.0216.0152.00.974dogVLa small black and gray dog standing in the grassoxford-iiit-pet/images/yorkshire_terrier_6.jpg
\n", "

14328 rows × 9 columns

\n", "
" ], "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": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
col_xrow_ywidthheightconfidencelabelfilename
0459.097.029.034.00.888human faceoxford-iiit-pet/images/Abyssinian_149.jpg
1431.0115.031.041.00.864human faceoxford-iiit-pet/images/Abyssinian_149.jpg
2160.076.063.079.00.377human faceoxford-iiit-pet/images/Abyssinian_149.jpg
3446.085.0173.0203.00.379human faceoxford-iiit-pet/images/Abyssinian_24.jpg
4-0.0223.0163.0277.00.822human faceoxford-iiit-pet/images/Abyssinian_94.jpg
........................
143230.066.0320.0262.00.924dogoxford-iiit-pet/images/yorkshire_terrier_97.jpg
14324156.0366.0179.0134.00.693logoxford-iiit-pet/images/yorkshire_terrier_97.jpg
143252.00.0396.0374.00.938dogoxford-iiit-pet/images/yorkshire_terrier_58.jpg
143260.0224.0230.0151.00.310personoxford-iiit-pet/images/yorkshire_terrier_58.jpg
14327137.079.0216.0152.00.974dogoxford-iiit-pet/images/yorkshire_terrier_6.jpg
\n", "

14328 rows × 7 columns

\n", "
" ], "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": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
x_top_lefty_top_leftwidthheightconfidencelabelfilename
0459.097.029.034.00.888human faceoxford-iiit-pet/images/Abyssinian_149.jpg
1431.0115.031.041.00.864human faceoxford-iiit-pet/images/Abyssinian_149.jpg
2160.076.063.079.00.377human faceoxford-iiit-pet/images/Abyssinian_149.jpg
3446.085.0173.0203.00.379human faceoxford-iiit-pet/images/Abyssinian_24.jpg
4-0.0223.0163.0277.00.822human faceoxford-iiit-pet/images/Abyssinian_94.jpg
........................
143230.066.0320.0262.00.924dogoxford-iiit-pet/images/yorkshire_terrier_97.jpg
14324156.0366.0179.0134.00.693logoxford-iiit-pet/images/yorkshire_terrier_97.jpg
143252.00.0396.0374.00.938dogoxford-iiit-pet/images/yorkshire_terrier_58.jpg
143260.0224.0230.0151.00.310personoxford-iiit-pet/images/yorkshire_terrier_58.jpg
14327137.079.0216.0152.00.974dogoxford-iiit-pet/images/yorkshire_terrier_6.jpg
\n", "

14328 rows × 7 columns

\n", "
" ], "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": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
videoframe_timestampfilenamecaptionann_indexlabelclass_idvl_labelvl_class_id
0NoneNaNoxford-iiit-pet/images/Abyssinian_144.jpga cat standing on a wooden floor next to a glass49.0[cat][1]NoneNone
1NoneNaNoxford-iiit-pet/images/Abyssinian_10.jpga cat laying on a bed11.0[cat][1]NoneNone
2NoneNaNoxford-iiit-pet/images/Abyssinian_155.jpga cat yawning on a couch1856.0[cat][1]NoneNone
3NoneNaNoxford-iiit-pet/images/Abyssinian_101.jpga cat with green eyes is laying on a green bla...2.0[cat][1]NoneNone
4NoneNaNoxford-iiit-pet/images/Abyssinian_156.jpga cat is sitting on a couch1857.0[cat][1]NoneNone
..............................
7304NoneNaNoxford-iiit-pet/images/yorkshire_terrier_99.jpga small dog standing on a sidewalk7348.0[dog][2]NoneNone
7305NoneNaNoxford-iiit-pet/images/yorkshire_terrier_56.jpga small dog is standing in the grass7301.0[dog][2]NoneNone
7306NoneNaNoxford-iiit-pet/images/yorkshire_terrier_97.jpga small dog is standing on a rock7346.0[dog][2]NoneNone
7307NoneNaNoxford-iiit-pet/images/yorkshire_terrier_58.jpga small black and brown puppy is being held by...7303.0[dog][2]NoneNone
7308NoneNaNoxford-iiit-pet/images/yorkshire_terrier_6.jpga small black and gray dog standing in the grass7316.0[dog][2]NoneNone
\n", "

7309 rows × 9 columns

\n", "
" ], "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 }