{"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":"nvidiaTeslaT4","dataSources":[{"sourceId":21755,"databundleVersionId":1475600,"sourceType":"competition"}],"dockerImageVersionId":30665,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# !pip install kaggle\n# !pip install torch\n# !pip install torchvision\n# ! pip install albumentations\n\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-04-23T04:55:11.526340Z","iopub.execute_input":"2024-04-23T04:55:11.526598Z","iopub.status.idle":"2024-04-23T04:55:11.539905Z","shell.execute_reply.started":"2024-04-23T04:55:11.526576Z","shell.execute_reply":"2024-04-23T04:55:11.539096Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"code","source":"import os\nimport torchvision\nimport torch\nfrom torchvision.io import read_image\nfrom torchvision import datasets, transforms\nfrom torch.utils.data import Dataset, DataLoader\nfrom PIL import Image\nimport torch.nn as nn","metadata":{"execution":{"iopub.status.busy":"2024-04-23T04:55:11.542313Z","iopub.execute_input":"2024-04-23T04:55:11.542614Z","iopub.status.idle":"2024-04-23T04:55:14.751629Z","shell.execute_reply.started":"2024-04-23T04:55:11.542591Z","shell.execute_reply":"2024-04-23T04:55:14.750694Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"DEVICE = \"cuda\" if torch.cuda.is_available() else \"cpu\"\nprint(DEVICE)\n","metadata":{"execution":{"iopub.status.busy":"2024-04-23T04:55:14.752734Z","iopub.execute_input":"2024-04-23T04:55:14.753295Z","iopub.status.idle":"2024-04-23T04:55:14.810526Z","shell.execute_reply.started":"2024-04-23T04:55:14.753267Z","shell.execute_reply":"2024-04-23T04:55:14.809523Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Create Dataset for Monet and Photos","metadata":{}},{"cell_type":"code","source":"from PIL import Image\nimport os\nfrom torch.utils.data import Dataset\nimport numpy as np\n\n\nclass CustomImageDataset(Dataset):\n    def __init__(self, photo_dir, monet_dir, transform=None):\n        self.photo_dir = photo_dir\n        self.monet_dir = monet_dir\n        \n        self.photo_images = os.listdir(photo_dir)\n        self.monet_images = os.listdir(monet_dir)\n        self.length_dataset = max(len(self.photo_images), len(self.monet_images))\n        self.photo_len = len(self.photo_images)\n        self.monet_len = len(self.monet_images)\n        \n        self.transform = transform\n    \n\n    def __len__(self):\n        return self.length_dataset\n\n    def __getitem__(self, index):\n        photo_img = self.photo_images[index % self.photo_len]\n        monet_img = self.monet_images[index % self.monet_len]\n\n        photo_file = os.path.join(self.photo_dir, photo_img)\n        monet_file = os.path.join(self.monet_dir, monet_img)\n\n        photo_img = np.array(Image.open(photo_file).convert(\"RGB\"))\n        monet_img = np.array(Image.open(monet_file).convert(\"RGB\"))\n        if self.transform:\n            augmentations = self.transform(image=photo_img, image0=monet_img)\n            photo_img = augmentations[\"image\"]\n            monet_img = augmentations[\"image0\"]\n        return photo_img, monet_img","metadata":{"execution":{"iopub.status.busy":"2024-04-23T04:55:14.811538Z","iopub.execute_input":"2024-04-23T04:55:14.811818Z","iopub.status.idle":"2024-04-23T04:55:14.839375Z","shell.execute_reply.started":"2024-04-23T04:55:14.811793Z","shell.execute_reply":"2024-04-23T04:55:14.838658Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"markdown","source":"# Create a descriminator","metadata":{}},{"cell_type":"code","source":"import torch.nn as nn\nimport torch \n\nclass Discriminator(nn.Module):\n    def __init__(self, in_channels=3, features=[64, 128, 256, 512]):\n        super().__init__()\n        self.initial_layer = nn.Sequential(\n            nn.Conv2d(\n                in_channels,\n                features[0],\n                kernel_size=4,\n                stride=2,\n                padding=1,\n                padding_mode=\"reflect\",\n            ),\n            nn.LeakyReLU(0.2, inplace=True),\n        )\n\n        layers = []\n        in_channels = features[0]\n        for feature in features[1:]:\n            layers.append(\n                ConvInstanceNormLeakyReLUBlock(\n                    in_channels, \n                    feature, \n                    stride=1 if feature == features[-1] else 2,\n                )\n            )\n            in_channels = feature\n        layers.append(\n            nn.Conv2d(\n                in_channels,\n                1,\n                kernel_size=4,\n                stride=1,\n                padding=1,\n                padding_mode=\"reflect\",\n            )\n        )\n        self.model = nn.Sequential(*layers)\n\n    def forward(self, x):\n        x = self.initial_layer(x)\n        return torch.sigmoid(self.model(x))\n    \nclass ConvInstanceNormLeakyReLUBlock(nn.Module):\n    def __init__(self, in_channels: int, out_channels: int, stride: int):\n        super().__init__()\n        self.conv = nn.Sequential(\n            nn.Conv2d(\n                in_channels,\n                out_channels,\n                kernel_size=4,\n                stride=stride,\n                padding=1,\n                bias=True,\n                padding_mode=\"reflect\",\n            ),\n            nn.InstanceNorm2d(out_channels),\n            nn.LeakyReLU(0.2, inplace=True),\n        )\n\n    def forward(self, x):\n        return self.conv(x)\n    ","metadata":{"execution":{"iopub.status.busy":"2024-04-23T04:55:14.840503Z","iopub.execute_input":"2024-04-23T04:55:14.840834Z","iopub.status.idle":"2024-04-23T04:55:14.853017Z","shell.execute_reply.started":"2024-04-23T04:55:14.840800Z","shell.execute_reply":"2024-04-23T04:55:14.852257Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Create a Generator","metadata":{}},{"cell_type":"code","source":"import torch.nn as nn\n\nclass ConvolutionalBlock(nn.Module):\n    def __init__(\n        self,\n        in_channels: int,\n        out_channels: int,\n        is_downsampling: bool = True,\n        add_activation: bool = True,\n        **kwargs\n    ):\n        super().__init__()\n        if is_downsampling:\n            self.conv = nn.Sequential(\n                nn.Conv2d(in_channels, out_channels, padding_mode=\"reflect\", **kwargs),\n                nn.InstanceNorm2d(out_channels),\n                nn.ReLU(inplace=True) if add_activation else nn.Identity(),\n            )\n        else:\n            self.conv = nn.Sequential(\n                nn.ConvTranspose2d(in_channels, out_channels, **kwargs),\n                nn.InstanceNorm2d(out_channels),\n                nn.ReLU(inplace=True) if add_activation else nn.Identity(),\n            )\n\n    def forward(self, x):\n        return self.conv(x)\n    \n\nclass ResidualBlock(nn.Module):\n    def __init__(self, channels: int):\n        \n        super().__init__()\n        self.block = nn.Sequential(\n            ConvolutionalBlock(channels, channels, add_activation=True, kernel_size=3, padding=1),\n            ConvolutionalBlock(channels, channels, add_activation=False, kernel_size=3, padding=1),\n        )\n\n    def forward(self, x):\n        return x + self.block(x)   \n\nclass Generator(nn.Module):\n    def __init__(\n        self, img_channels: int, num_features: int = 64, num_residuals: int = 6\n    ):\n        super().__init__()\n        self.initial_layer = nn.Sequential(\n            nn.Conv2d(\n                img_channels,\n                num_features,\n                kernel_size=7,\n                stride=1,\n                padding=3,\n                padding_mode=\"reflect\",\n            ),\n            nn.ReLU(inplace=True),\n        )\n\n        self.downsampling_layers = nn.ModuleList(\n            [\n                ConvolutionalBlock(\n                    num_features, \n                    num_features * 2,\n                    is_downsampling=True, \n                    kernel_size=3, \n                    stride=2, \n                    padding=1,\n                ),\n                ConvolutionalBlock(\n                    num_features * 2,\n                    num_features * 4,\n                    is_downsampling=True,\n                    kernel_size=3,\n                    stride=2,\n                    padding=1,\n                ),\n            ]\n        )\n\n        self.residual_layers = nn.Sequential(\n            *[ResidualBlock(num_features * 4) for _ in range(num_residuals)]\n        )\n\n        self.upsampling_layers = nn.ModuleList(\n            [\n                ConvolutionalBlock(\n                    num_features * 4,\n                    num_features * 2,\n                    is_downsampling=False,\n                    kernel_size=3,\n                    stride=2,\n                    padding=1,\n                    output_padding=1,\n                ),\n                ConvolutionalBlock(\n                    num_features * 2,\n                    num_features * 1,\n                    is_downsampling=False,\n                    kernel_size=3,\n                    stride=2,\n                    padding=1,\n                    output_padding=1,\n                ),\n            ]\n        )\n\n        self.last_layer = nn.Conv2d(\n            num_features * 1,\n            img_channels,\n            kernel_size=7,\n            stride=1,\n            padding=3,\n            padding_mode=\"reflect\",\n        )\n\n    def forward(self, x):\n        x = self.initial_layer(x)\n        for layer in self.downsampling_layers:\n            x = layer(x)\n        x = self.residual_layers(x)\n        for layer in self.upsampling_layers:\n            x = layer(x)\n        return torch.tanh(self.last_layer(x))\n    ","metadata":{"execution":{"iopub.status.busy":"2024-04-23T04:55:14.854352Z","iopub.execute_input":"2024-04-23T04:55:14.854603Z","iopub.status.idle":"2024-04-23T04:55:14.873085Z","shell.execute_reply.started":"2024-04-23T04:55:14.854581Z","shell.execute_reply":"2024-04-23T04:55:14.872331Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Keep on adding files to zip file","metadata":{}},{"cell_type":"code","source":"import zipfile\nimport os\n\nzip_filename = '/kaggle/working/monet_jpg.zip'\n\ndef add_files_to_zip(file_to_add):\n    with zipfile.ZipFile(zip_filename, \"a\") as zip_ref:\n        zip_ref.write(file_to_add)\n        zip_ref.close()\n    os.remove(file_to_add)","metadata":{"execution":{"iopub.status.busy":"2024-04-23T04:55:14.982712Z","iopub.execute_input":"2024-04-23T04:55:14.983022Z","iopub.status.idle":"2024-04-23T04:55:14.988377Z","shell.execute_reply.started":"2024-04-23T04:55:14.982996Z","shell.execute_reply":"2024-04-23T04:55:14.987361Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Train model","metadata":{}},{"cell_type":"code","source":"import torch\nimport sys\nfrom torch.utils.data import DataLoader\nimport torch.nn as nn\nimport torch.optim as optim\nfrom tqdm import tqdm\nfrom torchvision.utils import save_image\n\ndef train_model(device,\n    discriminator_photo, discriminator_monet, generator_photo, generator_monet, \n    loader, opt_disc, opt_gen, l1, mse, d_scaler, g_scaler\n):\n    Photo_real = 0\n    Photo_fake = 0\n    LAMBDA_ADVERS = 1\n    LAMBDA_IDENTITY = 0.5\n    LAMBDA_CYCLE = 10\n    \n    loop = tqdm(loader, leave=True)\n    print(loop)\n    count = 0\n    \n    # Train Descriminator\n    for idx, (photo, monet) in enumerate(loop):\n        count+=1\n        print(f'@@@@@@ Count {count}')\n        photo = photo.to(device)\n        monet = monet.to(device)\n\n        with torch.cuda.amp.autocast():\n            fake_photo = generator_photo(monet)\n            D_photo_real = discriminator_photo(photo)\n            D_photo_fake = discriminator_photo(fake_photo.detach())\n            Photo_real += D_photo_real.mean().item()\n            Photo_fake += D_photo_fake.mean().item()\n            D_Photo_real_loss = mse(D_photo_real, torch.ones_like(D_photo_real))\n            D_Photo_fake_loss = mse(D_photo_fake, torch.zeros_like(D_photo_fake))\n            D_Photo_loss = D_Photo_real_loss + D_Photo_fake_loss\n\n            fake_monet = generator_monet(photo)\n            D_monet_real = discriminator_monet(monet)\n            D_monet_fake = discriminator_monet(fake_monet.detach())\n            D_monet_real_loss = mse(D_monet_real, torch.ones_like(D_monet_real))\n            D_monet_fake_loss = mse(D_monet_fake, torch.zeros_like(D_monet_fake))\n            D_monet_loss = D_monet_real_loss + D_monet_fake_loss\n\n            D_loss = (D_Photo_loss + D_monet_loss) / 2\n\n        opt_disc.zero_grad()\n        d_scaler.scale(D_loss).backward()\n        d_scaler.step(opt_disc)\n        d_scaler.update()\n\n        # Train generators\n        with torch.cuda.amp.autocast():\n            # adversarial losses\n            D_photo_fake = discriminator_photo(fake_photo)\n            D_monet_fake = discriminator_monet(fake_monet)\n            loss_G_Photo = mse(D_photo_fake, torch.ones_like(D_photo_fake))\n            loss_G_Monet = mse(D_monet_fake, torch.ones_like(D_monet_fake))\n            \n            loss_advers = loss_G_Photo + loss_G_Monet\n            \n\n            # cycle losses\n            cycle_monet = generator_monet(fake_photo)\n            cycle_photo = generator_photo(fake_monet)\n            cycle_monet_loss = l1(monet, cycle_monet)\n            cycle_photo_loss = l1(photo, cycle_photo)\n            \n            loss_cycle= cycle_monet_loss + cycle_photo_loss\n                \n            \n            # identity losses\n            identity_monet = generator_monet(monet)\n            identity_photo = generator_photo(photo)\n            identity_monet_loss = l1(monet, identity_monet)\n            identity_photo_loss = l1(photo, identity_photo)\n            \n            loss_identity= identity_monet_loss + identity_photo_loss\n            \n        \n            # total loss\n            generator_loss = (loss_advers * LAMBDA_ADVERS + loss_cycle * LAMBDA_CYCLE + loss_identity * LAMBDA_IDENTITY)\n               \n\n        opt_gen.zero_grad()\n        g_scaler.scale(generator_loss).backward()\n        g_scaler.step(opt_gen)\n        g_scaler.update()\n        \n        if idx % 200 == 0:\n            save_image(fake_monet * 0.5 + 0.5, f\"/kaggle/working/monet_{idx}.jpg\")\n            add_files_to_zip(f\"/kaggle/working/monet_{idx}.jpg\")\n            \n        loop.set_postfix(Photo_real=Photo_real / (idx + 1), \n                         Photo_fake=Photo_fake / (idx + 1), \n                         generator_loss = generator_loss.item() / (idx +1))\n        \n        ","metadata":{"execution":{"iopub.status.busy":"2024-04-23T04:55:18.468713Z","iopub.execute_input":"2024-04-23T04:55:18.469735Z","iopub.status.idle":"2024-04-23T04:55:18.486956Z","shell.execute_reply.started":"2024-04-23T04:55:18.469693Z","shell.execute_reply":"2024-04-23T04:55:18.486084Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def save_checkpoint(model, optimizer, filename=\"models/checkpoint.pth.tar\"):\n    print(\"=> Saving checkpoint\")\n    checkpoint = {\n        \"state_dict\": model.state_dict(),\n        \"optimizer\": optimizer.state_dict(),\n    }\n    torch.save(checkpoint, filename)\n\n\ndef load_checkpoint(checkpoint_file, model, optimizer, lr):\n    print(\"=> Loading checkpoint\")\n    checkpoint = torch.load(checkpoint_file, map_location=DEVICE)\n    model.load_state_dict(checkpoint[\"state_dict\"])\n    optimizer.load_state_dict(checkpoint[\"optimizer\"])\n\n    for param_group in optimizer.param_groups:\n        param_group[\"lr\"] = lr","metadata":{"execution":{"iopub.status.busy":"2024-04-08T20:34:59.262639Z","iopub.execute_input":"2024-04-08T20:34:59.263036Z","iopub.status.idle":"2024-04-08T20:34:59.268977Z","shell.execute_reply.started":"2024-04-08T20:34:59.263004Z","shell.execute_reply":"2024-04-08T20:34:59.268126Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Define parameters","metadata":{}},{"cell_type":"code","source":"import albumentations as A\nfrom albumentations.pytorch import ToTensorV2\n\nDEVICE = \"cuda\" if torch.cuda.is_available() else \"cpu\"\nphoto_path = '/kaggle/input/gan-getting-started/photo_jpg'\nmonet_path = '/kaggle/input/gan-getting-started/monet_jpg'\n\nCHECKPOINT_GENERATOR_photo = \"/kaggle/working/gen_photo.pth.tar\"\nCHECKPOINT_GENERATOR_monet = \"/kaggle/working/gen_monet.pth.tar\"\nCHECKPOINT_DISCRIMINATOR_photo = \"/kaggle/working/disc_photo.pth.tar\"\nCHECKPOINT_DISCRIMINATOR_monet = \"/kaggle/working/disc_monet.tar\"\n\n\ntransforms = A.Compose(\n[\n    A.Resize(width=256, height=256),\n    A.HorizontalFlip(p=0.5),\n    A.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5], max_pixel_value=255),\n    ToTensorV2(),\n],\nadditional_targets={\"image0\": \"image\"},\n)\n\nLEARNING_RATE = 1e-5\nBATCH_SIZE = 1\nLEARNING_RATE = 1e-5\nNUM_WORKERS = 4\nNUM_EPOCHS = 10\nLOAD_MODEL = True\nSAVE_MODEL = True","metadata":{"execution":{"iopub.status.busy":"2024-04-08T20:36:36.501288Z","iopub.execute_input":"2024-04-08T20:36:36.501720Z","iopub.status.idle":"2024-04-08T20:36:39.489419Z","shell.execute_reply.started":"2024-04-08T20:36:36.501684Z","shell.execute_reply":"2024-04-08T20:36:39.488628Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Instantiate the generator, discrimators for both photo and monet","metadata":{}},{"cell_type":"code","source":"disc_photo = Discriminator(in_channels=3).to(DEVICE)\ndisc_monet = Discriminator(in_channels=3).to(DEVICE)\ngen_photo = Generator(img_channels=3, num_residuals=6).to(DEVICE)\ngen_monet = Generator(img_channels=3, num_residuals=6).to(DEVICE)\n\n# use Adam Optimizer for both generator and discriminator\nopt_disc = optim.Adam(\n    list(disc_photo.parameters()) + list(disc_monet.parameters()),\n    lr=LEARNING_RATE,\n    betas=(0.5, 0.999),\n)\n\nopt_gen = optim.Adam(\n    list(gen_photo.parameters()) + list(gen_monet.parameters()),\n    lr=LEARNING_RATE,\n    betas=(0.5, 0.999),\n)\n\nL1 = nn.L1Loss()\nmse = nn.MSELoss()\n\n\ndataset = CustomImageDataset(\n    photo_path,\n    monet_path,\n    transform=transforms,\n)\n\nloader = DataLoader(\n    dataset,\n    batch_size=BATCH_SIZE,\n    shuffle=True,\n    num_workers=NUM_WORKERS,\n    pin_memory=True,\n)\ng_scaler = torch.cuda.amp.GradScaler()\nd_scaler = torch.cuda.amp.GradScaler()","metadata":{"execution":{"iopub.status.busy":"2024-04-08T20:36:44.631114Z","iopub.execute_input":"2024-04-08T20:36:44.631772Z","iopub.status.idle":"2024-04-08T20:36:45.148205Z","shell.execute_reply.started":"2024-04-08T20:36:44.631737Z","shell.execute_reply":"2024-04-08T20:36:45.147252Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\nimport torch.nn as nn\nimport torch\nimport torch.optim as optim\nfrom tqdm import tqdm\n\ndef main():\n\n    for epoch in range(NUM_EPOCHS):\n        train_model(\n            DEVICE,\n            disc_photo,\n            disc_monet,\n            gen_monet,\n            gen_photo,\n            loader,\n            opt_disc,\n            opt_gen,\n            L1,\n            mse,\n            d_scaler,\n            g_scaler,\n        )\n\n        if SAVE_MODEL:\n            save_checkpoint(gen_photo, opt_gen, filename=CHECKPOINT_GENERATOR_photo)\n            save_checkpoint(gen_monet, opt_gen, filename=CHECKPOINT_GENERATOR_monet)\n            save_checkpoint(disc_photo, opt_disc, filename=CHECKPOINT_DISCRIMINATOR_photo)\n            save_checkpoint(disc_monet, opt_disc, filename=CHECKPOINT_DISCRIMINATOR_monet)\n\n\nmain()","metadata":{"execution":{"iopub.status.busy":"2024-04-08T20:36:50.136018Z","iopub.execute_input":"2024-04-08T20:36:50.137059Z","iopub.status.idle":"2024-04-08T20:36:50.854558Z","shell.execute_reply.started":"2024-04-08T20:36:50.137012Z","shell.execute_reply":"2024-04-08T20:36:50.853387Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Load Saved Model and check ","metadata":{}},{"cell_type":"code","source":"load_checkpoint(CHECKPOINT_GENERATOR_monet,  gen_monet,\n            opt_gen,\n            LEARNING_RATE)","metadata":{"execution":{"iopub.status.busy":"2024-04-08T12:23:14.406062Z","iopub.execute_input":"2024-04-08T12:23:14.406741Z","iopub.status.idle":"2024-04-08T12:23:14.558480Z","shell.execute_reply.started":"2024-04-08T12:23:14.406704Z","shell.execute_reply":"2024-04-08T12:23:14.557571Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the result of generated monet","metadata":{"execution":{"iopub.status.busy":"2024-04-08T06:42:45.472316Z","iopub.execute_input":"2024-04-08T06:42:45.473001Z","iopub.status.idle":"2024-04-08T06:42:45.477433Z","shell.execute_reply.started":"2024-04-08T06:42:45.472966Z","shell.execute_reply":"2024-04-08T06:42:45.476258Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"code","source":"import torchvision.transforms as transforms\nphoto_np = np.array(Image.open('/kaggle/input/gan-getting-started/photo_jpg/00068bc07f.jpg').convert(\"RGB\"))\n\nsingle_transform = transforms.Compose([\n    transforms.ToTensor(),\n    transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])\n])\n\nphoto_tensor = single_transform(photo_np) \nphoto_tensor = photo_tensor.to(DEVICE)\n\nmonet_pic = gen_monet(photo_tensor)\nsave_image(monet_pic * 0.5 + 0.5, f\"/kaggle/working/generated_monet_00068bc07f.jpg\")","metadata":{"execution":{"iopub.status.busy":"2024-04-08T20:00:54.193993Z","iopub.execute_input":"2024-04-08T20:00:54.194554Z","iopub.status.idle":"2024-04-08T20:00:55.137132Z","shell.execute_reply.started":"2024-04-08T20:00:54.194500Z","shell.execute_reply":"2024-04-08T20:00:55.136024Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import os\nos.rename('/kaggle/working/monet_jpg.zip', '/kaggle/working/images.zip')","metadata":{"execution":{"iopub.status.busy":"2024-04-08T20:43:58.437100Z","iopub.execute_input":"2024-04-08T20:43:58.437539Z","iopub.status.idle":"2024-04-08T20:43:58.443570Z","shell.execute_reply.started":"2024-04-08T20:43:58.437505Z","shell.execute_reply":"2024-04-08T20:43:58.442162Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}