{"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":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-08-24T06:22:10.894717Z","iopub.execute_input":"2023-08-24T06:22:10.895223Z","iopub.status.idle":"2023-08-24T06:22:10.949027Z","shell.execute_reply.started":"2023-08-24T06:22:10.895169Z","shell.execute_reply":"2023-08-24T06:22:10.947381Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# For this competition first we need to install pip mediapipe\n\n## What is mediapipe?\nIt is a framework for building ML pipelines for processing time-series data like video, audio etc.","metadata":{}},{"cell_type":"code","source":"!pip install mediapipe","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:22:10.951462Z","iopub.execute_input":"2023-08-24T06:22:10.952507Z","iopub.status.idle":"2023-08-24T06:22:29.255192Z","shell.execute_reply.started":"2023-08-24T06:22:10.952421Z","shell.execute_reply":"2023-08-24T06:22:29.253765Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Importing necessary libraries","metadata":{}},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nfrom tensorflow import keras\nimport matplotlib.pyplot as plt","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:22:29.257189Z","iopub.execute_input":"2023-08-24T06:22:29.257736Z","iopub.status.idle":"2023-08-24T06:22:39.637776Z","shell.execute_reply.started":"2023-08-24T06:22:29.257684Z","shell.execute_reply":"2023-08-24T06:22:39.636475Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Load the dataset","metadata":{}},{"cell_type":"code","source":"dataset = pd.read_csv('/kaggle/input/asl-fingerspelling/supplemental_metadata.csv')\ndataset","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:22:39.641059Z","iopub.execute_input":"2023-08-24T06:22:39.641921Z","iopub.status.idle":"2023-08-24T06:22:39.825992Z","shell.execute_reply.started":"2023-08-24T06:22:39.641881Z","shell.execute_reply":"2023-08-24T06:22:39.824637Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_train = pd.read_csv('/kaggle/input/asl-fingerspelling/train.csv')\ndataset_train","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:25:43.254971Z","iopub.execute_input":"2023-08-24T06:25:43.255483Z","iopub.status.idle":"2023-08-24T06:25:43.427936Z","shell.execute_reply.started":"2023-08-24T06:25:43.255431Z","shell.execute_reply":"2023-08-24T06:25:43.42672Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset.head()","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:22:39.827848Z","iopub.execute_input":"2023-08-24T06:22:39.830591Z","iopub.status.idle":"2023-08-24T06:22:39.845079Z","shell.execute_reply.started":"2023-08-24T06:22:39.830518Z","shell.execute_reply":"2023-08-24T06:22:39.843614Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Check the stats of Dataset","metadata":{}},{"cell_type":"code","source":"dataset.describe()","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:22:39.84645Z","iopub.execute_input":"2023-08-24T06:22:39.846856Z","iopub.status.idle":"2023-08-24T06:22:39.891132Z","shell.execute_reply.started":"2023-08-24T06:22:39.846822Z","shell.execute_reply":"2023-08-24T06:22:39.889666Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset.info()","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:22:39.892691Z","iopub.execute_input":"2023-08-24T06:22:39.893039Z","iopub.status.idle":"2023-08-24T06:22:39.955182Z","shell.execute_reply.started":"2023-08-24T06:22:39.893009Z","shell.execute_reply":"2023-08-24T06:22:39.953791Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset.count()","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:22:39.95706Z","iopub.execute_input":"2023-08-24T06:22:39.957899Z","iopub.status.idle":"2023-08-24T06:22:40.005634Z","shell.execute_reply.started":"2023-08-24T06:22:39.957859Z","shell.execute_reply":"2023-08-24T06:22:40.003702Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sequence_id, file_id, phrase = dataset.iloc[66][['sequence_id', 'file_id', 'phrase']]\nprint(f\"sequence_id: {sequence_id}, file_id: {file_id}, phrase: {phrase}\")","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:25:56.251894Z","iopub.execute_input":"2023-08-24T06:25:56.252933Z","iopub.status.idle":"2023-08-24T06:25:56.261202Z","shell.execute_reply.started":"2023-08-24T06:25:56.252892Z","shell.execute_reply":"2023-08-24T06:25:56.259779Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pyarrow.parquet as pq\nsample_sequence_df = pq.read_table(f\"/kaggle/input/asl-fingerspelling/train_landmarks/{str(file_id)}.parquet\",\n    filters=[[('sequence_id', '=', sequence_id)],]).to_pandas()\nprint(\"Full sequence dataset shape is {}\".format(sample_sequence_df.shape))","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:25:58.36179Z","iopub.execute_input":"2023-08-24T06:25:58.362221Z","iopub.status.idle":"2023-08-24T06:25:58.519731Z","shell.execute_reply.started":"2023-08-24T06:25:58.362188Z","shell.execute_reply":"2023-08-24T06:25:58.517982Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from tensorflow.keras.applications.inception_v3 import InceptionV3","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:22:40.02316Z","iopub.execute_input":"2023-08-24T06:22:40.023838Z","iopub.status.idle":"2023-08-24T06:22:40.033821Z","shell.execute_reply.started":"2023-08-24T06:22:40.023795Z","shell.execute_reply":"2023-08-24T06:22:40.032586Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from tensorflow.keras import layers","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:22:40.035297Z","iopub.execute_input":"2023-08-24T06:22:40.035707Z","iopub.status.idle":"2023-08-24T06:22:40.047409Z","shell.execute_reply.started":"2023-08-24T06:22:40.035652Z","shell.execute_reply":"2023-08-24T06:22:40.046224Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pre_trained_model = InceptionV3(input_shape = (150,150,3),\n                                include_top = False,\n                                weights = None)","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:22:40.049514Z","iopub.execute_input":"2023-08-24T06:22:40.05006Z","iopub.status.idle":"2023-08-24T06:22:43.162416Z","shell.execute_reply.started":"2023-08-24T06:22:40.049995Z","shell.execute_reply":"2023-08-24T06:22:43.160847Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pre_trained_model.summary()","metadata":{"execution":{"iopub.status.busy":"2023-08-24T06:22:43.164206Z","iopub.execute_input":"2023-08-24T06:22:43.165238Z","iopub.status.idle":"2023-08-24T06:22:44.027152Z","shell.execute_reply.started":"2023-08-24T06:22:43.165198Z","shell.execute_reply":"2023-08-24T06:22:44.025778Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}