{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":71549,"databundleVersionId":8561470,"sourceType":"competition"},{"sourceId":8449746,"sourceType":"datasetVersion","datasetId":5035395},{"sourceId":8459214,"sourceType":"datasetVersion","datasetId":5042245}],"dockerImageVersionId":30698,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import glob\nimport pandas as pd\nimport matplotlib.image as mpimg\nimport matplotlib.pyplot as plt \nimport pydicom\nimport pandas as pd\nimport shutil\nfrom IPython.display import FileLink\nimport re\nimport numpy as np\nimport gc\nimport os\nimport zipfile\n%matplotlib inline","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-05-22T16:51:10.007264Z","iopub.execute_input":"2024-05-22T16:51:10.008175Z","iopub.status.idle":"2024-05-22T16:51:10.018088Z","shell.execute_reply.started":"2024-05-22T16:51:10.008130Z","shell.execute_reply":"2024-05-22T16:51:10.016676Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Problem Statement**\nIn this compeition , we face the challenge of dealing with labels, output variable, and a large number of images that are stored in separate files. The images are significantly more than the labels, and we need a way to efficiently match the labels and output variables with the corresponding images.\n\n**Objective**\nThis notebook provides a solution for aligning labels, images, and output variables into a cohesive dataset. To achieve this, we have created a comprehensive data file named complete_train.csv. This file  contains:\n\n* Label coordinates\n* Corresponding image file paths\n* Output variable\n\n**Benefits**\nHaving this consolidated data file will streamline further processing and analysis, making it easier to work with the dataset in subsequent stages of the project. This approach ensures that all necessary information is available in a single, organized format.\n\n**Additionally**\nWe have saved the filtered images in the 'filtered_images' folder within the output directory. Now the  users will have a consolidated training file and the corresponding images, significantly reducing the effort and time typically required to create these files.","metadata":{}},{"cell_type":"code","source":"# Reading the figure\nfigure = mpimg.imread('/kaggle/input/rsna-data-info3/RSNA_data_info2.jpeg')\n# figure size and resultion \nplt.figure(figsize=(100, 100), dpi=150)  \n# Displaying the figure\nplt.imshow(figure)\n\n# Show the plot\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2024-05-22T15:55:33.101720Z","iopub.execute_input":"2024-05-22T15:55:33.102235Z","iopub.status.idle":"2024-05-22T15:55:42.632172Z","shell.execute_reply.started":"2024-05-22T15:55:33.102206Z","shell.execute_reply":"2024-05-22T15:55:42.630809Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"base_path='/kaggle/input/rsna-2024-lumbar-spine-degenerative-classification/'","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:51:35.627559Z","iopub.execute_input":"2024-05-22T16:51:35.627940Z","iopub.status.idle":"2024-05-22T16:51:35.633492Z","shell.execute_reply.started":"2024-05-22T16:51:35.627895Z","shell.execute_reply":"2024-05-22T16:51:35.632208Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#loading images\ntrain_images = glob.glob(base_path + 'train_images/*/*/*.dcm')","metadata":{"execution":{"iopub.status.busy":"2024-05-22T15:57:26.951785Z","iopub.execute_input":"2024-05-22T15:57:26.952619Z","iopub.status.idle":"2024-05-22T15:58:33.065269Z","shell.execute_reply.started":"2024-05-22T15:57:26.952580Z","shell.execute_reply":"2024-05-22T15:58:33.064141Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#finding total number of images\nprint(\"Total images: \", len(train_images))","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:51:38.941068Z","iopub.execute_input":"2024-05-22T16:51:38.941493Z","iopub.status.idle":"2024-05-22T16:51:38.947455Z","shell.execute_reply.started":"2024-05-22T16:51:38.941453Z","shell.execute_reply":"2024-05-22T16:51:38.946198Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#loading train label coordinates \ntrain_label_coord_df = pd.read_csv(base_path+'train_label_coordinates.csv')\ntrain_label_coord_df.shape","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:51:42.117826Z","iopub.execute_input":"2024-05-22T16:51:42.118254Z","iopub.status.idle":"2024-05-22T16:51:42.304720Z","shell.execute_reply.started":"2024-05-22T16:51:42.118215Z","shell.execute_reply":"2024-05-22T16:51:42.303649Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#loading train.csv\ntrain_df = pd.read_csv(base_path+'train.csv')\ntrain_df.shape","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:51:44.813650Z","iopub.execute_input":"2024-05-22T16:51:44.814132Z","iopub.status.idle":"2024-05-22T16:51:44.855785Z","shell.execute_reply.started":"2024-05-22T16:51:44.814099Z","shell.execute_reply":"2024-05-22T16:51:44.854568Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Creating new dataframe having output column**","metadata":{}},{"cell_type":"code","source":"# Creating the new column by concatenating values from columns entiteld 'conditions\n# and 'level'\ntrain_label_coord_df['new_col'] = train_label_coord_df['condition'].str.lower().str.replace(' ', '_') +  '_' + train_label_coord_df['level'].str.lower().str.replace('/', '_')\n\n# Getting target variable value from train.csv\ndef get_target_value(row):\n    study_id = row['study_id']\n    new_col = row['new_col']\n    return train_df[train_df['study_id'] == study_id][new_col].values[0]\n\ntrain_label_coord_df['output'] = train_label_coord_df.apply(get_target_value, axis=1)\n\n# Drop the 'new_col' column \ntrain_label_coord_df.drop(columns=['new_col'], inplace=True)\n\n# Copy the train_label_coord_df to new DataFrame\ntrain_train_label_marged_df = train_label_coord_df.copy()\n\n# Drop the 'new_col' column \ntrain_label_coord_df.drop(columns=['output'], inplace=True)\n\n\n#final_train_df.to_csv('final_train.csv')\ntrain_train_label_marged_df.head()","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:03:30.577531Z","iopub.execute_input":"2024-05-22T16:03:30.577948Z","iopub.status.idle":"2024-05-22T16:03:49.504553Z","shell.execute_reply.started":"2024-05-22T16:03:30.577891Z","shell.execute_reply":"2024-05-22T16:03:49.503431Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#confirming \ntrain_train_label_marged_df.shape\n","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:05:22.741820Z","iopub.execute_input":"2024-05-22T16:05:22.742210Z","iopub.status.idle":"2024-05-22T16:05:22.749676Z","shell.execute_reply.started":"2024-05-22T16:05:22.742182Z","shell.execute_reply":"2024-05-22T16:05:22.748458Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Adding file paths in train_train_label_marged_df dataframe**","metadata":{}},{"cell_type":"code","source":"# Adding the image_file_path column with none, afterwards it will filled actual image file paths \ntrain_train_label_marged_df['image_file_path'] = None\ntrain_train_label_marged_df.head()","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:05:25.669705Z","iopub.execute_input":"2024-05-22T16:05:25.670094Z","iopub.status.idle":"2024-05-22T16:05:25.686801Z","shell.execute_reply.started":"2024-05-22T16:05:25.670066Z","shell.execute_reply":"2024-05-22T16:05:25.685693Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Creating folder to put images as per train-label_coordiantes.csv**","metadata":{}},{"cell_type":"code","source":"output_dir = '/kaggle/working'\nfolder = 'filtered_images'\n\n# Creating path for the new folder\nfiltered_images_path = os.path.join(output_dir, folder)\n\n# Create the folder\nos.makedirs(filtered_images_path, exist_ok=True)\n\nprint(f\"Folder created at: {filtered_images_path}\")\n","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:05:31.545859Z","iopub.execute_input":"2024-05-22T16:05:31.546276Z","iopub.status.idle":"2024-05-22T16:05:31.553374Z","shell.execute_reply.started":"2024-05-22T16:05:31.546240Z","shell.execute_reply":"2024-05-22T16:05:31.552244Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Extract the last three numerical values from each file path of the train images\ndef extract_last_three_values(file_path):\n    # Split the path into parts\n    img_file_numbers = re.findall(r'\\d+', file_path)\n    # Extract the last three values before the file extension\n    last_3_values = img_file_numbers[-3:]\n    return last_3_values","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:05:34.584191Z","iopub.execute_input":"2024-05-22T16:05:34.584569Z","iopub.status.idle":"2024-05-22T16:05:34.591052Z","shell.execute_reply.started":"2024-05-22T16:05:34.584541Z","shell.execute_reply":"2024-05-22T16:05:34.589433Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"We separeted/ copied images as per train_label_coordinates but when tried to save this notebook along with the output files, it generated an error so we had to write functions to remove images and zip file containing the images - zip file can be used to downlaod the image. However you can run this notebook, create zip file and complete_train.csv. It will be done successfully. The problem was only with saving the notebook espcially with outputs. ","metadata":{}},{"cell_type":"code","source":"def remove_file_dir(path):\n    # Check if the path exists\n    if os.path.exists(path):\n        # Check if it's a file\n        if os.path.isfile(path):\n            os.remove(path)\n            print(f\"File '{path}' has been removed.\")\n        # Check if it's a directory\n        elif os.path.isdir(path):\n            shutil.rmtree(path)\n            print(f\"Directory '{path}' has been removed.\")\n    else:\n        print(f\"The path '{path}' does not exist.\")\n","metadata":{"execution":{"iopub.status.busy":"2024-05-22T17:01:24.464594Z","iopub.execute_input":"2024-05-22T17:01:24.465044Z","iopub.status.idle":"2024-05-22T17:01:24.472439Z","shell.execute_reply.started":"2024-05-22T17:01:24.465008Z","shell.execute_reply":"2024-05-22T17:01:24.471195Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#removing folder containing image files copied from train_images - optional-use \n#this option onley when you need. \nimages_folder='/kaggle/working/filtered_images'\nremove_file_dir(images_folder)\n","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#removing zipped file that was created to zip images for downloading - optional-use \n#this option onley when you need\nzip_file='/kaggle/working/filtered_images_zip.zip'\nremove_file_dir(zip_file)","metadata":{"execution":{"iopub.status.busy":"2024-05-22T17:01:27.578052Z","iopub.execute_input":"2024-05-22T17:01:27.578448Z","iopub.status.idle":"2024-05-22T17:01:28.232887Z","shell.execute_reply.started":"2024-05-22T17:01:27.578415Z","shell.execute_reply":"2024-05-22T17:01:28.231554Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# removing a folder - run this cell only if you want to remove the folder and create new one\nfolder_to_remove='/kaggle/working/filtered_images'\nif os.path.exists(folder_to_remove):\n    # Remove the folder and its contents\n    shutil.rmtree(folder_to_remove)\n    print(f\"Folder '{folder_to_remove}' removed successfully.\")","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:45:11.787105Z","iopub.execute_input":"2024-05-22T16:45:11.787479Z","iopub.status.idle":"2024-05-22T16:45:13.514978Z","shell.execute_reply.started":"2024-05-22T16:45:11.787451Z","shell.execute_reply":"2024-05-22T16:45:13.508788Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"counter=0\n\nvalues_found=0\n#/kaggle/working/\n\n# Convert columns to numpy arrays for faster operations\nstudy_ids = train_train_label_marged_df['study_id'].values\nseries_ids = train_train_label_marged_df['series_id'].values\ninstance_numbers = train_train_label_marged_df['instance_number'].values\n\n# Iterate over the train_images Series\nfor file_path in train_images:\n    last_3_values = extract_last_three_values(file_path)\n    study_id, series_id, instance_number = last_3_values\n    filtered_images_path = os.path.join(output_dir, folder)\n    # Debugging: print the values being compared\n    #print(f\"Comparing: study_id={study_id}, series_id={series_id}, instance_number={instance_number}\")\n    \n    # Create a mask using numpy\n    mask = (study_ids == int(study_id)) & (series_ids == int(series_id)) & (instance_numbers == int(instance_number))\n\n    # Check if the mask has any True values (i.e., if any rows match all three conditions)\n    if np.any(mask):\n        # Update the DataFrame using the mask\n        train_train_label_marged_df.loc[mask, 'image_file_path'] = study_id+'_'+series_id+'_'+instance_number+'.dcm'#file_path\n        # Coping the image file to the new folder\n        \n        # Define the destination file path\n        destination_file_path =os.path.join('/kaggle/working/filtered_images', study_id+'_'+series_id+'_'+instance_number+'.dcm')\n        \n        # Move the file to the destination directory with the new name\n        shutil.copy(file_path, destination_file_path)\n    \n    \n    #if counter == 2:\n     #   break\n    #counter+=1\n    \n# Renaming  \ncomplete_train_df = train_train_label_marged_df\n\n# Delete the original DataFrame reference\ndel train_train_label_marged_df\n#garbage collection\ngc.collect()\n\n#print('counter: ',counter)\n# Print the resulting DataFrame\ncomplete_train_df.head()\n\n\n","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:07:58.053404Z","iopub.execute_input":"2024-05-22T16:07:58.053821Z","iopub.status.idle":"2024-05-22T16:14:25.774805Z","shell.execute_reply.started":"2024-05-22T16:07:58.053789Z","shell.execute_reply":"2024-05-22T16:14:25.773540Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"complete_train_df.shape\nprint('--------------')\ncomplete_train_df.head()","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:14:45.425458Z","iopub.execute_input":"2024-05-22T16:14:45.425851Z","iopub.status.idle":"2024-05-22T16:14:45.442535Z","shell.execute_reply.started":"2024-05-22T16:14:45.425820Z","shell.execute_reply":"2024-05-22T16:14:45.441203Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Moving output column to the end of the dataframe**","metadata":{}},{"cell_type":"code","source":"# Get a list of columns\ncolumns = complete_train_df.columns.tolist()\n\n# Remove the column from the list and append it at the end\ncolumns.remove('output')\ncolumns.append('output')\n\n# Reorder the DataFrame columns\ncomplete_train_df = complete_train_df[columns]\n","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:14:50.635404Z","iopub.execute_input":"2024-05-22T16:14:50.635873Z","iopub.status.idle":"2024-05-22T16:14:50.649688Z","shell.execute_reply.started":"2024-05-22T16:14:50.635839Z","shell.execute_reply":"2024-05-22T16:14:50.648564Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#checking output column - moved to the end\ncomplete_train_df.head()","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:14:53.802347Z","iopub.execute_input":"2024-05-22T16:14:53.802774Z","iopub.status.idle":"2024-05-22T16:14:53.818831Z","shell.execute_reply.started":"2024-05-22T16:14:53.802744Z","shell.execute_reply":"2024-05-22T16:14:53.817652Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"\n\n","metadata":{}},{"cell_type":"code","source":"complete_train_df.to_csv('complete_train.csv',index=False)","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:14:56.386822Z","iopub.execute_input":"2024-05-22T16:14:56.387249Z","iopub.status.idle":"2024-05-22T16:14:56.954701Z","shell.execute_reply.started":"2024-05-22T16:14:56.387215Z","shell.execute_reply":"2024-05-22T16:14:56.953572Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Verifying the file is saved in the current working directory\nprint(os.listdir('/kaggle/working/'))","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:16:37.731305Z","iopub.execute_input":"2024-05-22T16:16:37.731733Z","iopub.status.idle":"2024-05-22T16:16:37.738255Z","shell.execute_reply.started":"2024-05-22T16:16:37.731695Z","shell.execute_reply":"2024-05-22T16:16:37.737057Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Working with and verifying the new created file**","metadata":{}},{"cell_type":"code","source":"complete_train_df=pd.read_csv('/kaggle/working/complete_train.csv')","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:16:43.803814Z","iopub.execute_input":"2024-05-22T16:16:43.804232Z","iopub.status.idle":"2024-05-22T16:16:43.937669Z","shell.execute_reply.started":"2024-05-22T16:16:43.804202Z","shell.execute_reply":"2024-05-22T16:16:43.936263Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"complete_train_df.head()","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:23:31.247169Z","iopub.execute_input":"2024-05-22T16:23:31.247600Z","iopub.status.idle":"2024-05-22T16:23:31.264388Z","shell.execute_reply.started":"2024-05-22T16:23:31.247566Z","shell.execute_reply":"2024-05-22T16:23:31.263187Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"complete_train_df.shape","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:23:35.292387Z","iopub.execute_input":"2024-05-22T16:23:35.292834Z","iopub.status.idle":"2024-05-22T16:23:35.300702Z","shell.execute_reply.started":"2024-05-22T16:23:35.292801Z","shell.execute_reply":"2024-05-22T16:23:35.299408Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"img_file_paths=complete_train_df['image_file_path'][:10]\n# Replace underscores with slashes and add base path \nimg_file_paths = '/kaggle/input/rsna-2024-lumbar-spine-degenerative-classification/train_images/' + img_file_paths.str.replace('_', '/')\nprint('img_file_path',type(img_file_paths))\n\nprint('img_file_path',img_file_paths.values) ","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:31:38.075110Z","iopub.execute_input":"2024-05-22T16:31:38.075589Z","iopub.status.idle":"2024-05-22T16:31:38.084967Z","shell.execute_reply.started":"2024-05-22T16:31:38.075552Z","shell.execute_reply":"2024-05-22T16:31:38.083484Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Verifying images are displaying correctl**y","metadata":{}},{"cell_type":"code","source":"fig=plt.figure(figsize=(15, 10))\ncolumns = 5; rows = 2\nfor i in range(1, columns*rows ):\n    ds = pydicom.dcmread(img_file_paths[i])#Original was dcmread(train_images_dir + train_images[i])\n    fig.add_subplot(rows, columns, i)\n    plt.imshow(ds.pixel_array, cmap=plt.cm.bone)\n    fig.add_subplot","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:31:41.049428Z","iopub.execute_input":"2024-05-22T16:31:41.049866Z","iopub.status.idle":"2024-05-22T16:31:43.171193Z","shell.execute_reply.started":"2024-05-22T16:31:41.049827Z","shell.execute_reply":"2024-05-22T16:31:43.169886Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Good. Now you don't need to read three files separately/ worry about the output variable etc. Only signle file has all required information to go with this compeition. Create new comptition notebook. Upload the 'complete_train.csv' and proceed for furhter processing. ","metadata":{}},{"cell_type":"markdown","source":"**Downloading filtered images**","metadata":{}},{"cell_type":"code","source":"#loading images\nfiltered_train_images = glob.glob('/kaggle/working/filtered_images/*.dcm')\nprint('filtered_train_images:\\n', len(filtered_train_images))","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:32:19.874124Z","iopub.execute_input":"2024-05-22T16:32:19.875333Z","iopub.status.idle":"2024-05-22T16:32:19.990292Z","shell.execute_reply.started":"2024-05-22T16:32:19.875277Z","shell.execute_reply":"2024-05-22T16:32:19.988899Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"output_dir = '/kaggle/working'\noutput_folder_zip = 'filtered_images_zip'\n\n# Creating path for the new folder\nfiltered_images_path = os.path.join(output_dir, output_folder_zip)\n\n# Create the folder\nos.makedirs(filtered_images_path, exist_ok=True)\n\nprint(f\"Folder created at: {filtered_images_path}\")","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:32:27.824695Z","iopub.execute_input":"2024-05-22T16:32:27.825121Z","iopub.status.idle":"2024-05-22T16:32:27.832227Z","shell.execute_reply.started":"2024-05-22T16:32:27.825089Z","shell.execute_reply":"2024-05-22T16:32:27.830980Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Zipping the images**","metadata":{}},{"cell_type":"code","source":"# Directory containing files to zip\ndir_src = '/kaggle/working/filtered_images/'\n\nshutil.make_archive(filtered_images_path, 'zip', dir_src)\n    \n   \n","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:32:35.710841Z","iopub.execute_input":"2024-05-22T16:32:35.711240Z","iopub.status.idle":"2024-05-22T16:39:15.931550Z","shell.execute_reply.started":"2024-05-22T16:32:35.711211Z","shell.execute_reply":"2024-05-22T16:39:15.930344Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from IPython.display import FileLink #/kaggle/working/filtered_images_zip.zip\nFileLink(r'filtered_images_zip.zip')","metadata":{"execution":{"iopub.status.busy":"2024-05-22T16:39:51.991675Z","iopub.execute_input":"2024-05-22T16:39:51.992073Z","iopub.status.idle":"2024-05-22T16:39:52.000430Z","shell.execute_reply.started":"2024-05-22T16:39:51.992042Z","shell.execute_reply":"2024-05-22T16:39:51.999193Z"},"trusted":true},"execution_count":null,"outputs":[]}]}