{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Imports/Setup","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n#%matplotlib widget  # comment out for notebook visualization\nimport time\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib.animation import FuncAnimation\nimport plotly.express as px","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:47.772356Z","iopub.execute_input":"2023-03-09T20:34:47.772764Z","iopub.status.idle":"2023-03-09T20:34:50.180525Z","shell.execute_reply.started":"2023-03-09T20:34:47.772729Z","shell.execute_reply":"2023-03-09T20:34:50.179373Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path_train = '/kaggle/input/asl-signs/train.csv'","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-03-09T20:34:50.182429Z","iopub.execute_input":"2023-03-09T20:34:50.182812Z","iopub.status.idle":"2023-03-09T20:34:50.188091Z","shell.execute_reply.started":"2023-03-09T20:34:50.182776Z","shell.execute_reply":"2023-03-09T20:34:50.186651Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dftr = pd.read_csv(path_train)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.189814Z","iopub.execute_input":"2023-03-09T20:34:50.190795Z","iopub.status.idle":"2023-03-09T20:34:50.398939Z","shell.execute_reply.started":"2023-03-09T20:34:50.190753Z","shell.execute_reply":"2023-03-09T20:34:50.397906Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"We select the first associated landmark files to get a feel for how the data is.","metadata":{}},{"cell_type":"markdown","source":"# Basic EDA","metadata":{}},{"cell_type":"code","source":"dftr","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.401076Z","iopub.execute_input":"2023-03-09T20:34:50.401397Z","iopub.status.idle":"2023-03-09T20:34:50.435090Z","shell.execute_reply.started":"2023-03-09T20:34:50.401367Z","shell.execute_reply":"2023-03-09T20:34:50.434132Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"example_landmark = pd.read_parquet('/kaggle/input/asl-signs/train_landmark_files/26734/1000035562.parquet')","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.436304Z","iopub.execute_input":"2023-03-09T20:34:50.436596Z","iopub.status.idle":"2023-03-09T20:34:50.575335Z","shell.execute_reply.started":"2023-03-09T20:34:50.436567Z","shell.execute_reply":"2023-03-09T20:34:50.574456Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"example_landmark","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.576403Z","iopub.execute_input":"2023-03-09T20:34:50.576751Z","iopub.status.idle":"2023-03-09T20:34:50.597485Z","shell.execute_reply.started":"2023-03-09T20:34:50.576703Z","shell.execute_reply":"2023-03-09T20:34:50.595392Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"example_landmark['frame'].min()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.600490Z","iopub.execute_input":"2023-03-09T20:34:50.601093Z","iopub.status.idle":"2023-03-09T20:34:50.620630Z","shell.execute_reply.started":"2023-03-09T20:34:50.601040Z","shell.execute_reply":"2023-03-09T20:34:50.619518Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"example_landmark['frame'].max()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.623954Z","iopub.execute_input":"2023-03-09T20:34:50.624455Z","iopub.status.idle":"2023-03-09T20:34:50.633915Z","shell.execute_reply.started":"2023-03-09T20:34:50.624398Z","shell.execute_reply":"2023-03-09T20:34:50.632556Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"example_landmark['frame'].max() - example_landmark['frame'].min()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.637549Z","iopub.execute_input":"2023-03-09T20:34:50.637920Z","iopub.status.idle":"2023-03-09T20:34:50.645702Z","shell.execute_reply.started":"2023-03-09T20:34:50.637886Z","shell.execute_reply":"2023-03-09T20:34:50.644344Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"This will give us a count of what information each frame has. ","metadata":{}},{"cell_type":"code","source":"minn = example_landmark['frame'].min()\nmaxx = example_landmark['frame'].max()\n\nfor i in range(minn, maxx+1):\n    print('Frame: ' + str(i))\n    t = example_landmark[example_landmark['frame'] == i]\n    print('   Face: ' + str(t[t['type'] == 'face']['x'].isnull().sum()))\n    print('   Pose: ' + str(t[t['type'] == 'pose']['x'].isnull().sum()))\n    print('   RH: ' + str(t[t['type'] == 'right_hand']['x'].isnull().sum()))\n    print('   LH: ' + str(t[t['type'] == 'left_hand']['x'].isnull().sum()))","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.651775Z","iopub.execute_input":"2023-03-09T20:34:50.652270Z","iopub.status.idle":"2023-03-09T20:34:50.746435Z","shell.execute_reply.started":"2023-03-09T20:34:50.652218Z","shell.execute_reply":"2023-03-09T20:34:50.745234Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"It looks like the left hand has no information.\nThe data later on should reveal that the pose will have the left hand out of screen.\nIt also looks like the right hand goes out of frame a bit.","metadata":{}},{"cell_type":"markdown","source":"# Single Frame - Single Instace 2D/3D Visualization","metadata":{}},{"cell_type":"code","source":"sgl_in = example_landmark[example_landmark['frame'] == 21]","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.748211Z","iopub.execute_input":"2023-03-09T20:34:50.748758Z","iopub.status.idle":"2023-03-09T20:34:50.754123Z","shell.execute_reply.started":"2023-03-09T20:34:50.748718Z","shell.execute_reply":"2023-03-09T20:34:50.753309Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sgl_in['type'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.755110Z","iopub.execute_input":"2023-03-09T20:34:50.755887Z","iopub.status.idle":"2023-03-09T20:34:50.769614Z","shell.execute_reply.started":"2023-03-09T20:34:50.755855Z","shell.execute_reply":"2023-03-09T20:34:50.768579Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sgl_in_rh = sgl_in[sgl_in['type'] == 'right_hand']","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.771222Z","iopub.execute_input":"2023-03-09T20:34:50.772254Z","iopub.status.idle":"2023-03-09T20:34:50.779702Z","shell.execute_reply.started":"2023-03-09T20:34:50.772221Z","shell.execute_reply":"2023-03-09T20:34:50.778762Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Right Hand Instance","metadata":{}},{"cell_type":"code","source":"sgl_in_rh","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.780858Z","iopub.execute_input":"2023-03-09T20:34:50.781143Z","iopub.status.idle":"2023-03-09T20:34:50.800846Z","shell.execute_reply.started":"2023-03-09T20:34:50.781114Z","shell.execute_reply":"2023-03-09T20:34:50.800031Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def add_init_c(start, end, hand):\n    return (\n        pd.concat([hand['x'][start:start+1], hand['x'][end[0]:end[1]]]), \n        pd.concat([hand['y'][start:start+1], hand['y'][end[0]:end[1]]]), \n        pd.concat([hand['z'][start:start+1], hand['z'][end[0]:end[1]]])\n        )","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.801890Z","iopub.execute_input":"2023-03-09T20:34:50.802804Z","iopub.status.idle":"2023-03-09T20:34:50.809994Z","shell.execute_reply.started":"2023-03-09T20:34:50.802770Z","shell.execute_reply":"2023-03-09T20:34:50.808611Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def plot_hand(hand, td):\n    fig, ax = plt.subplots()\n    fig.set_size_inches(6, 6)\n\n    if td:\n        ax = Axes3D(fig, auto_add_to_figure=False)\n        fig.add_axes(ax)\n\n    ind = [[0, [0, 5]], [0, [5, 9]], [0, [17, 21]], [5, [9, 13]], [17, [13, 17]], [9, [13, 14]]]\n\n    for i, k in ind: \n        x, y, z = add_init_c(i, k, hand)\n        if td:\n            ax.plot(x, -1*y, z)\n        else:\n            ax.plot(x, -1*y)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.811145Z","iopub.execute_input":"2023-03-09T20:34:50.812332Z","iopub.status.idle":"2023-03-09T20:34:50.821426Z","shell.execute_reply.started":"2023-03-09T20:34:50.812300Z","shell.execute_reply":"2023-03-09T20:34:50.820202Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_hand(sgl_in_rh, True)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:50.822785Z","iopub.execute_input":"2023-03-09T20:34:50.823086Z","iopub.status.idle":"2023-03-09T20:34:51.295558Z","shell.execute_reply.started":"2023-03-09T20:34:50.823057Z","shell.execute_reply":"2023-03-09T20:34:51.294269Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_hand(sgl_in_rh, False)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:51.297058Z","iopub.execute_input":"2023-03-09T20:34:51.297412Z","iopub.status.idle":"2023-03-09T20:34:51.500349Z","shell.execute_reply.started":"2023-03-09T20:34:51.297378Z","shell.execute_reply":"2023-03-09T20:34:51.499120Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Left Hand Instance\n\n> no data","metadata":{}},{"cell_type":"code","source":"sgl_in_lh = sgl_in[sgl_in['type'] == 'left_hand']","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:51.501767Z","iopub.execute_input":"2023-03-09T20:34:51.502174Z","iopub.status.idle":"2023-03-09T20:34:51.508365Z","shell.execute_reply.started":"2023-03-09T20:34:51.502141Z","shell.execute_reply":"2023-03-09T20:34:51.507039Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sgl_in_lh","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:51.509795Z","iopub.execute_input":"2023-03-09T20:34:51.510208Z","iopub.status.idle":"2023-03-09T20:34:51.532848Z","shell.execute_reply.started":"2023-03-09T20:34:51.510175Z","shell.execute_reply":"2023-03-09T20:34:51.531577Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_hand(sgl_in_lh, True)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:51.534250Z","iopub.execute_input":"2023-03-09T20:34:51.534554Z","iopub.status.idle":"2023-03-09T20:34:51.868489Z","shell.execute_reply.started":"2023-03-09T20:34:51.534526Z","shell.execute_reply":"2023-03-09T20:34:51.867279Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_hand(sgl_in_lh, False)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:51.870255Z","iopub.execute_input":"2023-03-09T20:34:51.870615Z","iopub.status.idle":"2023-03-09T20:34:52.093032Z","shell.execute_reply.started":"2023-03-09T20:34:51.870581Z","shell.execute_reply":"2023-03-09T20:34:52.091732Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### The Pose","metadata":{}},{"cell_type":"code","source":"sgl_in_p = sgl_in[sgl_in['type'] == 'pose']","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:52.095109Z","iopub.execute_input":"2023-03-09T20:34:52.095480Z","iopub.status.idle":"2023-03-09T20:34:52.102582Z","shell.execute_reply.started":"2023-03-09T20:34:52.095445Z","shell.execute_reply":"2023-03-09T20:34:52.101281Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sgl_in_p","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:52.104472Z","iopub.execute_input":"2023-03-09T20:34:52.105099Z","iopub.status.idle":"2023-03-09T20:34:52.125826Z","shell.execute_reply.started":"2023-03-09T20:34:52.105063Z","shell.execute_reply":"2023-03-09T20:34:52.124728Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def plot_pose(pose, td):\n    fig, ax = plt.subplots()\n    fig.set_size_inches(6, 6)\n\n    if td:\n        ax = Axes3D(fig, auto_add_to_figure=False)\n        fig.add_axes(ax)\n\n    ind = [[0, [1, 4]], [3, [7, 8]], [0, [4, 7]], [6, [8, 9]], [9, [10, 11]], [11, [12, 13]], [12, [14, 15]], [14, [16, 17]], \n           [16, [22, 23]], [16, [18, 19]], [16, [20, 21]], [18, [20, 21]], [11, [13, 14]], [13, [15, 16]], [15, [21, 22]], [15, [19, 20]],\n           [15, [17, 18]], [17, [19, 20]], [12, [24, 25]], [24, [26, 27]], [26, [28, 29]], [28, [30, 31]], [30, [32, 33]], [28, [32, 33]], \n           [11, [23, 24]], [23, [25, 26]], [25, [27, 28]], [27, [29, 30]], [29, [31, 32]], [27, [31, 32]], [23, [24, 25]]]\n\n    for i, k in ind: \n        x, y, z = add_init_c(i, k, pose)\n        if td:\n            ax.plot(x, -1*y, z)\n        else:\n            ax.plot(x, -1*y)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:52.127606Z","iopub.execute_input":"2023-03-09T20:34:52.128251Z","iopub.status.idle":"2023-03-09T20:34:52.141393Z","shell.execute_reply.started":"2023-03-09T20:34:52.128202Z","shell.execute_reply":"2023-03-09T20:34:52.140427Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_pose(sgl_in_p, True)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:52.143080Z","iopub.execute_input":"2023-03-09T20:34:52.143471Z","iopub.status.idle":"2023-03-09T20:34:52.693236Z","shell.execute_reply.started":"2023-03-09T20:34:52.143437Z","shell.execute_reply":"2023-03-09T20:34:52.692055Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_pose(sgl_in_p, False)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:52.694647Z","iopub.execute_input":"2023-03-09T20:34:52.695108Z","iopub.status.idle":"2023-03-09T20:34:52.997236Z","shell.execute_reply.started":"2023-03-09T20:34:52.695059Z","shell.execute_reply":"2023-03-09T20:34:52.996146Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### The Face","metadata":{}},{"cell_type":"code","source":"sgl_in_f = sgl_in[sgl_in['type'] == 'face']","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:53.004116Z","iopub.execute_input":"2023-03-09T20:34:53.004586Z","iopub.status.idle":"2023-03-09T20:34:53.010865Z","shell.execute_reply.started":"2023-03-09T20:34:53.004551Z","shell.execute_reply":"2023-03-09T20:34:53.009628Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sgl_in_f","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:53.012973Z","iopub.execute_input":"2023-03-09T20:34:53.014478Z","iopub.status.idle":"2023-03-09T20:34:53.035146Z","shell.execute_reply.started":"2023-03-09T20:34:53.014440Z","shell.execute_reply":"2023-03-09T20:34:53.033967Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"This one we won't turn into vectors like the others. Due to its mapping it wouldn't make sense.","metadata":{}},{"cell_type":"code","source":"def plot_face(face, td):\n    fig, ax = plt.subplots()\n    fig.set_size_inches(6, 6)\n\n    if td:\n        ax = Axes3D(fig, auto_add_to_figure=False)\n        fig.add_axes(ax)\n\n    if td:\n        ax.scatter(face['x'], -1*face['y'], face['z'])\n    else:\n        ax.scatter(face['x'], -1*face['y'])","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:53.036584Z","iopub.execute_input":"2023-03-09T20:34:53.037199Z","iopub.status.idle":"2023-03-09T20:34:53.044971Z","shell.execute_reply.started":"2023-03-09T20:34:53.037164Z","shell.execute_reply":"2023-03-09T20:34:53.043971Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_face(sgl_in_f, True)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:53.046352Z","iopub.execute_input":"2023-03-09T20:34:53.046856Z","iopub.status.idle":"2023-03-09T20:34:53.597625Z","shell.execute_reply.started":"2023-03-09T20:34:53.046812Z","shell.execute_reply":"2023-03-09T20:34:53.596472Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_face(sgl_in_f, False)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:53.599084Z","iopub.execute_input":"2023-03-09T20:34:53.599487Z","iopub.status.idle":"2023-03-09T20:34:53.838810Z","shell.execute_reply.started":"2023-03-09T20:34:53.599443Z","shell.execute_reply":"2023-03-09T20:34:53.837663Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def plot_mix(pose, face, rhand, lhand, td):\n    fig, ax = plt.subplots()\n    fig.set_size_inches(6, 6)\n\n    ind = [[11, [12, 13]], [12, [14, 15]], [14, [16, 17]], [11, [13, 14]], [13, [15, 16]], [12, [24, 25]], \n           [24, [26, 27]], [26, [28, 29]], [28, [30, 31]], [30, [32, 33]], [28, [32, 33]], [11, [23, 24]], [23, [25, 26]], [25, [27, 28]], \n           [27, [29, 30]], [29, [31, 32]], [27, [31, 32]], [23, [24, 25]]]\n\n    if td:\n        ax = Axes3D(fig, auto_add_to_figure=False)\n        fig.add_axes(ax)\n\n    for i, k in ind: \n        x, y, z = add_init_c(i, k, pose)\n        if td:\n            ax.plot(x, -1*y, z)\n        else:\n            ax.plot(x, -1*y)\n            \n    s = [1] * face['x'].shape[0]\n    if td:\n        ax.scatter(face['x'], -1*face['y'], face['z'], s=s)\n    else:\n        ax.scatter(face['x'], -1*face['y'], s=s)\n        \n    ind = [[0, [0, 5]], [0, [5, 9]], [0, [17, 21]], [5, [9, 13]], [17, [13, 17]], [9, [13, 14]]]\n    \n    for i, k in ind: \n        x, y, z = add_init_c(i, k, rhand)\n        if td:\n            ax.plot(x, -1*y, z)\n        else:\n            ax.plot(x, -1*y)\n    \n    for i, k in ind: \n        x, y, z = add_init_c(i, k, lhand)\n        if td:\n            ax.plot(x, -1*y, z)\n        else:\n            ax.plot(x, -1*y)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:53.840202Z","iopub.execute_input":"2023-03-09T20:34:53.840499Z","iopub.status.idle":"2023-03-09T20:34:53.856718Z","shell.execute_reply.started":"2023-03-09T20:34:53.840469Z","shell.execute_reply":"2023-03-09T20:34:53.855285Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The face and pose are calibrated for the z dimension but the hands aren't. They can likely be used to determine what the hand looks like in the z but not all together with the body.","metadata":{}},{"cell_type":"code","source":"plot_mix(sgl_in_p, sgl_in_f, sgl_in_rh, sgl_in_lh, True)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:53.858383Z","iopub.execute_input":"2023-03-09T20:34:53.858771Z","iopub.status.idle":"2023-03-09T20:34:54.441175Z","shell.execute_reply.started":"2023-03-09T20:34:53.858728Z","shell.execute_reply":"2023-03-09T20:34:54.439968Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_mix(sgl_in_p, sgl_in_f, sgl_in_rh, sgl_in_lh, False)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:54.442826Z","iopub.execute_input":"2023-03-09T20:34:54.443286Z","iopub.status.idle":"2023-03-09T20:34:54.756907Z","shell.execute_reply.started":"2023-03-09T20:34:54.443240Z","shell.execute_reply":"2023-03-09T20:34:54.755535Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Multi Frame - Single Instace 2D/3D Visualization","metadata":{}},{"cell_type":"code","source":"face_an = example_landmark[example_landmark['type'] == 'face']","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:54.758280Z","iopub.execute_input":"2023-03-09T20:34:54.758630Z","iopub.status.idle":"2023-03-09T20:34:54.766918Z","shell.execute_reply.started":"2023-03-09T20:34:54.758596Z","shell.execute_reply":"2023-03-09T20:34:54.765502Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = px.scatter_3d(face_an, x=\"x\", y=\"y\", z=\"z\", animation_frame=\"frame\", hover_name=\"row_id\", width=800, height=800)\nfig.update_traces(marker_size=3)\n\nfig.update_layout(\n    scene = dict(\n        xaxis = dict(visible=False),\n        yaxis = dict(visible=False),\n        zaxis =dict(visible=False)\n        )\n    )\n\ncamera_params = dict(\n    up=dict(x=0,y=0,z=0),\n    center=dict(x=0,y=0,z=0),\n    eye=dict(x=0,y=0,z=-2)\n)\n\nfig.update_layout(scene_camera=camera_params)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:54.768777Z","iopub.execute_input":"2023-03-09T20:34:54.769208Z","iopub.status.idle":"2023-03-09T20:34:56.550291Z","shell.execute_reply.started":"2023-03-09T20:34:54.769156Z","shell.execute_reply":"2023-03-09T20:34:56.549153Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"face_an['y'] = face_an['y'] * -1\n\nfig = px.scatter(face_an, x=\"x\", y=\"y\", animation_frame=\"frame\", hover_name=\"row_id\", width=800, height=800)\nfig.update_traces(marker_size=3)\n\nfig.update_layout(\n    scene = dict(\n        xaxis = dict(visible=False),\n        yaxis = dict(visible=False),\n        )\n    )\n\nfig.update_xaxes(\n    range=(face_an['x'].min(), face_an['x'].max()),\n    constrain='domain'\n)\n\nfig.update_yaxes(\n    range=(face_an['y'].min(), face_an['y'].max()),\n    constrain='domain'\n)\n\ncamera_params = dict(\n    up=dict(x=0,y=0),\n    center=dict(x=0,y=0),\n    eye=dict(x=0,y=0)\n)\n\nfig.update_layout(scene_camera=camera_params)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:56.551688Z","iopub.execute_input":"2023-03-09T20:34:56.552435Z","iopub.status.idle":"2023-03-09T20:34:56.824842Z","shell.execute_reply.started":"2023-03-09T20:34:56.552398Z","shell.execute_reply":"2023-03-09T20:34:56.823687Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pose_place_ind = [0, 1, 1, 1, 2, 2, 2, 1, 2, 3, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9] * 23","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:56.826726Z","iopub.execute_input":"2023-03-09T20:34:56.827314Z","iopub.status.idle":"2023-03-09T20:34:56.832138Z","shell.execute_reply.started":"2023-03-09T20:34:56.827279Z","shell.execute_reply":"2023-03-09T20:34:56.831312Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pose_an = example_landmark[example_landmark['type'] == 'pose']\npose_an['pose_place'] = pose_place_ind","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:56.833352Z","iopub.execute_input":"2023-03-09T20:34:56.834348Z","iopub.status.idle":"2023-03-09T20:34:56.850214Z","shell.execute_reply.started":"2023-03-09T20:34:56.834312Z","shell.execute_reply":"2023-03-09T20:34:56.848959Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = px.line_3d(pose_an, x=\"x\", y=\"y\", z=\"z\", animation_frame=\"frame\", hover_name=\"row_id\", color=\"pose_place\", width=800, height=800)\nfig.update_traces(marker_size=3)\n\nfig.update_layout(\n    scene = dict(\n        xaxis = dict(visible=False),\n        yaxis = dict(visible=False),\n        zaxis =dict(visible=False)\n        )\n    )\n\ncamera_params = dict(\n    up=dict(x=0,y=0,z=0),\n    center=dict(x=0,y=0,z=0),\n    eye=dict(x=0,y=0,z=-2)\n)\n\nfig.update_layout(scene_camera=camera_params)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:56.852257Z","iopub.execute_input":"2023-03-09T20:34:56.852886Z","iopub.status.idle":"2023-03-09T20:34:57.999533Z","shell.execute_reply.started":"2023-03-09T20:34:56.852851Z","shell.execute_reply":"2023-03-09T20:34:57.998416Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pose_an['y'] = pose_an['y'] * -1\n\nfig = px.line(pose_an, x=\"x\", y=\"y\", animation_frame=\"frame\", hover_name=\"row_id\", color=\"pose_place\", width=800, height=800)\nfig.update_traces(marker_size=3)\n\nfig.update_layout(\n    scene = dict(\n        xaxis = dict(visible=False),\n        yaxis = dict(visible=False),\n        )\n    )\n\nfig.update_xaxes(\n    range=(pose_an['x'].min(), pose_an['x'].max()),\n    constrain='domain'\n)\n\nfig.update_yaxes(\n    range=(pose_an['y'].min(), pose_an['y'].max()),\n    constrain='domain'\n)\n\ncamera_params = dict(\n    up=dict(x=0,y=0),\n    center=dict(x=0,y=0),\n    eye=dict(x=0,y=0)\n)\n\nfig.update_layout(scene_camera=camera_params)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:58.001562Z","iopub.execute_input":"2023-03-09T20:34:58.002027Z","iopub.status.idle":"2023-03-09T20:34:59.048364Z","shell.execute_reply.started":"2023-03-09T20:34:58.001980Z","shell.execute_reply":"2023-03-09T20:34:59.047258Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"hand_place = []\n\ndef create_hand(row):\n    lnd = row['landmark_index']\n    if lnd < 5:\n        hand_place.append(1)\n    elif 5 <= lnd < 9:\n        hand_place.append(2)\n    elif 9 <= lnd < 13:\n        hand_place.append(3)\n    elif 13 <= lnd < 17:\n        hand_place.append(4)\n    else:\n        hand_place.append(5)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:59.050074Z","iopub.execute_input":"2023-03-09T20:34:59.050606Z","iopub.status.idle":"2023-03-09T20:34:59.058861Z","shell.execute_reply.started":"2023-03-09T20:34:59.050559Z","shell.execute_reply":"2023-03-09T20:34:59.057484Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"rh_an = example_landmark[example_landmark['type'] == 'right_hand']\nrh_an.apply(create_hand, axis=1)\nrh_an['hand_place'] = hand_place","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:59.060577Z","iopub.execute_input":"2023-03-09T20:34:59.061122Z","iopub.status.idle":"2023-03-09T20:34:59.083089Z","shell.execute_reply.started":"2023-03-09T20:34:59.061074Z","shell.execute_reply":"2023-03-09T20:34:59.081805Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = px.line_3d(rh_an, x=\"x\", y=\"y\", z='z', animation_frame=\"frame\", hover_name=\"row_id\", color=\"hand_place\", width=800, height=800)\nfig.update_traces(marker_size=3)\n\nfig.update_layout(\n    scene = dict(\n        xaxis = dict(visible=False),\n        yaxis = dict(visible=False),\n        zaxis =dict(visible=False)\n        )\n    )\n\ncamera_params = dict(\n    up=dict(x=0,y=0,z=0),\n    center=dict(x=0,y=0,z=0),\n    eye=dict(x=0,y=0,z=-2)\n)\n\nfig.update_layout(scene_camera=camera_params)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:59.084285Z","iopub.execute_input":"2023-03-09T20:34:59.084598Z","iopub.status.idle":"2023-03-09T20:34:59.627430Z","shell.execute_reply.started":"2023-03-09T20:34:59.084568Z","shell.execute_reply":"2023-03-09T20:34:59.626385Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"rh_an['y'] = rh_an['y'] * -1\n\nfig = px.line(rh_an, x=\"x\", y=\"y\", animation_frame=\"frame\", hover_name=\"row_id\", color=\"hand_place\", width=800, height=800)\nfig.update_traces(marker_size=3)\n\nfig.update_layout(\n    scene = dict(\n        xaxis = dict(visible=False),\n        yaxis = dict(visible=False),\n        )\n    )\n\nfig.update_xaxes(\n    range=(rh_an['x'].min(), rh_an['x'].max()),\n    constrain='domain'\n)\n\nfig.update_yaxes(\n    range=(rh_an['y'].min(), rh_an['y'].max()),\n    constrain='domain'\n)\n\ncamera_params = dict(\n    up=dict(x=0,y=0),\n    center=dict(x=0,y=0),\n    eye=dict(x=0,y=0)\n)\n\nfig.update_layout(scene_camera=camera_params)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:34:59.629431Z","iopub.execute_input":"2023-03-09T20:34:59.629878Z","iopub.status.idle":"2023-03-09T20:35:00.189937Z","shell.execute_reply.started":"2023-03-09T20:34:59.629834Z","shell.execute_reply":"2023-03-09T20:35:00.188835Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"> #### It becomes visable that frames are lost through the course of the frames.","metadata":{}},{"cell_type":"markdown","source":"# Distribution EDA","metadata":{}},{"cell_type":"code","source":"dftr","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:35:00.191288Z","iopub.execute_input":"2023-03-09T20:35:00.191583Z","iopub.status.idle":"2023-03-09T20:35:00.207251Z","shell.execute_reply.started":"2023-03-09T20:35:00.191555Z","shell.execute_reply":"2023-03-09T20:35:00.206043Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dftr['sign'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:35:00.209173Z","iopub.execute_input":"2023-03-09T20:35:00.209757Z","iopub.status.idle":"2023-03-09T20:35:00.225906Z","shell.execute_reply.started":"2023-03-09T20:35:00.209690Z","shell.execute_reply":"2023-03-09T20:35:00.224886Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dftr['sign'].describe()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:35:00.227488Z","iopub.execute_input":"2023-03-09T20:35:00.227830Z","iopub.status.idle":"2023-03-09T20:35:00.246508Z","shell.execute_reply.started":"2023-03-09T20:35:00.227800Z","shell.execute_reply":"2023-03-09T20:35:00.245264Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dftr['sign'].value_counts().describe()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:35:00.248010Z","iopub.execute_input":"2023-03-09T20:35:00.248363Z","iopub.status.idle":"2023-03-09T20:35:00.267290Z","shell.execute_reply.started":"2023-03-09T20:35:00.248328Z","shell.execute_reply":"2023-03-09T20:35:00.265905Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"min_frames = []\nmax_frames = []\nlen_frames = []\nmissing_frames_face = {}\nmissing_frames_pose = {}\nmissing_frames_rh = {}\nmissing_frames_lh = {}","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:35:00.270033Z","iopub.execute_input":"2023-03-09T20:35:00.270489Z","iopub.status.idle":"2023-03-09T20:35:00.278299Z","shell.execute_reply.started":"2023-03-09T20:35:00.270442Z","shell.execute_reply":"2023-03-09T20:35:00.275937Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def access_missing_dict(missing, part, i, minn, t):\n    try:\n        missing[i - minn].append(t[t['type'] == part]['x'].isnull().sum())\n    except:\n        missing[i - minn] = [t[t['type'] == part]['x'].isnull().sum()]","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:35:00.279667Z","iopub.execute_input":"2023-03-09T20:35:00.280105Z","iopub.status.idle":"2023-03-09T20:35:00.291919Z","shell.execute_reply.started":"2023-03-09T20:35:00.280061Z","shell.execute_reply":"2023-03-09T20:35:00.290728Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def get_parq_data(row):\n    lnd = pd.read_parquet('/kaggle/input/asl-signs/' + row['path'])\n    fs = lnd['frame']\n    minn = fs.min()\n    maxx = fs.max()\n    min_frames.append(minn)\n    max_frames.append(maxx)\n    len_frames.append(maxx - minn)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:35:00.293559Z","iopub.execute_input":"2023-03-09T20:35:00.294054Z","iopub.status.idle":"2023-03-09T20:35:00.304009Z","shell.execute_reply.started":"2023-03-09T20:35:00.294007Z","shell.execute_reply":"2023-03-09T20:35:00.302391Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def get_parq_missing_data(row):\n    lnd = pd.read_parquet('/kaggle/input/asl-signs/' + row['path'])\n    fs = lnd['frame']\n    minn = fs.min()\n    maxx = fs.max()\n    \n    for i in range(minn, maxx+1):\n        t = lnd[lnd['frame'] == i]\n        access_missing_dict(missing_frames_face, 'face', i, minn, t)\n        access_missing_dict(missing_frames_pose, 'pose', i, minn, t)\n        access_missing_dict(missing_frames_rh, 'right_hand', i, minn, t)\n        access_missing_dict(missing_frames_lh, 'left_hand', i, minn, t)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:35:00.305699Z","iopub.execute_input":"2023-03-09T20:35:00.307298Z","iopub.status.idle":"2023-03-09T20:35:00.317935Z","shell.execute_reply.started":"2023-03-09T20:35:00.307216Z","shell.execute_reply":"2023-03-09T20:35:00.316838Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def run_parq_d():\n    print(\"Getting Frame Data\")\n    \n    dftr.apply(get_parq_data, axis=1)\n    \n    pd.DataFrame(min_frames).to_csv(\"/kaggle/working/min_frames.csv\")\n    pd.DataFrame(max_frames).to_csv(\"/kaggle/working/max_frames.csv\")\n    pd.DataFrame(len_frames).to_csv(\"/kaggle/working/len_frames.csv\")\n\n#run_parq_d()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:35:00.320736Z","iopub.execute_input":"2023-03-09T20:35:00.321259Z","iopub.status.idle":"2023-03-09T20:35:00.329468Z","shell.execute_reply.started":"2023-03-09T20:35:00.321210Z","shell.execute_reply":"2023-03-09T20:35:00.328202Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def even_dicts(missing_frames):\n    maxx = 0\n    for i in missing_frames:\n        if len(missing_frames[i]) > maxx:\n            maxx = len(missing_frames[i])\n    for k, i in missing_frames.items():\n        if len(i) < maxx:\n            missing_frames[k] = i + [float('nan') for x in range(len(i), maxx)]","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:35:00.331069Z","iopub.execute_input":"2023-03-09T20:35:00.331768Z","iopub.status.idle":"2023-03-09T20:35:00.341383Z","shell.execute_reply.started":"2023-03-09T20:35:00.331725Z","shell.execute_reply":"2023-03-09T20:35:00.340154Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def run_parq_missing_d():\n    print(\"Getting Missing Frame Data\")\n    dftr.apply(get_parq_missing_data, axis=1)\n    \n    even_dicts(missing_frames_face)\n    even_dicts(missing_frames_pose)\n    even_dicts(missing_frames_rh)\n    even_dicts(missing_frames_lh)\n    \n    pd.DataFrame(missing_frames_face).to_csv(\"/kaggle/working/missing_frames_face.csv\")\n    pd.DataFrame(missing_frames_pose).to_csv(\"/kaggle/working/missing_frames_pose.csv\")\n    pd.DataFrame(missing_frames_rh).to_csv(\"/kaggle/working/missing_frames_rh.csv\")\n    pd.DataFrame(missing_frames_lh).to_csv(\"/kaggle/working/missing_frames_lh.csv\")\n    \n#run_parq_missing_d()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:35:00.342965Z","iopub.execute_input":"2023-03-09T20:35:00.344137Z","iopub.status.idle":"2023-03-09T20:35:00.352531Z","shell.execute_reply.started":"2023-03-09T20:35:00.344092Z","shell.execute_reply":"2023-03-09T20:35:00.351377Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lenf = pd.read_csv('/kaggle/input/gasl-frame-data/len_frames.csv', index_col=0, names=['frames']).iloc[1:, :]\nmaxf = pd.read_csv('/kaggle/input/gasl-frame-data/max_frames.csv', index_col=0, names=['frames']).iloc[1:, :]\nminf = pd.read_csv('/kaggle/input/gasl-frame-data/min_frames.csv', index_col=0, names=['frames']).iloc[1:, :]\nmff = pd.read_csv('/kaggle/input/gasl-frame-data/missing_frames_face.csv', index_col=0)\nmfp = pd.read_csv('/kaggle/input/gasl-frame-data/missing_frames_pose.csv', index_col=0)\nmfrh = pd.read_csv('/kaggle/input/gasl-frame-data/missing_frames_rh.csv', index_col=0)\nmflh = pd.read_csv('/kaggle/input/gasl-frame-data/missing_frames_lh.csv', index_col=0)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:43:36.424812Z","iopub.execute_input":"2023-03-09T20:43:36.425242Z","iopub.status.idle":"2023-03-09T20:43:48.683676Z","shell.execute_reply.started":"2023-03-09T20:43:36.425204Z","shell.execute_reply":"2023-03-09T20:43:48.682616Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lenf.describe()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T21:01:27.297965Z","iopub.execute_input":"2023-03-09T21:01:27.299203Z","iopub.status.idle":"2023-03-09T21:01:27.322181Z","shell.execute_reply.started":"2023-03-09T21:01:27.299142Z","shell.execute_reply":"2023-03-09T21:01:27.321119Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"(lenf > 400).sum()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T21:06:18.732840Z","iopub.execute_input":"2023-03-09T21:06:18.733524Z","iopub.status.idle":"2023-03-09T21:06:18.742694Z","shell.execute_reply.started":"2023-03-09T21:06:18.733486Z","shell.execute_reply":"2023-03-09T21:06:18.741798Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"minf.describe()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T21:02:12.578375Z","iopub.execute_input":"2023-03-09T21:02:12.578902Z","iopub.status.idle":"2023-03-09T21:02:12.606753Z","shell.execute_reply.started":"2023-03-09T21:02:12.578850Z","shell.execute_reply":"2023-03-09T21:02:12.605492Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"maxf.describe()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T21:02:00.201500Z","iopub.execute_input":"2023-03-09T21:02:00.201921Z","iopub.status.idle":"2023-03-09T21:02:00.225787Z","shell.execute_reply.started":"2023-03-09T21:02:00.201883Z","shell.execute_reply":"2023-03-09T21:02:00.224597Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def get_missing_frame_counts(col):\n    return col.sum()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:49:20.820772Z","iopub.execute_input":"2023-03-09T20:49:20.821139Z","iopub.status.idle":"2023-03-09T20:49:20.826819Z","shell.execute_reply.started":"2023-03-09T20:49:20.821108Z","shell.execute_reply":"2023-03-09T20:49:20.825540Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mff_bar = mff.apply(get_missing_frame_counts) / 468 \n\ns = sns.barplot(x=mff_bar.index, y=mff_bar.values)\n\ns.set(xticklabels=[])\ns.tick_params(bottom=False)\nplt.yscale('log')","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:55:36.283598Z","iopub.execute_input":"2023-03-09T20:55:36.284580Z","iopub.status.idle":"2023-03-09T20:55:41.696345Z","shell.execute_reply.started":"2023-03-09T20:55:36.284541Z","shell.execute_reply":"2023-03-09T20:55:41.695170Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfp_bar = mfp.apply(get_missing_frame_counts) / 33 \n\ns = sns.barplot(x=mfp_bar.index, y=mfp_bar.values)\n\ns.set(xticklabels=[])\ns.tick_params(bottom=False)","metadata":{"execution":{"iopub.status.busy":"2023-03-09T20:58:18.749795Z","iopub.execute_input":"2023-03-09T20:58:18.750878Z","iopub.status.idle":"2023-03-09T20:58:23.393375Z","shell.execute_reply.started":"2023-03-09T20:58:18.750833Z","shell.execute_reply":"2023-03-09T20:58:23.392145Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfrh_bar = mfrh.apply(get_missing_frame_counts) / 21 \n\ns = sns.barplot(x=mfrh_bar.index, y=mfrh_bar.values)\n\ns.set(xticklabels=[])\ns.tick_params(bottom=False)\nplt.yscale('log')","metadata":{"execution":{"iopub.status.busy":"2023-03-09T21:00:05.320628Z","iopub.execute_input":"2023-03-09T21:00:05.321062Z","iopub.status.idle":"2023-03-09T21:00:10.742732Z","shell.execute_reply.started":"2023-03-09T21:00:05.321024Z","shell.execute_reply":"2023-03-09T21:00:10.741656Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mflh_bar = mflh.apply(get_missing_frame_counts) / 21 \n\ns = sns.barplot(x=mflh_bar.index, y=mflh_bar.values)\n\ns.set(xticklabels=[])\ns.tick_params(bottom=False)\nplt.yscale('log')","metadata":{"execution":{"iopub.status.busy":"2023-03-09T21:16:50.947790Z","iopub.execute_input":"2023-03-09T21:16:50.948874Z","iopub.status.idle":"2023-03-09T21:16:56.743553Z","shell.execute_reply.started":"2023-03-09T21:16:50.948832Z","shell.execute_reply":"2023-03-09T21:16:56.742395Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def get_frame_counts(col):\n    return col.notnull().sum()","metadata":{"execution":{"iopub.status.busy":"2023-03-09T21:14:21.722996Z","iopub.execute_input":"2023-03-09T21:14:21.723649Z","iopub.status.idle":"2023-03-09T21:14:21.728847Z","shell.execute_reply.started":"2023-03-09T21:14:21.723611Z","shell.execute_reply":"2023-03-09T21:14:21.727581Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mfp_c_bar = mfp.apply(get_frame_counts)","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"s = sns.barplot(x=mfp_c_bar.index, y=mfp_c_bar.values)\n\ns.set(xticklabels=[])\ns.tick_params(bottom=False)\nplt.yscale('log')","metadata":{"execution":{"iopub.status.busy":"2023-03-09T21:17:31.004369Z","iopub.execute_input":"2023-03-09T21:17:31.004952Z","iopub.status.idle":"2023-03-09T21:17:36.698352Z","shell.execute_reply.started":"2023-03-09T21:17:31.004901Z","shell.execute_reply":"2023-03-09T21:17:36.697459Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"It looks like the missing hands are roughly proportional to the amount of instances. ","metadata":{}},{"cell_type":"code","source":"s = sns.barplot(x=mfp_c_bar.index, y=mflh_bar.values/mfp_c_bar.values)\n\ns.set(xticklabels=[])\ns.tick_params(bottom=False)\ns.set_title('Missing Left Hand Frames : Frames')","metadata":{"execution":{"iopub.status.busy":"2023-03-09T21:20:34.525107Z","iopub.execute_input":"2023-03-09T21:20:34.525924Z","iopub.status.idle":"2023-03-09T21:20:38.572545Z","shell.execute_reply.started":"2023-03-09T21:20:34.525879Z","shell.execute_reply":"2023-03-09T21:20:38.571145Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"s = sns.barplot(x=mfp_c_bar.index, y=mfrh_bar.values/mfp_c_bar.values)\n\ns.set(xticklabels=[])\ns.tick_params(bottom=False)\ns.set_title('Missing Right Hand Frames : Frames')","metadata":{"execution":{"iopub.status.busy":"2023-03-09T21:21:43.672374Z","iopub.execute_input":"2023-03-09T21:21:43.673172Z","iopub.status.idle":"2023-03-09T21:21:48.110365Z","shell.execute_reply.started":"2023-03-09T21:21:43.673131Z","shell.execute_reply":"2023-03-09T21:21:48.109086Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Right Hand tends to be more likely visible early on while the left hand tends to be more visible towards the end.\n\nIt almost looks like the beginning parts of the right and left hand frame proportions could fit in one another.","metadata":{}},{"cell_type":"code","source":"s = sns.barplot(x=mfp_c_bar.index, y=mff_bar.values/mfp_c_bar.values)\n\ns.set(xticklabels=[])\ns.tick_params(bottom=False)\ns.set_title('Missing Face Frames : Frames')","metadata":{"execution":{"iopub.status.busy":"2023-03-09T21:26:31.097761Z","iopub.execute_input":"2023-03-09T21:26:31.098147Z","iopub.status.idle":"2023-03-09T21:26:35.420881Z","shell.execute_reply.started":"2023-03-09T21:26:31.098111Z","shell.execute_reply":"2023-03-09T21:26:35.419651Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}