{"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":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\n# import os\n# for dirname, _, filenames in os.walk('/kaggle/input'):\n#     for filename in filenames:\n#         print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-10-31T02:35:40.379141Z","iopub.execute_input":"2023-10-31T02:35:40.379550Z","iopub.status.idle":"2023-10-31T02:35:40.385456Z","shell.execute_reply.started":"2023-10-31T02:35:40.379521Z","shell.execute_reply":"2023-10-31T02:35:40.384362Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"hi\")","metadata":{"execution":{"iopub.status.busy":"2023-10-31T02:35:42.772149Z","iopub.execute_input":"2023-10-31T02:35:42.772572Z","iopub.status.idle":"2023-10-31T02:35:42.778723Z","shell.execute_reply.started":"2023-10-31T02:35:42.772537Z","shell.execute_reply":"2023-10-31T02:35:42.777495Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## ML Libraries","metadata":{}},{"cell_type":"code","source":"import torch\nimport torchvision\nimport torchvision.transforms as transforms\nimport matplotlib.pyplot as plt\n# import matplotlib.image as mpimg\nfrom skimage.io import imread, imshow\n# !pip install scikit-image --quiet","metadata":{"execution":{"iopub.status.busy":"2023-10-31T02:39:59.030217Z","iopub.execute_input":"2023-10-31T02:39:59.030611Z","iopub.status.idle":"2023-10-31T02:39:59.035929Z","shell.execute_reply.started":"2023-10-31T02:39:59.030578Z","shell.execute_reply":"2023-10-31T02:39:59.034883Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Show Samples","metadata":{}},{"cell_type":"code","source":"fig, axes = plt.subplots(1, 4, figsize=(18, 8))\n\nALASKA2_ROOT_PATH = '/kaggle/input/alaska2-image-steganalysis/'\n\nsample_cover = imread(ALASKA2_ROOT_PATH + 'Cover/00001.jpg')\nsample_jmipod = imread(ALASKA2_ROOT_PATH + 'JMiPOD/00001.jpg')\nsample_juniward = imread(ALASKA2_ROOT_PATH + 'JUNIWARD/00001.jpg')\nsample_uerd = imread(ALASKA2_ROOT_PATH + 'UERD/00001.jpg')\n\naxes[0].imshow(sample_cover)\naxes[1].imshow(sample_jmipod)\naxes[2].imshow(sample_juniward)\naxes[3].imshow(sample_uerd)","metadata":{"execution":{"iopub.status.busy":"2023-10-31T02:42:58.741685Z","iopub.execute_input":"2023-10-31T02:42:58.742829Z","iopub.status.idle":"2023-10-31T02:42:59.921023Z","shell.execute_reply.started":"2023-10-31T02:42:58.742788Z","shell.execute_reply":"2023-10-31T02:42:59.919871Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Load and Transform Data","metadata":{}},{"cell_type":"code","source":"from torchvision.transforms import v2\n\n# If we want to add rotation\n# rotation_angles = [90, 180, 270]\n# random_rotation = transforms.Compose([\n#     transforms.RandomChoice([transforms.RandomRotation(angle) for angle in rotation_angles])\n# ])\n\ntransforms = v2.Compose([\n    v2.RandomHorizontalFlip(), # Random augmentations\n    v2.RandomVerticalFlip(),\n    v2.ToTensor(), # convert from nparray -> tensor\n    v2.ToDtype(torch.float32, scale=True), # int -> float\n    v2.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5]), # normalize all channels to have mean and std of 0.5\n])\n\nlabelToID = {\n    \"Cover\": 0,\n    \"JMiPOD\": 1,\n    \"JUNIWARD\": 2,\n    \"UERD\": 3\n}\n\ndef load_images(label, amount):\n    ","metadata":{},"execution_count":null,"outputs":[]}]}