{"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":23942,"sourceType":"datasetVersion","datasetId":17839}],"dockerImageVersionId":30559,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Data exploration","metadata":{}},{"cell_type":"code","source":"import os\nimport matplotlib.pyplot as plt\nimport cv2\nimport numpy as np\nimport pandas as pd\nfrom glob import glob\nimport matplotlib.gridspec as gridspec\nimport seaborn as sns\nfrom sklearn.utils import class_weight\nimport random\nrandom.seed(123)","metadata":{"execution":{"iopub.status.busy":"2023-09-13T10:41:21.407724Z","iopub.execute_input":"2023-09-13T10:41:21.408259Z","iopub.status.idle":"2023-09-13T10:41:21.415233Z","shell.execute_reply.started":"2023-09-13T10:41:21.408221Z","shell.execute_reply":"2023-09-13T10:41:21.414180Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path1 =\"/kaggle/input/kermany2018/OCT2017 /train\"\npath2 =\"/kaggle/input/kermany2018/OCT2017 /test\"\npath3 =\"/kaggle/input/kermany2018/OCT2017 /val\"","metadata":{"execution":{"iopub.status.busy":"2023-09-13T10:41:24.092670Z","iopub.execute_input":"2023-09-13T10:41:24.093149Z","iopub.status.idle":"2023-09-13T10:41:24.099683Z","shell.execute_reply.started":"2023-09-13T10:41:24.093114Z","shell.execute_reply":"2023-09-13T10:41:24.098086Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"myList = os.listdir(path1)\nprint(\"Total Number of Classes Detected :\",len(myList))\n","metadata":{"execution":{"iopub.status.busy":"2023-09-13T10:41:26.057950Z","iopub.execute_input":"2023-09-13T10:41:26.058373Z","iopub.status.idle":"2023-09-13T10:41:26.071904Z","shell.execute_reply.started":"2023-09-13T10:41:26.058342Z","shell.execute_reply":"2023-09-13T10:41:26.070317Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"random.seed(123)\nnoOfclasses= len(myList)\nprint(myList)","metadata":{"execution":{"iopub.status.busy":"2023-09-13T10:41:27.785267Z","iopub.execute_input":"2023-09-13T10:41:27.785774Z","iopub.status.idle":"2023-09-13T10:41:27.792592Z","shell.execute_reply.started":"2023-09-13T10:41:27.785738Z","shell.execute_reply":"2023-09-13T10:41:27.791239Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"main_dir = os.listdir('/kaggle/input/kermany2018/OCT2017 /')\nprint(main_dir)\n\nfor i in main_dir:\n data_dir_list = os.listdir('/kaggle/input/kermany2018/OCT2017 /'+ str(i) )\n print(i, data_dir_list)","metadata":{"execution":{"iopub.status.busy":"2023-09-13T10:41:28.814034Z","iopub.execute_input":"2023-09-13T10:41:28.814478Z","iopub.status.idle":"2023-09-13T10:41:28.823957Z","shell.execute_reply.started":"2023-09-13T10:41:28.814445Z","shell.execute_reply":"2023-09-13T10:41:28.822671Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"normal_len = len(os.listdir(\"../input/kermany2018/OCT2017 /train/NORMAL\"))\ndrusen_len = len(os.listdir(\"../input/kermany2018/OCT2017 /train/DRUSEN\"))\ncnv_len = len(os.listdir(\"../input/kermany2018/OCT2017 /train/CNV\"))\ndme_len = len(os.listdir(\"../input/kermany2018/OCT2017 /train/DME\"))\n\nprint(\"length of images with drusen = \",drusen_len)\nprint(\"length of images with cnv = \",cnv_len)\nprint(\"length of images with dme = \",dme_len)\nprint(\"length of images with normal = \",normal_len)","metadata":{"execution":{"iopub.status.busy":"2023-09-13T10:41:29.744938Z","iopub.execute_input":"2023-09-13T10:41:29.745371Z","iopub.status.idle":"2023-09-13T10:41:29.797841Z","shell.execute_reply.started":"2023-09-13T10:41:29.745337Z","shell.execute_reply":"2023-09-13T10:41:29.796287Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"Normal\")\nmultipleImages = glob('../input/kermany2018/oct2017/OCT2017 /train/NORMAL/**')\ni_ = 0\nplt.rcParams['figure.figsize'] = (15.0, 15.0)\nplt.subplots_adjust(wspace=0, hspace=0)\nfor l in multipleImages[:25]:\n im = cv2.imread(l)\n im = cv2.resize(im, (128, 128)) \n plt.subplot(5, 5, i_+1) #.set_title(l)\n plt.imshow(cv2.cvtColor(im, cv2.COLOR_BGR2RGB)); plt.axis('off')\n i_ += 1","metadata":{"execution":{"iopub.status.busy":"2023-09-13T10:41:31.469347Z","iopub.execute_input":"2023-09-13T10:41:31.469947Z","iopub.status.idle":"2023-09-13T10:41:35.915795Z","shell.execute_reply.started":"2023-09-13T10:41:31.469901Z","shell.execute_reply":"2023-09-13T10:41:35.913036Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"DME\")\nmultipleImages = glob('../input/kermany2018/oct2017/OCT2017 /train/DME/**')\ni_ = 0\nplt.rcParams['figure.figsize'] = (15.0, 15.0)\nplt.subplots_adjust(wspace=0, hspace=0)\nfor l in multipleImages[:15]:\n im = cv2.imread(l)\n im = cv2.resize(im, (128, 128)) \n plt.subplot(5, 5, i_+1) #.set_title(l)\n plt.imshow(cv2.cvtColor(im, cv2.COLOR_BGR2RGB)); plt.axis('off')\n i_ += 1","metadata":{"execution":{"iopub.status.busy":"2023-09-13T10:41:39.475385Z","iopub.execute_input":"2023-09-13T10:41:39.475894Z","iopub.status.idle":"2023-09-13T10:41:41.986309Z","shell.execute_reply.started":"2023-09-13T10:41:39.475856Z","shell.execute_reply":"2023-09-13T10:41:41.984331Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Model checkpoint","metadata":{}},{"cell_type":"code","source":"model_checkpoint = \"microsoft/swinv2-tiny-patch4-window8-256\"\nbatch_size = 64","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:00:36.768650Z","iopub.execute_input":"2023-10-18T19:00:36.769003Z","iopub.status.idle":"2023-10-18T19:00:36.777371Z","shell.execute_reply.started":"2023-10-18T19:00:36.768979Z","shell.execute_reply":"2023-10-18T19:00:36.776505Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install -q datasets transformers","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:00:36.778923Z","iopub.execute_input":"2023-10-18T19:00:36.779173Z","iopub.status.idle":"2023-10-18T19:00:46.744859Z","shell.execute_reply.started":"2023-10-18T19:00:36.779133Z","shell.execute_reply":"2023-10-18T19:00:46.743857Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from huggingface_hub import notebook_login\n\nnotebook_login()","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:00:46.746891Z","iopub.execute_input":"2023-10-18T19:00:46.747165Z","iopub.status.idle":"2023-10-18T19:00:46.985205Z","shell.execute_reply.started":"2023-10-18T19:00:46.747141Z","shell.execute_reply":"2023-10-18T19:00:46.984634Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Loading complete data","metadata":{}},{"cell_type":"code","source":"from datasets import load_dataset \ndataset = load_dataset(\"imagefolder\", data_dir=\"/kaggle/input/kermany2018/\")","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:02:36.794560Z","iopub.execute_input":"2023-10-18T19:02:36.795100Z","iopub.status.idle":"2023-10-18T19:18:28.417708Z","shell.execute_reply.started":"2023-10-18T19:02:36.795074Z","shell.execute_reply":"2023-10-18T19:18:28.417032Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:18:28.418873Z","iopub.execute_input":"2023-10-18T19:18:28.419661Z","iopub.status.idle":"2023-10-18T19:18:28.424831Z","shell.execute_reply.started":"2023-10-18T19:18:28.419637Z","shell.execute_reply":"2023-10-18T19:18:28.423892Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from datasets import load_metric\n\nmetric = load_metric(\"accuracy\")\n","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:18:28.425853Z","iopub.execute_input":"2023-10-18T19:18:28.426457Z","iopub.status.idle":"2023-10-18T19:18:29.192456Z","shell.execute_reply.started":"2023-10-18T19:18:28.426434Z","shell.execute_reply":"2023-10-18T19:18:29.191764Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"labels = dataset[\"train\"].features[\"label\"].names\nlabel2id, id2label = dict(), dict()\nfor i, label in enumerate(labels):\n label2id[label] = i\n id2label[i] = label","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:18:29.194015Z","iopub.execute_input":"2023-10-18T19:18:29.194264Z","iopub.status.idle":"2023-10-18T19:18:29.199133Z","shell.execute_reply.started":"2023-10-18T19:18:29.194243Z","shell.execute_reply":"2023-10-18T19:18:29.198528Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Data preprocessing","metadata":{}},{"cell_type":"code","source":"from transformers import AutoImageProcessor\n\nimage_processor = AutoImageProcessor.from_pretrained(model_checkpoint)\nimage_processor ","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:22:38.586017Z","iopub.execute_input":"2023-10-18T19:22:38.586654Z","iopub.status.idle":"2023-10-18T19:22:38.770449Z","shell.execute_reply.started":"2023-10-18T19:22:38.586623Z","shell.execute_reply":"2023-10-18T19:22:38.769892Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from torchvision.transforms import (\n Compose,\n Normalize,\n RandomHorizontalFlip,\n RandomVerticalFlip, \n Resize,\n ToTensor,\n ColorJitter,\n)\n\nnormalize = Normalize(mean=image_processor.image_mean, std=image_processor.image_std)\n\nif \"height\" in image_processor.size:\n size = (image_processor.size[\"height\"], image_processor.size[\"width\"])\nelif \"shortest_edge\" in image_processor.size:\n size = (image_processor.size[\"shortest_edge\"], image_processor.size[\"shortest_edge\"])\n\ncolor_jitter = ColorJitter(brightness=0.2, contrast=0.2)\n\ntrain_transforms = Compose(\n [\n RandomHorizontalFlip(),\n RandomVerticalFlip(), \n color_jitter,\n Resize(size),\n ToTensor(),\n normalize,\n ]\n )\n\nval_transforms = Compose(\n [\n Resize(size),\n ToTensor(),\n normalize,\n ]\n )\n\ndef preprocess_train(example_batch):\n example_batch[\"pixel_values\"] = [\n train_transforms(image.convert(\"RGB\")) for image in example_batch[\"image\"]\n ]\n return example_batch\n\ndef preprocess_val(example_batch):\n example_batch[\"pixel_values\"] = [val_transforms(image.convert(\"RGB\")) for image in example_batch[\"image\"]]\n return example_batch\n","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:23:39.072900Z","iopub.execute_input":"2023-10-18T19:23:39.073562Z","iopub.status.idle":"2023-10-18T19:23:39.346628Z","shell.execute_reply.started":"2023-10-18T19:23:39.073528Z","shell.execute_reply":"2023-10-18T19:23:39.345793Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"splits_1 = dataset[\"train\"].train_test_split(test_size=0.2)\ntrain_temp = splits_1['train']\ntest_ds = splits_1['test']\n\n# Now, split the train_temp (80% of original) into train (87.5% of 80%) and val (12.5% of 80%)\nsplits_2 = train_temp.train_test_split(test_size=0.125)\ntrain_ds = splits_2['train']\nval_ds = splits_2['test']","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:23:39.348033Z","iopub.execute_input":"2023-10-18T19:23:39.348507Z","iopub.status.idle":"2023-10-18T19:23:44.814236Z","shell.execute_reply.started":"2023-10-18T19:23:39.348481Z","shell.execute_reply":"2023-10-18T19:23:44.813535Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_ds.set_transform(preprocess_train)\nval_ds.set_transform(preprocess_val)\ntest_ds.set_transform(preprocess_val)","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:23:44.815558Z","iopub.execute_input":"2023-10-18T19:23:44.815952Z","iopub.status.idle":"2023-10-18T19:23:44.821222Z","shell.execute_reply.started":"2023-10-18T19:23:44.815930Z","shell.execute_reply":"2023-10-18T19:23:44.820499Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Model training","metadata":{}},{"cell_type":"code","source":"from transformers import AutoModelForImageClassification, TrainingArguments, Trainer\n\nmodel = AutoModelForImageClassification.from_pretrained(\n model_checkpoint, \n label2id=label2id,\n id2label=id2label,\n ignore_mismatched_sizes = True\n)\n","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:23:44.822237Z","iopub.execute_input":"2023-10-18T19:23:44.822471Z","iopub.status.idle":"2023-10-18T19:23:48.267827Z","shell.execute_reply.started":"2023-10-18T19:23:44.822452Z","shell.execute_reply":"2023-10-18T19:23:48.267195Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model_name = model_checkpoint.split(\"/\")[-1]\n\nargs = TrainingArguments(\n f\"SwinMark2\",\n remove_unused_columns=False,\n evaluation_strategy = \"epoch\",\n save_strategy = \"epoch\",\n learning_rate=5e-5,\n per_device_train_batch_size=batch_size,\n gradient_accumulation_steps=4,\n per_device_eval_batch_size=batch_size,\n num_train_epochs=3,\n warmup_ratio=0.1,\n logging_steps=10,\n load_best_model_at_end=True,\n metric_for_best_model=\"accuracy\",\n push_to_hub=True,\n)","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:23:48.269598Z","iopub.execute_input":"2023-10-18T19:23:48.270068Z","iopub.status.idle":"2023-10-18T19:23:48.382338Z","shell.execute_reply.started":"2023-10-18T19:23:48.270044Z","shell.execute_reply":"2023-10-18T19:23:48.381601Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np\ndef compute_metrics(eval_pred):\n predictions = np.argmax(eval_pred.predictions, axis=1)\n return metric.compute(predictions=predictions, references=eval_pred.label_ids)","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:23:48.385108Z","iopub.execute_input":"2023-10-18T19:23:48.385464Z","iopub.status.idle":"2023-10-18T19:23:48.390055Z","shell.execute_reply.started":"2023-10-18T19:23:48.385442Z","shell.execute_reply":"2023-10-18T19:23:48.389221Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import torch\n\ndef collate_fn(examples):\n pixel_values = torch.stack([example[\"pixel_values\"] for example in examples])\n labels = torch.tensor([example[\"label\"] for example in examples])\n return {\"pixel_values\": pixel_values, \"labels\": labels}","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:23:48.392614Z","iopub.execute_input":"2023-10-18T19:23:48.392871Z","iopub.status.idle":"2023-10-18T19:23:48.403319Z","shell.execute_reply.started":"2023-10-18T19:23:48.392839Z","shell.execute_reply":"2023-10-18T19:23:48.402471Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"trainer = Trainer(\n model,\n args,\n train_dataset=train_ds,\n eval_dataset=val_ds,\n tokenizer=image_processor,\n compute_metrics=compute_metrics,\n data_collator=collate_fn,\n)","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:23:48.404588Z","iopub.execute_input":"2023-10-18T19:23:48.404815Z","iopub.status.idle":"2023-10-18T19:23:54.977667Z","shell.execute_reply.started":"2023-10-18T19:23:48.404796Z","shell.execute_reply":"2023-10-18T19:23:54.976952Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_results = trainer.train()\ntrainer.save_model()\ntrainer.log_metrics(\"train\", train_results.metrics)\ntrainer.save_metrics(\"train\", train_results.metrics)\ntrainer.save_state()","metadata":{"execution":{"iopub.status.busy":"2023-10-18T19:23:54.978522Z","iopub.execute_input":"2023-10-18T19:23:54.979084Z","iopub.status.idle":"2023-10-18T22:17:55.076929Z","shell.execute_reply.started":"2023-10-18T19:23:54.979061Z","shell.execute_reply":"2023-10-18T22:17:55.076124Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"metrics = trainer.evaluate()\ntrainer.log_metrics(\"eval\", metrics)\ntrainer.save_metrics(\"eval\", metrics)","metadata":{"execution":{"iopub.status.busy":"2023-10-18T22:17:55.088864Z","iopub.execute_input":"2023-10-18T22:17:55.089383Z","iopub.status.idle":"2023-10-18T22:20:41.129820Z","shell.execute_reply.started":"2023-10-18T22:17:55.089358Z","shell.execute_reply":"2023-10-18T22:20:41.128871Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"outputs = trainer.predict(test_ds)","metadata":{"execution":{"iopub.status.busy":"2023-10-18T22:20:41.134736Z","iopub.execute_input":"2023-10-18T22:20:41.136183Z","iopub.status.idle":"2023-10-18T22:29:10.785430Z","shell.execute_reply.started":"2023-10-18T22:20:41.136145Z","shell.execute_reply":"2023-10-18T22:29:10.784781Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(outputs.metrics)","metadata":{"execution":{"iopub.status.busy":"2023-10-18T22:29:10.789920Z","iopub.execute_input":"2023-10-18T22:29:10.791319Z","iopub.status.idle":"2023-10-18T22:29:10.797597Z","shell.execute_reply.started":"2023-10-18T22:29:10.791294Z","shell.execute_reply":"2023-10-18T22:29:10.797056Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.metrics import confusion_matrix, ConfusionMatrixDisplay\n\ny_true = outputs.label_ids\ny_pred = outputs.predictions.argmax(1)\n\nlabels = train_ds.features['label'].names\ncm = confusion_matrix(y_true, y_pred)\ndisp = ConfusionMatrixDisplay(confusion_matrix=cm, display_labels=labels)\ndisp.plot(xticks_rotation=45)","metadata":{"execution":{"iopub.status.busy":"2023-10-18T22:29:10.800389Z","iopub.execute_input":"2023-10-18T22:29:10.801499Z","iopub.status.idle":"2023-10-18T22:29:11.199774Z","shell.execute_reply.started":"2023-10-18T22:29:10.801474Z","shell.execute_reply":"2023-10-18T22:29:11.199217Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"trainer.push_to_hub()","metadata":{"execution":{"iopub.status.busy":"2023-10-18T22:29:11.202358Z","iopub.execute_input":"2023-10-18T22:29:11.202814Z","iopub.status.idle":"2023-10-18T22:29:12.654606Z","shell.execute_reply.started":"2023-10-18T22:29:11.202791Z","shell.execute_reply":"2023-10-18T22:29:12.654020Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.metrics import classification_report\nreport = classification_report(y_true, y_pred, target_names=labels, digits=4)\nprint(report)","metadata":{"execution":{"iopub.status.busy":"2023-10-18T22:52:40.228622Z","iopub.execute_input":"2023-10-18T22:52:40.229624Z","iopub.status.idle":"2023-10-18T22:52:40.290405Z","shell.execute_reply.started":"2023-10-18T22:52:40.229592Z","shell.execute_reply":"2023-10-18T22:52:40.289681Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_ds","metadata":{"execution":{"iopub.status.busy":"2023-10-18T22:55:33.449005Z","iopub.execute_input":"2023-10-18T22:55:33.449705Z","iopub.status.idle":"2023-10-18T22:55:33.455924Z","shell.execute_reply.started":"2023-10-18T22:55:33.449674Z","shell.execute_reply":"2023-10-18T22:55:33.455003Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Inference","metadata":{}},{"cell_type":"code","source":"from torchvision.datasets import ImageFolder\n\nimage_path = \"/kaggle/input/kermany2018/OCT2017 /test/CNV/CNV-1016042-4.jpeg\"\n\nfrom PIL import Image\nimage = Image.open(image_path)\nimage.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-11-21T13:32:05.439390Z","iopub.execute_input":"2023-11-21T13:32:05.439674Z","iopub.status.idle":"2023-11-21T13:32:09.182300Z","shell.execute_reply.started":"2023-11-21T13:32:05.439647Z","shell.execute_reply":"2023-11-21T13:32:09.181138Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install transformers\nfrom transformers import pipeline\npipe = pipeline(\"image-classification\", \"Abhiram4/SwinMark2\")","metadata":{"execution":{"iopub.status.busy":"2023-11-21T13:33:29.530596Z","iopub.execute_input":"2023-11-21T13:33:29.531113Z","iopub.status.idle":"2023-11-21T13:33:57.965824Z","shell.execute_reply.started":"2023-11-21T13:33:29.531080Z","shell.execute_reply":"2023-11-21T13:33:57.964737Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pipe(image)","metadata":{"execution":{"iopub.status.busy":"2023-11-21T13:34:03.557504Z","iopub.execute_input":"2023-11-21T13:34:03.558466Z","iopub.status.idle":"2023-11-21T13:34:03.848208Z","shell.execute_reply.started":"2023-11-21T13:34:03.558422Z","shell.execute_reply":"2023-11-21T13:34:03.847302Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}