{"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":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt","metadata":{"execution":{"iopub.status.busy":"2023-03-10T20:01:48.577807Z","iopub.execute_input":"2023-03-10T20:01:48.578321Z","iopub.status.idle":"2023-03-10T20:01:48.584758Z","shell.execute_reply.started":"2023-03-10T20:01:48.578277Z","shell.execute_reply":"2023-03-10T20:01:48.583114Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_parquet(\"/kaggle/input/asl-signs/train_landmark_files/16069/100015657.parquet\")\ndf.head()","metadata":{"execution":{"iopub.status.busy":"2023-03-10T20:02:52.842886Z","iopub.execute_input":"2023-03-10T20:02:52.84324Z","iopub.status.idle":"2023-03-10T20:02:52.88565Z","shell.execute_reply.started":"2023-03-10T20:02:52.843207Z","shell.execute_reply":"2023-03-10T20:02:52.884156Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv('/kaggle/input/asl-signs/train.csv')\ntrain","metadata":{"execution":{"iopub.status.busy":"2023-03-10T21:02:13.286198Z","iopub.execute_input":"2023-03-10T21:02:13.28667Z","iopub.status.idle":"2023-03-10T21:02:13.509085Z","shell.execute_reply.started":"2023-03-10T21:02:13.286627Z","shell.execute_reply":"2023-03-10T21:02:13.507706Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.dropna().frame.unique()","metadata":{"execution":{"iopub.status.busy":"2023-03-10T20:32:06.131153Z","iopub.execute_input":"2023-03-10T20:32:06.131628Z","iopub.status.idle":"2023-03-10T20:32:06.153423Z","shell.execute_reply.started":"2023-03-10T20:32:06.131586Z","shell.execute_reply":"2023-03-10T20:32:06.151775Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[(df.type == 'left_hand') & (df.frame == 203)].dropna()","metadata":{"execution":{"iopub.status.busy":"2023-03-10T20:31:53.666816Z","iopub.execute_input":"2023-03-10T20:31:53.667275Z","iopub.status.idle":"2023-03-10T20:31:53.68647Z","shell.execute_reply.started":"2023-03-10T20:31:53.667235Z","shell.execute_reply":"2023-03-10T20:31:53.685437Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"labels = pd.read_json('/kaggle/input/asl-signs/sign_to_prediction_index_map.json', orient='index')\nlabels","metadata":{"execution":{"iopub.status.busy":"2023-03-10T20:50:55.910706Z","iopub.execute_input":"2023-03-10T20:50:55.911134Z","iopub.status.idle":"2023-03-10T20:50:55.928708Z","shell.execute_reply.started":"2023-03-10T20:50:55.911098Z","shell.execute_reply":"2023-03-10T20:50:55.927509Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"temp = df[(df.type == 'face') & (df.frame == 201)].dropna()[['x', 'y', 'z']].values.T\nfig = plt.figure()\nax = fig.add_subplot(111, projection='3d')\nax.view_init(15, 90)\ni = 0\nfor _ in range(5):\n    ax.plot(temp[0][i:i+4], temp[1][i:i+4], temp[2][i:i+4], marker='o')\n    i += 4\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-03-10T20:32:37.11664Z","iopub.execute_input":"2023-03-10T20:32:37.117107Z","iopub.status.idle":"2023-03-10T20:32:37.370077Z","shell.execute_reply.started":"2023-03-10T20:32:37.117068Z","shell.execute_reply":"2023-03-10T20:32:37.369003Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for i in range(105, 120):\n    face = df[(df.type == 'face') & (df.frame == i)].dropna()[['x', 'y', 'z']].values.T\n    lhand = df[(df.type == 'left_hand') & (df.frame == i)].dropna()[['x', 'y', 'z']].values.T\n    rhand = df[(df.type == 'right_hand') & (df.frame == i)].dropna()[['x', 'y', 'z']].values.T\n\n    fig = plt.figure()\n    ax = fig.add_subplot(111, projection='3d')\n    ax.view_init(elev=15, azim=90)\n\n    ax.scatter(face[0], face[1], face[2], marker='o', color = 'black')\n    ax.plot(lhand[0][0:4]-0.5, lhand[1][0:4]-0.5, lhand[2][0:4], marker='o', color = 'orange')\n    ax.plot(lhand[0][5:8]-0.5, lhand[1][5:8]-0.5, lhand[2][5:8], marker='o', color = 'orange')\n    ax.plot(lhand[0][9:12]-0.5, lhand[1][9:12]-0.5, lhand[2][9:12], marker='o', color = 'orange')\n    ax.plot(lhand[0][13:16]-0.5, lhand[1][13:16]-0.5, lhand[2][13:16], marker='o', color = 'orange')\n    ax.plot(lhand[0][17:20]-0.5, lhand[1][17:20]-0.5, lhand[2][17:20], marker='o', color = 'orange')\n\n    #ax.plot(rhand[0]-0.5, rhand[1]-0.5, rhand[2], marker='o', color = 'blue')\n    break","metadata":{"execution":{"iopub.status.busy":"2023-03-10T20:58:38.906037Z","iopub.execute_input":"2023-03-10T20:58:38.906612Z","iopub.status.idle":"2023-03-10T20:58:39.9746Z","shell.execute_reply.started":"2023-03-10T20:58:38.906566Z","shell.execute_reply":"2023-03-10T20:58:39.973328Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"adf.type.unique()","metadata":{"execution":{"iopub.status.busy":"2023-03-10T20:02:36.778778Z","iopub.execute_input":"2023-03-10T20:02:36.779716Z","iopub.status.idle":"2023-03-10T20:02:36.793279Z","shell.execute_reply.started":"2023-03-10T20:02:36.779665Z","shell.execute_reply":"2023-03-10T20:02:36.792011Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lhand.shape","metadata":{"execution":{"iopub.status.busy":"2023-03-10T20:57:07.979513Z","iopub.execute_input":"2023-03-10T20:57:07.979959Z","iopub.status.idle":"2023-03-10T20:57:07.986924Z","shell.execute_reply.started":"2023-03-10T20:57:07.979922Z","shell.execute_reply":"2023-03-10T20:57:07.985964Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\n# Beispiel-Koordinaten für die Hand-Knöchel\nx = lhand[0]\ny = lhand[1]\nz = lhand[2]\n\n# Koordinaten für die Finger\nfinger1 = np.array([0, 1, 2, 3, 4])\nfinger2 = np.array([0, 6, 7, 8, 9, 10])\nfinger3 = np.array([0, 11, 12, 13, 14, 15])\nfinger4 = np.array([0, 16, 17, 18, 19, 20])\n\n# Erstellen der 3D-Figur und der Achsen\nfig = plt.figure()\nax = fig.add_subplot(111, projection='3d')\n\n# Plotten der Koordinaten\nax.scatter(x, y, z)\n\n# Plotten der Linien für jeden Finger\nax.plot([x[i] for i in finger1], [y[i] for i in finger1], [z[i] for i in finger1])\nax.plot([x[i] for i in finger2], [y[i] for i in finger2], [z[i] for i in finger2])\nax.plot([x[i] for i in finger3], [y[i] for i in finger3], [z[i] for i in finger3])\nax.plot([x[i] for i in finger4], [y[i] for i in finger4], [z[i] for i in finger4])\n\n# Beschriftung der Achsen\nax.set_xlabel('X-Achse')\nax.set_ylabel('Y-Achse')\nax.set_zlabel('Z-Achse')\n\nax.view_init(elev=90, azim=45)\n","metadata":{"execution":{"iopub.status.busy":"2023-03-10T20:57:58.110438Z","iopub.execute_input":"2023-03-10T20:57:58.110848Z","iopub.status.idle":"2023-03-10T20:57:58.343256Z","shell.execute_reply.started":"2023-03-10T20:57:58.110813Z","shell.execute_reply":"2023-03-10T20:57:58.342259Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"Masterplan:\n    - Wochenstunden ~ 4 h\n    - Jeden Freitag Abend: Ab 8 Uhr\n\nFürs nächste Mal:\n    - Umgebung aufsetzen: Daten ziehen\n        - lubru: jupyter\n        - jome: visual\n            \n    - Git-Repo aufsetzen\n        - lubru\n\n    - Daten angucken:\n        - videoclip von geberde\n    \n    - Wie machen wir aus Zeitreihe statische Daten\n        - Transformation überlegen\n        \n    - ","metadata":{"execution":{"iopub.status.busy":"2023-03-10T21:22:02.007407Z","iopub.execute_input":"2023-03-10T21:22:02.007879Z","iopub.status.idle":"2023-03-10T21:22:02.017137Z","shell.execute_reply.started":"2023-03-10T21:22:02.007842Z","shell.execute_reply":"2023-03-10T21:22:02.014894Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}