{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceId":21755,"databundleVersionId":1475600,"sourceType":"competition"}],"dockerImageVersionId":30761,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# I’m Something of a Painter Myself\n\n*Implementation based on paper https://arxiv.org/pdf/1703.10593*","metadata":{}},{"cell_type":"code","source":"# Import libraries\n\nimport torch\nimport torch.nn as nn\nimport numpy as np\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nfrom torch.utils.data import Dataset, DataLoader\nimport os\nimport torchvision.transforms as transforms\nimport torch.optim as optim\nfrom tqdm import tqdm","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:01.261858Z","iopub.execute_input":"2024-09-06T13:11:01.262235Z","iopub.status.idle":"2024-09-06T13:11:06.248670Z","shell.execute_reply.started":"2024-09-06T13:11:01.262197Z","shell.execute_reply":"2024-09-06T13:11:06.247865Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"photo_path = '/kaggle/input/gan-getting-started/photo_jpg/'\nmonet_path = '/kaggle/input/gan-getting-started/monet_jpg/'","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:09.111391Z","iopub.execute_input":"2024-09-06T13:11:09.112505Z","iopub.status.idle":"2024-09-06T13:11:09.116740Z","shell.execute_reply.started":"2024-09-06T13:11:09.112457Z","shell.execute_reply":"2024-09-06T13:11:09.115841Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"transform = transforms.Compose([\n    transforms.ToTensor(),\n    transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])\n])","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:10.799915Z","iopub.execute_input":"2024-09-06T13:11:10.800797Z","iopub.status.idle":"2024-09-06T13:11:10.805928Z","shell.execute_reply.started":"2024-09-06T13:11:10.800755Z","shell.execute_reply":"2024-09-06T13:11:10.804854Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Dataset class:\n\nclass Images(Dataset):\n    def __init__(self, photo_path, monet_path, transform):\n        self.photo_path = photo_path\n        self.monet_path = monet_path\n        self.transform = transform\n        self.photos = os.listdir(photo_path)\n        self.monets = os.listdir(monet_path)\n        self.l_photo = len(self.photos)\n        self.l_monet = len(self.monets)\n    \n    def __len__(self):\n        return max(len(self.photos), len(self.monets))\n    \n    def __getitem__(self, idx):\n        photo = Image.open(self.photo_path + self.photos[idx % self.l_photo]).convert(\"RGB\")\n        monet = Image.open(self.monet_path + self.monets[idx % self.l_monet]).convert(\"RGB\")\n        \n        photo = self.transform(photo)\n        monet = self.transform(monet)\n        \n        return photo, monet\n        ","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:13.419147Z","iopub.execute_input":"2024-09-06T13:11:13.419584Z","iopub.status.idle":"2024-09-06T13:11:13.428161Z","shell.execute_reply.started":"2024-09-06T13:11:13.419544Z","shell.execute_reply":"2024-09-06T13:11:13.427170Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Define dataset:\n\ndataset = Images(photo_path, monet_path, transform)","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:15.955809Z","iopub.execute_input":"2024-09-06T13:11:15.956597Z","iopub.status.idle":"2024-09-06T13:11:16.746272Z","shell.execute_reply.started":"2024-09-06T13:11:15.956546Z","shell.execute_reply":"2024-09-06T13:11:16.745384Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Define torch dataloader:\n\ndataloader = DataLoader(dataset, batch_size=8, shuffle=True)","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:19.744845Z","iopub.execute_input":"2024-09-06T13:11:19.745283Z","iopub.status.idle":"2024-09-06T13:11:19.750544Z","shell.execute_reply.started":"2024-09-06T13:11:19.745216Z","shell.execute_reply":"2024-09-06T13:11:19.749425Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check examples of pics:\nexample = next(iter(dataloader))\n\nplt.subplot(1, 2, 1)\nplt.title('Photo example')\nplt.imshow(example[0][0].permute(1, 2, 0) * 0.5 + 0.5)\n\nplt.subplot(1, 2, 2)\nplt.title('Monet example')\nplt.imshow(example[1][0].permute(1, 2, 0) * 0.5 + 0.5)","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:27.975983Z","iopub.execute_input":"2024-09-06T13:11:27.976766Z","iopub.status.idle":"2024-09-06T13:11:28.660825Z","shell.execute_reply.started":"2024-09-06T13:11:27.976723Z","shell.execute_reply":"2024-09-06T13:11:28.659825Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Discriminator model","metadata":{}},{"cell_type":"code","source":"class conv_block(nn.Module):\n    def __init__(self, in_channels, out_channels, stride):\n        super().__init__()\n        self.conv = nn.Sequential(\n            nn.Conv2d(in_channels=in_channels,\n                      out_channels=out_channels, \n                      kernel_size=4, \n                      stride=stride,\n                      padding=1,\n                      bias=True,\n                      padding_mode=\"reflect\"),\n            nn.InstanceNorm2d(out_channels),\n            nn.LeakyReLU(0.2)\n        )\n    \n    def forward(self, x):\n        return self.conv(x)","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:33.302499Z","iopub.execute_input":"2024-09-06T13:11:33.302911Z","iopub.status.idle":"2024-09-06T13:11:33.310382Z","shell.execute_reply.started":"2024-09-06T13:11:33.302872Z","shell.execute_reply":"2024-09-06T13:11:33.308930Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"class Discriminator(nn.Module):\n    def __init__(self, in_channels=3):\n        super().__init__()\n        self.initial = nn.Sequential(\n            nn.Conv2d(\n                in_channels=in_channels,\n                out_channels=64,\n                kernel_size=4, \n                stride=2,\n                padding=1,\n                padding_mode=\"reflect\"),\n            nn.LeakyReLU(0.2)\n        )\n        self.process = nn.Sequential(\n            conv_block(64, 128, 2),\n            conv_block(128, 256, 2),\n            conv_block(256, 512, 1),\n            nn.Conv2d(\n                in_channels=512,\n                out_channels=1,\n                kernel_size=4,\n                stride=1,\n                padding=1,\n                padding_mode='reflect'),\n            nn.Sigmoid()\n        )\n        \n    def forward(self, x):\n        \"\"\"\n        OUT = floor((IN + 2 * padding - kernel_size + 1) / stride + 1)\n        [batch_size, 3, 256, 256] ->\n        [batch_size, 64, 128, 128] ->\n        [batch_size, 128, 64, 64] ->\n        [batch_size, 256, 32, 32] ->\n        [batch_size, 512, 30, 30] ->\n        [batch_size, 1, 30, 30]\n        \"\"\"\n        x = self.initial(x)\n        x = self.process(x)\n        return x","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:35.751425Z","iopub.execute_input":"2024-09-06T13:11:35.751849Z","iopub.status.idle":"2024-09-06T13:11:35.763891Z","shell.execute_reply.started":"2024-09-06T13:11:35.751801Z","shell.execute_reply":"2024-09-06T13:11:35.762518Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x = torch.randn((1, 3, 256, 256))\ndis = Discriminator()\nassert(dis(x).shape == (1, 1, 30, 30))","metadata":{"execution":{"iopub.status.busy":"2024-09-05T22:50:05.116372Z","iopub.execute_input":"2024-09-05T22:50:05.116696Z","iopub.status.idle":"2024-09-05T22:50:05.289710Z","shell.execute_reply.started":"2024-09-05T22:50:05.116663Z","shell.execute_reply":"2024-09-05T22:50:05.288579Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Generator model","metadata":{}},{"cell_type":"code","source":"class gen_conv_block(nn.Module):\n    def __init__(self, in_channels, out_channels, TYPE='down', activation=False, **kwargs):\n        super().__init__()\n        self.conv = nn.Sequential(\n            nn.Conv2d(in_channels=in_channels,\n                      out_channels=out_channels,\n                      padding_mode=\"reflect\",\n                      **kwargs) if TYPE == 'down'\n            else nn.ConvTranspose2d(in_channels=in_channels,\n                                   out_channels=out_channels,\n                                   **kwargs),\n            nn.InstanceNorm2d(out_channels),\n            nn.ReLU(inplace=True) if activation else nn.Identity()\n        )\n        \n    def forward(self, x):\n        return self.conv(x)","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:40.886042Z","iopub.execute_input":"2024-09-06T13:11:40.887179Z","iopub.status.idle":"2024-09-06T13:11:40.895436Z","shell.execute_reply.started":"2024-09-06T13:11:40.887119Z","shell.execute_reply":"2024-09-06T13:11:40.894475Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"class res_block(nn.Module):\n    def __init__(self, channels):\n        super().__init__()\n        self.block_ = nn.Sequential(\n            gen_conv_block(channels, channels, kernel_size=3, padding=1),\n            gen_conv_block(channels, channels, activation=False, kernel_size=3, padding=1)\n        )\n    \n    def forward(self, x):\n        return x + self.block_(x)","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:44.551607Z","iopub.execute_input":"2024-09-06T13:11:44.552027Z","iopub.status.idle":"2024-09-06T13:11:44.558765Z","shell.execute_reply.started":"2024-09-06T13:11:44.551986Z","shell.execute_reply":"2024-09-06T13:11:44.557722Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"class Generator(nn.Module):\n    def __init__(self, in_channels=3, num_residuals_blocks=9):\n        super().__init__()\n        self.initial = nn.Sequential(\n            nn.Conv2d(in_channels, 64, kernel_size=7, stride=1, padding=3, padding_mode=\"reflect\"),\n            nn.ReLU(inplace=True)\n        )\n        self.down = nn.Sequential(\n            gen_conv_block(64, 64*2, TYPE='down', kernel_size=3, stride=2, padding=1),\n            gen_conv_block(64*2, 64*4, TYPE='down', kernel_size=3, stride=2, padding=1)\n        )\n        self.residual = nn.Sequential(\n            *[res_block(64*4) for _ in range(num_residuals_blocks)]\n        )\n        self.up = nn.Sequential(\n            gen_conv_block(64*4, 64*2, TYPE='up', kernel_size=3, stride=2, padding=1, output_padding=1),\n            gen_conv_block(64*2, 64, TYPE='up', kernel_size=3, stride=2, padding=1, output_padding=1)\n        )\n        self.get_img = nn.Conv2d(64, in_channels, kernel_size=7, stride=1, padding=3, padding_mode=\"reflect\")\n        \n    def forward(self, x):\n        x = self.initial(x)\n        x = self.down(x)\n        x = self.residual(x)\n        x = self.up(x)\n        return self.get_img(x)","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:47.115879Z","iopub.execute_input":"2024-09-06T13:11:47.116775Z","iopub.status.idle":"2024-09-06T13:11:47.127184Z","shell.execute_reply.started":"2024-09-06T13:11:47.116734Z","shell.execute_reply":"2024-09-06T13:11:47.126052Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x = torch.randn((1, 3, 256, 256))\ndis = Generator()\nassert(dis(x).shape == (1, 3, 256, 256))","metadata":{"execution":{"iopub.status.busy":"2024-09-05T22:50:05.324594Z","iopub.execute_input":"2024-09-05T22:50:05.324904Z","iopub.status.idle":"2024-09-05T22:50:06.196594Z","shell.execute_reply.started":"2024-09-05T22:50:05.324872Z","shell.execute_reply":"2024-09-05T22:50:06.195567Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## CycleGAN Model","metadata":{}},{"cell_type":"code","source":"device = \"cuda\" if torch.cuda.is_available() else \"cpu\"","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:50.092061Z","iopub.execute_input":"2024-09-06T13:11:50.092453Z","iopub.status.idle":"2024-09-06T13:11:50.145134Z","shell.execute_reply.started":"2024-09-06T13:11:50.092414Z","shell.execute_reply":"2024-09-06T13:11:50.143894Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lr = 2e-4\nlambda_cycle = 10","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:51.981170Z","iopub.execute_input":"2024-09-06T13:11:51.981581Z","iopub.status.idle":"2024-09-06T13:11:51.986338Z","shell.execute_reply.started":"2024-09-06T13:11:51.981531Z","shell.execute_reply":"2024-09-06T13:11:51.985211Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"disc_photo = Discriminator().to(device)\ndisc_monet = Discriminator().to(device)\n\ngen_photo = Generator().to(device)\ngen_monet = Generator().to(device)","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:54.683119Z","iopub.execute_input":"2024-09-06T13:11:54.683981Z","iopub.status.idle":"2024-09-06T13:11:55.297286Z","shell.execute_reply.started":"2024-09-06T13:11:54.683941Z","shell.execute_reply":"2024-09-06T13:11:55.296447Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"disc_optimizer = optim.Adam(\n    list(disc_photo.parameters()) + list(disc_monet.parameters()),\n    lr=lr,\n    betas=(0.5, 0.999)\n)\n\ngen_optimizer = optim.Adam(\n    list(gen_photo.parameters()) + list(gen_monet.parameters()),\n    lr=lr,\n    betas=(0.5, 0.999)\n)","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:11:58.323872Z","iopub.execute_input":"2024-09-06T13:11:58.324873Z","iopub.status.idle":"2024-09-06T13:11:58.332111Z","shell.execute_reply.started":"2024-09-06T13:11:58.324822Z","shell.execute_reply":"2024-09-06T13:11:58.331050Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dis_scaler = torch.amp.GradScaler('cuda')\ngen_scaler = torch.amp.GradScaler('cuda')","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:12:02.041996Z","iopub.execute_input":"2024-09-06T13:12:02.042446Z","iopub.status.idle":"2024-09-06T13:12:02.047793Z","shell.execute_reply.started":"2024-09-06T13:12:02.042404Z","shell.execute_reply":"2024-09-06T13:12:02.046556Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"MSE = nn.MSELoss()\nL1 = nn.L1Loss()","metadata":{"execution":{"iopub.status.busy":"2024-09-06T13:12:03.818617Z","iopub.execute_input":"2024-09-06T13:12:03.819482Z","iopub.status.idle":"2024-09-06T13:12:03.824330Z","shell.execute_reply.started":"2024-09-06T13:12:03.819429Z","shell.execute_reply":"2024-09-06T13:12:03.823187Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Training models","metadata":{}},{"cell_type":"code","source":"epoches = 2 # Need more\n\n\nfor epoch in range(epoches):\n    running_dis_loss = 0.0\n    running_gen_loss = 0.0\n    for photo, monet in tqdm(dataloader, leave=True):\n        photo = photo.to(device)\n        monet = monet.to(device)\n        \n        # Train discriminator:\n        fake_photo = gen_photo(monet)\n        Dis_photo_real = disc_photo(photo)\n        Dis_photo_fake = disc_photo(fake_photo.detach())\n        \n        Dis_photo_loss = MSE(Dis_photo_real, torch.ones_like(Dis_photo_real)) + \\\n                         MSE(Dis_photo_fake, torch.zeros_like(Dis_photo_fake))\n        \n        fake_monet = gen_monet(photo)\n        Dis_monet_real = disc_monet(monet)\n        Dis_monet_fake = disc_monet(fake_monet.detach())\n        \n        Dis_monet_loss = MSE(Dis_monet_real, torch.ones_like(Dis_monet_real)) + \\\n                         MSE(Dis_monet_fake, torch.zeros_like(Dis_monet_fake))\n        \n        Dis_loss = (Dis_photo_loss + Dis_monet_loss) / 2.0\n        running_dis_loss += Dis_loss / len(dataloader)\n        \n        disc_optimizer.zero_grad()\n        dis_scaler.scale(Dis_loss).backward()\n        dis_scaler.step(disc_optimizer)\n        dis_scaler.update()\n        \n        # Train Generator:\n        Dis_photo_fake = disc_photo(fake_photo)\n        Dis_monet_fake = disc_monet(fake_monet)\n        \n        Gen_photo_loss = MSE(Dis_photo_fake, torch.ones_like(Dis_photo_fake))\n        Gen_monet_loss = MSE(Dis_monet_fake, torch.ones_like(Dis_monet_fake))\n        \n        Cycled_monet = gen_monet(fake_photo) \n        Cycled_photo = gen_photo(fake_monet)\n        \n        Cycled_loss = L1(monet, Cycled_monet) + L1(photo, Cycled_photo)\n        \n        Gen_loss = Gen_photo_loss + Gen_monet_loss + Cycled_loss * lambda_cycle\n        running_gen_loss += Gen_loss / len(dataloader)\n        \n        gen_optimizer.zero_grad()\n        gen_scaler.scale(Gen_loss).backward()\n        gen_scaler.step(gen_optimizer)\n        gen_scaler.update()\n    print(f\"Epoch {epoch + 1}. Generator loss by epoch: {running_gen_loss}, discriminator loss by epoch: {running_dis_loss}\")","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**It's going to be quite a long time =) Need more epoches**","metadata":{}},{"cell_type":"code","source":"torch.save(disc_photo.state_dict(), '/kaggle/working/disc_photo.pth')\ntorch.save(disc_monet.state_dict(), '/kaggle/working/disc_monet.pth')\ntorch.save(gen_photo.state_dict(), '/kaggle/working/gen_photo.pth')\ntorch.save(gen_monet.state_dict(), '/kaggle/working/gen_monet.pth')","metadata":{"execution":{"iopub.status.busy":"2024-09-06T17:35:57.261649Z","iopub.execute_input":"2024-09-06T17:35:57.262031Z","iopub.status.idle":"2024-09-06T17:35:57.443845Z","shell.execute_reply.started":"2024-09-06T17:35:57.261997Z","shell.execute_reply":"2024-09-06T17:35:57.442842Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Check results","metadata":{}},{"cell_type":"code","source":"batch = next(iter(dataloader))[0]\n\n_, ax = plt.subplots(6, 2, figsize=(12, 12))\n\ngen_monet.eval()\nfor i in range(6):\n    original_img = batch[i]\n    predicted_img = None\n    with torch.no_grad():\n        predicted_img = gen_monet(original_img.unsqueeze(0).to(device))\n    \n    ax[i, 0].imshow(original_img.permute(1, 2, 0) * 0.5 + 0.5)\n    ax[i, 1].imshow(predicted_img.squeeze(0).permute(1, 2, 0).cpu() * 0.5 + 0.5)\n    \n    ax[i, 0].set_title(\"Original photo\")\n    ax[i, 1].set_title(\"Monet like\")\n    \n    ax[i, 0].axis(\"off\")\n    ax[i, 1].axis(\"off\")\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-09-06T17:31:19.039456Z","iopub.execute_input":"2024-09-06T17:31:19.039853Z","iopub.status.idle":"2024-09-06T17:31:20.616848Z","shell.execute_reply.started":"2024-09-06T17:31:19.039815Z","shell.execute_reply":"2024-09-06T17:31:20.615913Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Submit to competition","metadata":{}},{"cell_type":"code","source":"sub_dloader = DataLoader(dataset, batch_size=1, shuffle=False)","metadata":{"execution":{"iopub.status.busy":"2024-09-06T17:30:48.963192Z","iopub.execute_input":"2024-09-06T17:30:48.963656Z","iopub.status.idle":"2024-09-06T17:30:48.969129Z","shell.execute_reply.started":"2024-09-06T17:30:48.963614Z","shell.execute_reply":"2024-09-06T17:30:48.967836Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! mkdir /kaggle/working/images","metadata":{"execution":{"iopub.status.busy":"2024-09-06T17:30:51.604814Z","iopub.execute_input":"2024-09-06T17:30:51.605706Z","iopub.status.idle":"2024-09-06T17:30:52.835876Z","shell.execute_reply.started":"2024-09-06T17:30:51.605657Z","shell.execute_reply":"2024-09-06T17:30:52.834692Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"gen_monet.eval()\n\nfor i, batch in tqdm(enumerate(sub_dloader)):\n    original_img = batch[0]\n    predicted_img = None\n    with torch.no_grad():\n        predicted_img = gen_monet(original_img.to(device))\n    predicted_img = predicted_img.squeeze(0).permute(1, 2, 0).cpu().numpy() * 127.5 + 127.5\n    img = Image.fromarray(predicted_img.astype(np.uint8))\n    img.save(\"/kaggle/working/images/\" + str(i) + \".jpg\")","metadata":{"execution":{"iopub.status.busy":"2024-09-06T17:31:33.494811Z","iopub.execute_input":"2024-09-06T17:31:33.495848Z","iopub.status.idle":"2024-09-06T17:35:25.332639Z","shell.execute_reply.started":"2024-09-06T17:31:33.495802Z","shell.execute_reply":"2024-09-06T17:35:25.331636Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import shutil\nshutil.make_archive(\"/kaggle/working/images\", 'zip', \"/kaggle/working/images\")","metadata":{"execution":{"iopub.status.busy":"2024-09-06T17:35:29.060113Z","iopub.execute_input":"2024-09-06T17:35:29.060501Z","iopub.status.idle":"2024-09-06T17:35:38.752952Z","shell.execute_reply.started":"2024-09-06T17:35:29.060462Z","shell.execute_reply":"2024-09-06T17:35:38.752062Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! rm -rf /kaggle/working/images","metadata":{"execution":{"iopub.status.busy":"2024-09-06T17:35:51.507725Z","iopub.execute_input":"2024-09-06T17:35:51.508637Z","iopub.status.idle":"2024-09-06T17:35:52.859123Z","shell.execute_reply.started":"2024-09-06T17:35:51.508582Z","shell.execute_reply":"2024-09-06T17:35:52.858039Z"},"trusted":true},"execution_count":null,"outputs":[]}]}