{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":61446,"databundleVersionId":6962461,"sourceType":"competition"}],"dockerImageVersionId":30587,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"## <span style=\"border-bottom: 2px solid blue; padding-bottom: 5px; color:blue\">Imports</span>\n","metadata":{}},{"cell_type":"code","source":"import cv2\nimport pandas as pd\nimport numpy as np\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nimport os\n\nDATASET_PATH = \"/kaggle/input/blood-vessel-segmentation/\"\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-12-03T16:32:53.007353Z","iopub.execute_input":"2023-12-03T16:32:53.007734Z","iopub.status.idle":"2023-12-03T16:32:53.013262Z","shell.execute_reply.started":"2023-12-03T16:32:53.007706Z","shell.execute_reply":"2023-12-03T16:32:53.012103Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## <span style=\"border-bottom: 2px solid blue; padding-bottom: 5px; color:blue\">Visualize dataset image with colorbar</span>","metadata":{}},{"cell_type":"code","source":"subfolder = \"train/kidney_1_dense/\"\n\nimages = os.listdir(DATASET_PATH + subfolder + \"images/\")\n\nimage = np.array(Image.open(DATASET_PATH + subfolder + \"images/\" + images[1000]))\nim = plt.imshow(image, cmap = \"gray\")\nplt.colorbar(im)","metadata":{"execution":{"iopub.status.busy":"2023-12-03T16:33:34.470538Z","iopub.execute_input":"2023-12-03T16:33:34.470921Z","iopub.status.idle":"2023-12-03T16:33:35.021839Z","shell.execute_reply.started":"2023-12-03T16:33:34.470893Z","shell.execute_reply":"2023-12-03T16:33:35.020640Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## <span style=\"border-bottom: 2px solid blue; padding-bottom: 5px; color:blue\">Visualizes image-label pair</span>\n\n\n","metadata":{}},{"cell_type":"code","source":"subfolder = \"train/kidney_1_dense/\"\n\nfiles = os.listdir(DATASET_PATH + subfolder + \"images/\")\nlabels = os.listdir(DATASET_PATH + subfolder + \"labels/\")\n\nimage = np.array(Image.open(DATASET_PATH + subfolder + \"images/\" + files[1000]))\n\nlabel = np.array(Image.open(DATASET_PATH + subfolder + \"labels/\" + labels[1000]))\n\nplt.figure(figsize=(10,10))\n\nax1 = plt.subplot(1,2,1)\nax1.imshow(image, cmap=\"gray\")\n\nax2 = plt.subplot(1,2,2)\nax2.imshow(label, cmap=\"gray\")","metadata":{"execution":{"iopub.status.busy":"2023-12-03T16:35:03.486291Z","iopub.execute_input":"2023-12-03T16:35:03.486692Z","iopub.status.idle":"2023-12-03T16:35:04.610136Z","shell.execute_reply.started":"2023-12-03T16:35:03.486662Z","shell.execute_reply":"2023-12-03T16:35:04.608866Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}