{"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":"markdown","source":"<div style=\"background: #f6ff47; \n            font-size: 20px; \n            padding: 10px; \n            border: 1px solid lightgray; \n            margin: 10px;\n            color:#020024;\n            text-align:center;\n            border-radius: 30px;\">\n  This is not the Main Notebook. Please check out <img src=\"https://media.giphy.com/media/WUlplcMpOCEmTGBtBW/giphy.gif\" width=\"30\">\n    <br>\n    <a  href=\"https://www.kaggle.com/soumya9977/attention-based-residual-unet-eda-on-cell-imgs\">Attention based Residual Unet + EDA on cell imgs🧬</a> \n</div>","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:43.768663Z","iopub.execute_input":"2021-11-04T12:05:43.769705Z","iopub.status.idle":"2021-11-04T12:05:44.010436Z","shell.execute_reply.started":"2021-11-04T12:05:43.769541Z","shell.execute_reply":"2021-11-04T12:05:44.009484Z"}}},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport cv2\nimport os\nfrom tqdm import tqdm_notebook as tqdm\nplt.style.use('fivethirtyeight')\n%matplotlib inline","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_img = \"../input/sartorius-cell-instance-segmentation/train\"\ntrain_csv = \"../input/sartorius-cell-instance-segmentation/train.csv\"\n\ndf = pd.read_csv(train_csv)\ndf.head()","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:44.01212Z","iopub.execute_input":"2021-11-04T12:05:44.012403Z","iopub.status.idle":"2021-11-04T12:05:44.752069Z","shell.execute_reply.started":"2021-11-04T12:05:44.012372Z","shell.execute_reply":"2021-11-04T12:05:44.751231Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"np.unique(df[\"id\"])","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:44.753466Z","iopub.execute_input":"2021-11-04T12:05:44.753723Z","iopub.status.idle":"2021-11-04T12:05:44.837252Z","shell.execute_reply.started":"2021-11-04T12:05:44.753684Z","shell.execute_reply":"2021-11-04T12:05:44.836568Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[\"annotation\"][0]","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:44.838518Z","iopub.execute_input":"2021-11-04T12:05:44.838857Z","iopub.status.idle":"2021-11-04T12:05:44.844964Z","shell.execute_reply.started":"2021-11-04T12:05:44.838828Z","shell.execute_reply":"2021-11-04T12:05:44.844024Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[\"cell_type\"].value_counts()","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:44.847293Z","iopub.execute_input":"2021-11-04T12:05:44.847517Z","iopub.status.idle":"2021-11-04T12:05:44.873787Z","shell.execute_reply.started":"2021-11-04T12:05:44.847492Z","shell.execute_reply":"2021-11-04T12:05:44.873141Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"labels = df[df[\"id\"] == \"0030fd0e6378\"][\"annotation\"].tolist()\nlabels","metadata":{"_kg_hide-output":false,"execution":{"iopub.status.busy":"2021-11-04T12:05:44.874883Z","iopub.execute_input":"2021-11-04T12:05:44.875564Z","iopub.status.idle":"2021-11-04T12:05:44.915619Z","shell.execute_reply.started":"2021-11-04T12:05:44.875525Z","shell.execute_reply":"2021-11-04T12:05:44.913132Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[df[\"id\"] == \"0030fd0e6378\"][\"cell_type\"].value_counts()","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:44.917033Z","iopub.execute_input":"2021-11-04T12:05:44.917754Z","iopub.status.idle":"2021-11-04T12:05:44.943094Z","shell.execute_reply.started":"2021-11-04T12:05:44.917704Z","shell.execute_reply":"2021-11-04T12:05:44.942316Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(np.unique(df[\"id\"])) # this shows that there are only 606 unique images","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:44.944639Z","iopub.execute_input":"2021-11-04T12:05:44.945121Z","iopub.status.idle":"2021-11-04T12:05:45.024483Z","shell.execute_reply.started":"2021-11-04T12:05:44.945079Z","shell.execute_reply":"2021-11-04T12:05:45.023484Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(df[\"id\"])","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:45.025982Z","iopub.execute_input":"2021-11-04T12:05:45.026384Z","iopub.status.idle":"2021-11-04T12:05:45.033556Z","shell.execute_reply.started":"2021-11-04T12:05:45.026338Z","shell.execute_reply":"2021-11-04T12:05:45.032637Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"s = labels[0].split()\nprint(len(s))\ns","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:45.035088Z","iopub.execute_input":"2021-11-04T12:05:45.03608Z","iopub.status.idle":"2021-11-04T12:05:45.051921Z","shell.execute_reply.started":"2021-11-04T12:05:45.036033Z","shell.execute_reply":"2021-11-04T12:05:45.0511Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"starts, lengths = [np.asarray(x, dtype=int) for x in (s[0:][::2], s[1:][::2])]\nlengths","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:45.053493Z","iopub.execute_input":"2021-11-04T12:05:45.054379Z","iopub.status.idle":"2021-11-04T12:05:45.065528Z","shell.execute_reply.started":"2021-11-04T12:05:45.054328Z","shell.execute_reply":"2021-11-04T12:05:45.064631Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"shape = (520, 704,3)\nimg = np.zeros((shape[0]* shape[1],shape[2]), dtype=np.float32)","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:45.066621Z","iopub.execute_input":"2021-11-04T12:05:45.06697Z","iopub.status.idle":"2021-11-04T12:05:45.077189Z","shell.execute_reply.started":"2021-11-04T12:05:45.066941Z","shell.execute_reply":"2021-11-04T12:05:45.075485Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"starts -= 1\nends = starts + lengths\nfor lo, hi in zip(starts, ends):\n        img[lo : hi] = 1.0","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:45.07904Z","iopub.execute_input":"2021-11-04T12:05:45.079394Z","iopub.status.idle":"2021-11-04T12:05:45.091024Z","shell.execute_reply.started":"2021-11-04T12:05:45.07935Z","shell.execute_reply":"2021-11-04T12:05:45.090044Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(starts)\nprint(ends)","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:45.09422Z","iopub.execute_input":"2021-11-04T12:05:45.094676Z","iopub.status.idle":"2021-11-04T12:05:45.105024Z","shell.execute_reply.started":"2021-11-04T12:05:45.094639Z","shell.execute_reply":"2021-11-04T12:05:45.104427Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.imshow(img.reshape(shape))","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:45.106027Z","iopub.execute_input":"2021-11-04T12:05:45.106396Z","iopub.status.idle":"2021-11-04T12:05:45.507362Z","shell.execute_reply.started":"2021-11-04T12:05:45.106346Z","shell.execute_reply":"2021-11-04T12:05:45.50633Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"np.unique(img)","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:45.508551Z","iopub.execute_input":"2021-11-04T12:05:45.508768Z","iopub.status.idle":"2021-11-04T12:05:45.543883Z","shell.execute_reply.started":"2021-11-04T12:05:45.508741Z","shell.execute_reply":"2021-11-04T12:05:45.543025Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def rle_decode(mask_rle, shape, color=1):\n    '''\n    mask_rle: run-length as string formated (start length)\n    shape: (height,width) of array to return \n    Returns numpy array, 1 - mask, 0 - background\n\n    '''\n    s = mask_rle.split()\n    starts, lengths = [np.asarray(x, dtype=int) for x in (s[0:][::2], s[1:][::2])]\n    starts -= 1\n    ends = starts + lengths\n    img = np.zeros((shape[0] * shape[1], shape[2]), dtype=np.float32)\n    for lo, hi in zip(starts, ends):\n        img[lo : hi] = color\n    return img.reshape(shape)\n    \n\n\n\ndef build_masks(image_id,input_shape, colors=True):\n    height, width = input_shape\n    labels = df[df[\"id\"] == image_id][\"annotation\"].tolist()\n    if colors:\n        mask = np.zeros((height, width, 3))\n        for label in labels:\n            mask += rle_decode(label, shape=(height,width , 3), color=np.random.rand(3))\n    else:\n        mask = np.zeros((height, width, 1))\n        for label in labels:\n            mask += rle_decode(label, shape=(height, width, 1))\n    mask = mask.clip(0, 1)\n    return mask\n    ","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:45.545209Z","iopub.execute_input":"2021-11-04T12:05:45.545677Z","iopub.status.idle":"2021-11-04T12:05:45.556826Z","shell.execute_reply.started":"2021-11-04T12:05:45.545643Z","shell.execute_reply":"2021-11-04T12:05:45.556212Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_filename = '115fad550598'\nsample_image_df = df[df['id'] == sample_filename]\nsample_path = f\"../input/sartorius-cell-instance-segmentation/train/{sample_image_df['id'].iloc[0]}.png\"\nsample_img = plt.imread(sample_path)\nsample_rles = sample_image_df['annotation'].values\n\nCOLOR_MAP = 'seismic'\nsample_masks1=build_masks(sample_filename,input_shape=(520, 704), colors=False)\nsample_masks2=build_masks(sample_filename,input_shape=(520, 704), colors=True)\n\n# sample_filename1 = '172334437c88'\n# sample_image_df1 = df[df['id'] == sample_filename1]\n# sample_path1 = f\"../input/sartorius-cell-instance-segmentation/train/{sample_image_df1['id'].iloc[0]}.png\"\n# sample_img1 = plt.imread(sample_path1)\n# sample_rles1 = sample_image_df1['annotation'].values\n\n# COLOR_MAP = 'seismic'\n# sample_masks3=build_masks(sample_filename1,input_shape=(520, 704), colors=False)\n# sample_masks4=build_masks(sample_filename1,input_shape=(520, 704), colors=True)\n\n\n\n\n\n\nfig, axs = plt.subplots(1,3, figsize=(18, 18))\naxs[0].imshow(sample_img,cmap = 'seismic')\naxs[0].set_title('original image', fontsize=16)\n\n\naxs[1].imshow(sample_masks1,cmap='gray')\naxs[1].set_title('mask image', fontsize=16)\n\n\naxs[2].imshow(sample_masks2)\naxs[2].set_title('mask with color', fontsize=16)\n\n# axs[3].imshow(sample_img1)\n# # axs[2].set_title('mask with color', fontsize=16)\n\n# axs[4].imshow(sample_masks3)\n\n# axs[5].imshow(sample_masks4)","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:45.557809Z","iopub.execute_input":"2021-11-04T12:05:45.558393Z","iopub.status.idle":"2021-11-04T12:05:47.174071Z","shell.execute_reply.started":"2021-11-04T12:05:45.558357Z","shell.execute_reply":"2021-11-04T12:05:47.173192Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_filename = '115fad550598'\nsample_image_df = df[df['id'] == sample_filename]\nsample_path = f\"../input/sartorius-cell-instance-segmentation/train/{sample_image_df['id'].iloc[0]}.png\"\nsample_img = plt.imread(sample_path)\n# sample_rles = sample_image_df['annotation'].values\n\nCOLOR_MAP = 'seismic'\nsample_masks1=build_masks(sample_filename,input_shape=(520, 704), colors=False)\nsample_masks2=build_masks(sample_filename,input_shape=(520, 704), colors=True)\n\n\nsample_filename1 = '172334437c88'\nsample_image_df1 = df[df['id'] == sample_filename1]\nsample_path1 = f\"../input/sartorius-cell-instance-segmentation/train/{sample_image_df1['id'].iloc[0]}.png\"\nsample_img1 = plt.imread(sample_path1)\n# sample_rles1 = sample_image_df1['annotation'].values\n\n# COLOR_MAP = 'seismic'\nsample_masks3=build_masks(sample_filename1,input_shape=(520, 704), colors=False)\nsample_masks4=build_masks(sample_filename1,input_shape=(520, 704), colors=True)\n\n\nplt.figure(figsize=(14,14))\nplt.subplot(2, 3, 1)\nplt.imshow(sample_img,cmap = 'seismic')\n\nplt.subplot(2, 3, 2)\nplt.imshow(sample_masks1,cmap='gray')\n\nplt.subplot(2, 3, 3)\nplt.imshow(sample_masks2)\n\n\n\nplt.subplot(2, 3, 4)\nplt.imshow(sample_img1,cmap = 'seismic')\n\nplt.subplot(2, 3, 5)\nplt.imshow(sample_masks3,cmap='gray')\n\nplt.subplot(2, 3, 6)\nplt.imshow(sample_masks4)\n\n# fig, axs = plt.subplots(1,3, figsize=(18, 18))\n# axs[0].imshow(sample_img,cmap = 'seismic')\n# axs[0].set_title('original image', fontsize=16)\n\n\n# axs[1].imshow(sample_masks1,cmap='gray')\n# axs[1].set_title('mask image', fontsize=16)\n\n\n# axs[2].imshow(sample_masks2)\n# axs[2].set_title('mask with color', fontsize=16)\n\n# axs[3].imshow(sample_img1)\n# # axs[2].set_title('mask with color', fontsize=16)\n\n# axs[4].imshow(sample_masks3)\n\n# axs[5].imshow(sample_masks4)","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:47.175249Z","iopub.execute_input":"2021-11-04T12:05:47.175468Z","iopub.status.idle":"2021-11-04T12:05:49.717904Z","shell.execute_reply.started":"2021-11-04T12:05:47.175443Z","shell.execute_reply":"2021-11-04T12:05:49.717094Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# img = np.expand_dims(sample_img, axis=-1)\n# y = np.squeeze(y, axis=-1)\n# img.shape","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:49.719242Z","iopub.execute_input":"2021-11-04T12:05:49.720168Z","iopub.status.idle":"2021-11-04T12:05:49.723834Z","shell.execute_reply.started":"2021-11-04T12:05:49.72011Z","shell.execute_reply":"2021-11-04T12:05:49.722914Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.model_selection import train_test_split\ntrain_idx, val_idx = train_test_split(\n    df.index, random_state=2019, test_size=0.2 # mask_count_df\n)\n\nprint(train_idx)","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:49.724978Z","iopub.execute_input":"2021-11-04T12:05:49.725244Z","iopub.status.idle":"2021-11-04T12:05:50.861604Z","shell.execute_reply.started":"2021-11-04T12:05:49.725214Z","shell.execute_reply":"2021-11-04T12:05:50.860387Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_img.shape","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:50.863417Z","iopub.execute_input":"2021-11-04T12:05:50.86377Z","iopub.status.idle":"2021-11-04T12:05:50.87136Z","shell.execute_reply.started":"2021-11-04T12:05:50.863723Z","shell.execute_reply":"2021-11-04T12:05:50.870443Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"img_new = np.zeros((520, 704,3),dtype=np.int8)\nimg_new[:,:,0] = sample_masks1[:,:,0]\nimg_new[:,:,1] = sample_masks1[:,:,0]\nimg_new[:,:,2] = sample_masks1[:,:,0]\nimg_new = img_new * 255\n# np.unique(img_new)\n# plt.imshow(img_new)\nnp.where(img_new == [255, 255, 255])","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:50.872943Z","iopub.execute_input":"2021-11-04T12:05:50.873218Z","iopub.status.idle":"2021-11-04T12:05:50.90752Z","shell.execute_reply.started":"2021-11-04T12:05:50.873185Z","shell.execute_reply":"2021-11-04T12:05:50.90663Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_img","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:50.910203Z","iopub.execute_input":"2021-11-04T12:05:50.91108Z","iopub.status.idle":"2021-11-04T12:05:50.919172Z","shell.execute_reply.started":"2021-11-04T12:05:50.911034Z","shell.execute_reply":"2021-11-04T12:05:50.918263Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"temp = np.zeros((520, 704,3),dtype=np.float32)\n# temp = np.zeros_like(thresh1,dtype=np.float32)\ntemp[:,:,0] = sample_img[:,:]\ntemp[:,:,1] = sample_img[:,:]\ntemp[:,:,2] = sample_img[:,:]\n# cv2.imwrite('temp_img.jpg', temp)\n# temp = temp *255\n# norm_image = cv2.normalize(temp, None, alpha = 0, beta = 255, norm_type = cv2.NORM_MINMAX, dtype = cv2.CV_32F)\n\nplt.imshow(temp,cmap='gray')","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:50.920726Z","iopub.execute_input":"2021-11-04T12:05:50.921833Z","iopub.status.idle":"2021-11-04T12:05:51.314103Z","shell.execute_reply.started":"2021-11-04T12:05:50.921634Z","shell.execute_reply":"2021-11-04T12:05:51.313132Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# !pip install opencv-python==4.4.0.40","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:51.315264Z","iopub.execute_input":"2021-11-04T12:05:51.3155Z","iopub.status.idle":"2021-11-04T12:05:51.320222Z","shell.execute_reply.started":"2021-11-04T12:05:51.315472Z","shell.execute_reply":"2021-11-04T12:05:51.319052Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"color=[0, 242, 214]\n# read the mask\nmask = img_new\n# read the original img\nimg = temp\n# change the color coden to light red\nret, thresh1 = cv2.threshold(mask, 120, 255, cv2.THRESH_BINARY)\ncheck = np.array([255, 255, 255])\nthresh1[np.where((thresh1==check).all(axis=0))] = color\n# overlay the mask\nthresh1 =thresh1.astype(np.float32)\ncombine = cv2.addWeighted(img,0.7,thresh1,0.7,0.3)\n# combine = cv2.add(img,thresh1)\nplt.imshow(combine)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:51.32156Z","iopub.execute_input":"2021-11-04T12:05:51.321817Z","iopub.status.idle":"2021-11-04T12:05:51.668433Z","shell.execute_reply.started":"2021-11-04T12:05:51.321787Z","shell.execute_reply":"2021-11-04T12:05:51.667416Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Data Preprocessing","metadata":{}},{"cell_type":"code","source":"import numpy as np\nunq_id = np.unique(df[\"id\"])\n\n# if os.path.exists(\"./images\")\n# os.mkdir(\"./images\")\nos.mkdir(\"./masks\")\n# os.mkdir(\"./images/img\")\nos.mkdir(\"./masks/img\")\nprint(len(unq_id))\ncnt = 0\nfor ide in tqdm(unq_id):\n#     print(i)\n#     for ide in ids:\n    sample_image_df = df[df['id'] == ide]\n    sample_path = f\"../input/sartorius-cell-instance-segmentation/train/{sample_image_df['id'].iloc[0]}.png\"\n    sample_img = plt.imread(sample_path)\n    sample_masks1=build_masks(ide,input_shape=(520, 704), colors=False)\n    \n#     sample_image_df1 = df[df['id'] == i]\n#     sample_path1 = f\"../input/sartorius-cell-instance-segmentation/train/{sample_image_df1['id'].iloc[0]}.png\"\n#     sample_img1 = plt.imread(sample_path1)\n#     sample_masks3=build_masks(sample_filename1,input_shape=(520, 704), colors=False)\n    \n#     sample_masks1=build_masks(ide,input_shape=(520, 704), colors=False)\n    \n#     sample_image_df = df[df['id'] == ide]\n#     sample_path = f\"../input/sartorius-cell-instance-segmentation/train/{sample_image_df['id'].iloc[0]}.png\"\n#     sample_img = cv2.imread(sample_path,cv2.IMREAD_COLOR)\n    \n#     img_file = f\"./images/img/{sample_image_df1['id'].iloc[0]}.png\"\n    mask_file = f\"./masks/img/{sample_image_df['id'].iloc[0]}.png\"\n    print(mask_file)\n#     cv2.imwrite(img_file,sample_img1)\n    cv2.imwrite(mask_file,sample_masks1)\n\n    cnt+=1\nprint(f\"preprocessed total data {cnt}\")","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:05:51.669575Z","iopub.execute_input":"2021-11-04T12:05:51.669785Z","iopub.status.idle":"2021-11-04T12:06:58.479273Z","shell.execute_reply.started":"2021-11-04T12:05:51.669759Z","shell.execute_reply":"2021-11-04T12:06:58.478379Z"},"_kg_hide-output":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# !cd ..","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:06:58.480624Z","iopub.execute_input":"2021-11-04T12:06:58.481296Z","iopub.status.idle":"2021-11-04T12:06:58.486374Z","shell.execute_reply.started":"2021-11-04T12:06:58.481247Z","shell.execute_reply":"2021-11-04T12:06:58.485222Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# !pwd","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:06:58.487831Z","iopub.execute_input":"2021-11-04T12:06:58.488177Z","iopub.status.idle":"2021-11-04T12:06:58.50043Z","shell.execute_reply.started":"2021-11-04T12:06:58.488114Z","shell.execute_reply":"2021-11-04T12:06:58.499379Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# !dir masks/img","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:06:58.502062Z","iopub.execute_input":"2021-11-04T12:06:58.502646Z","iopub.status.idle":"2021-11-04T12:06:58.516883Z","shell.execute_reply.started":"2021-11-04T12:06:58.502614Z","shell.execute_reply":"2021-11-04T12:06:58.515741Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"im = plt.imread(os.path.join(\"./masks/img\", os.listdir(\"./masks/img\")[17]))\nplt.imshow(im)","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:08:54.649139Z","iopub.execute_input":"2021-11-04T12:08:54.649483Z","iopub.status.idle":"2021-11-04T12:08:54.946188Z","shell.execute_reply.started":"2021-11-04T12:08:54.649448Z","shell.execute_reply":"2021-11-04T12:08:54.945437Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"imr = plt.imread(\"./masks/img/fac5fa0dd448.png\")\nplt.imshow(imr)","metadata":{"execution":{"iopub.status.busy":"2021-11-04T12:06:58.818696Z","iopub.execute_input":"2021-11-04T12:06:58.819083Z","iopub.status.idle":"2021-11-04T12:06:59.114521Z","shell.execute_reply.started":"2021-11-04T12:06:58.819033Z","shell.execute_reply":"2021-11-04T12:06:59.113389Z"},"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":[]}]}