{"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 numpy as np \nimport pandas as pd ","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-03-26T15:11:34.934937Z","iopub.execute_input":"2023-03-26T15:11:34.935622Z","iopub.status.idle":"2023-03-26T15:11:34.941741Z","shell.execute_reply.started":"2023-03-26T15:11:34.935568Z","shell.execute_reply":"2023-03-26T15:11:34.940337Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pd.read_csv('/kaggle/input/asl-signs/train.csv')","metadata":{"execution":{"iopub.status.busy":"2023-03-26T15:11:34.944039Z","iopub.execute_input":"2023-03-26T15:11:34.944573Z","iopub.status.idle":"2023-03-26T15:11:35.091269Z","shell.execute_reply.started":"2023-03-26T15:11:34.944525Z","shell.execute_reply":"2023-03-26T15:11:35.089891Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def get_all_files(train_path):\n    df1=pd.read_csv(train_path)\n    for I,kdf in df1.groupby('participant_id'):\n#print (kdf)\n        All_Files = kdf['path']\n        for j in All_Files:\n            df=pd.read_parquet('/kaggle/input/asl-signs/'+j)\n            return df","metadata":{"execution":{"iopub.status.busy":"2023-03-26T15:11:35.092978Z","iopub.execute_input":"2023-03-26T15:11:35.093351Z","iopub.status.idle":"2023-03-26T15:11:35.100418Z","shell.execute_reply.started":"2023-03-26T15:11:35.093313Z","shell.execute_reply":"2023-03-26T15:11:35.098892Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def kaggle_dataset():\n    \n     \n    List_2D_frames=[]\n    gdf_all=get_all_files('/kaggle/input/asl-signs/train.csv')\n\n    for I,gdf in gdf_all.groupby('frame'):\n        NP_2Darray = np.zeros([256,256]) # empty array\n        Points=(gdf[gdf['type'].str.contains('hand')][['x','y']].values*255).astype(np.int16) # Get the X ,Y only related to hand\n        NP_2Darray[Points[:,0],Points[:,1]] = 1  #  Update points to 1 \n        List_2D_frames.append(NP_2Darray)\n\n        NP_Array_FramesX256x256=np.stack(List_2D_frames)\n        #return NP_Array_FramesX256x256\n        print(NP_Array_FramesX256x256.shape)\n        print(NP_Array_FramesX256x256)\nkaggle_dataset()\n            ","metadata":{"execution":{"iopub.status.busy":"2023-03-26T15:12:22.845813Z","iopub.execute_input":"2023-03-26T15:12:22.846896Z","iopub.status.idle":"2023-03-26T15:12:23.163851Z","shell.execute_reply.started":"2023-03-26T15:12:22.846846Z","shell.execute_reply":"2023-03-26T15:12:23.162549Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kaggle_dataset()","metadata":{"execution":{"iopub.status.busy":"2023-03-26T15:11:35.276805Z","iopub.execute_input":"2023-03-26T15:11:35.277144Z","iopub.status.idle":"2023-03-26T15:11:35.438517Z","shell.execute_reply.started":"2023-03-26T15:11:35.277112Z","shell.execute_reply":"2023-03-26T15:11:35.437306Z"},"trusted":true},"execution_count":null,"outputs":[]}]}