{"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":45867,"databundleVersionId":6924515,"sourceType":"competition"},{"sourceId":147642168,"sourceType":"kernelVersion"}],"dockerImageVersionId":30558,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import os\nimport pandas as pd\nfrom tqdm.notebook import tqdm","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-11-30T07:53:26.022767Z","iopub.execute_input":"2023-11-30T07:53:26.023076Z","iopub.status.idle":"2023-11-30T07:53:26.562645Z","shell.execute_reply.started":"2023-11-30T07:53:26.02305Z","shell.execute_reply":"2023-11-30T07:53:26.561445Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv(\"/kaggle/input/UBC-OCEAN/train.csv\")\ndf","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"RESIZE = 2048\nPART = 1\nSZ = 100\nDIR_REIZE = f\"crop_train_images_2048\"\n\n!mkdir -p {DIR_REIZE}\nfor image_id in tqdm(df[\"image_id\"].values[(PART - 1) * SZ : PART * SZ]):\n    !python /kaggle/input/script-resize/resize.py --imgsize {RESIZE} --input /kaggle/input/UBC-OCEAN/train_images/{image_id}.png --output {DIR_REIZE}/{image_id}.png","metadata":{"execution":{"iopub.status.busy":"2023-11-30T07:53:29.654904Z","iopub.execute_input":"2023-11-30T07:53:29.655407Z","iopub.status.idle":"2023-11-30T07:53:29.660671Z","shell.execute_reply.started":"2023-11-30T07:53:29.655376Z","shell.execute_reply":"2023-11-30T07:53:29.659575Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"PART2 = 2\nfor image_id in tqdm(df[\"image_id\"].values[(PART2 - 1) * SZ : PART2 * SZ]):\n    !python /kaggle/input/script-resize/resize.py --imgsize {RESIZE} --input /kaggle/input/UBC-OCEAN/train_images/{image_id}.png --output {DIR_REIZE}/{image_id}.png","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"PART3 = 3\nfor image_id in tqdm(df[\"image_id\"].values[(PART3 - 1) * SZ : PART3 * SZ]):\n    !python /kaggle/input/script-resize/resize.py --imgsize {RESIZE} --input /kaggle/input/UBC-OCEAN/train_images/{image_id}.png --output {DIR_REIZE}/{image_id}.png","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"PART4 = 4\nfor image_id in tqdm(df[\"image_id\"].values[(PART4 - 1) * SZ : PART4 * SZ]):\n    !python /kaggle/input/script-resize/resize.py --imgsize {RESIZE} --input /kaggle/input/UBC-OCEAN/train_images/{image_id}.png --output {DIR_REIZE}/{image_id}.png","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"PART5 = 5\nfor image_id in tqdm(df[\"image_id\"].values[(PART5 - 1) * SZ : PART5 * SZ]):\n    !python /kaggle/input/script-resize/resize.py --imgsize {RESIZE} --input /kaggle/input/UBC-OCEAN/train_images/{image_id}.png --output {DIR_REIZE}/{image_id}.png","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"PART6 = 6\nfor image_id in tqdm(df[\"image_id\"].values[(PART6 - 1) * SZ : ]):\n    !python /kaggle/input/script-resize/resize.py --imgsize {RESIZE} --input /kaggle/input/UBC-OCEAN/train_images/{image_id}.png --output {DIR_REIZE}/{image_id}.png","metadata":{},"execution_count":null,"outputs":[]}]}