{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.12.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceType":"competition","sourceId":31703,"databundleVersionId":2871752},{"sourceType":"modelInstanceVersion","sourceId":891248,"databundleVersionId":17562174,"modelInstanceId":677092,"modelId":688724}],"dockerImageVersionId":31400,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import subprocess\n\nREPO = \"/kaggle/input/models/sherifmohsenhamed/rt-detr-6/pytorch/default/1/aml2026-group-08\"\nRTDETR_ROOT = f\"{REPO}/third_party/RT-DETR/rtdetrv2_pytorch\"\n\nCONFIGS = \",\".join([\n    f\"{REPO}/residual_preproc_patch_allfolds_rope/fold_0/config.yml\",\n    f\"{REPO}/residual_preproc_patch_allfolds_rope/fold_1/config.yml\",\n    f\"{REPO}/residual_preproc_patch_allfolds_rope/fold_2/config.yml\",\n])\n\nCHECKPOINTS = \",\".join([\n    f\"{REPO}/residual_preproc_patch_allfolds_rope/fold_0/run/best_ar.pth\",\n    f\"{REPO}/residual_preproc_patch_allfolds_rope/fold_1/run/best_ar.pth\",\n    f\"{REPO}/residual_preproc_patch_allfolds_rope/fold_2/run/best_ar.pth\",\n])\n\ncmd = [\n    \"bash\", \"-lc\",\n    \"source /kaggle/working/miniconda/etc/profile.d/conda.sh && \"\n    \"conda activate py37 && \"\n    \"python \"\n    f\"{REPO}/scripts/kaggle_reef_submission.py \"\n    \"--rtdetr-root \" + RTDETR_ROOT + \" \"\n    \"--configs \" + CONFIGS + \" \"\n    \"--checkpoints \" + CHECKPOINTS + \" \"\n    \"--device cuda\" + \" \"\n]\n\nprint(\"Running:\", \" \".join(cmd))\nsubprocess.run(cmd, check=True)","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2026-05-31T12:39:25.598254Z","iopub.execute_input":"2026-05-31T12:39:25.599193Z","iopub.status.idle":"2026-05-31T12:39:44.639970Z","shell.execute_reply.started":"2026-05-31T12:39:25.599147Z","shell.execute_reply":"2026-05-31T12:39:44.639240Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!ln -s /kaggle/input/competitions/tensorflow-great-barrier-reef/example_test.npy \\\n  /kaggle/working/aml2026-group-08/scripts/example_test.npy","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-05-31T11:31:46.595495Z","iopub.execute_input":"2026-05-31T11:31:46.595919Z","iopub.status.idle":"2026-05-31T11:31:46.714243Z","shell.execute_reply.started":"2026-05-31T11:31:46.595889Z","shell.execute_reply":"2026-05-31T11:31:46.713304Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import sys, torch, torchvision\nprint(\"Python:\", sys.version)\nprint(\"Torch:\", torch.__version__)\nprint(\"Torchvision:\", torchvision.__version__)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-05-31T08:03:52.324634Z","iopub.execute_input":"2026-05-31T08:03:52.324921Z","iopub.status.idle":"2026-05-31T08:04:05.684337Z","shell.execute_reply.started":"2026-05-31T08:03:52.324896Z","shell.execute_reply":"2026-05-31T08:04:05.683468Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!bash -lc \"set -x; \\\nwget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh; \\\nbash /tmp/miniconda.sh -b -p /kaggle/working/miniconda; \\\nls -la /kaggle/working/miniconda/etc/profile.d\"","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-05-31T10:46:51.536861Z","iopub.execute_input":"2026-05-31T10:46:51.537727Z","iopub.status.idle":"2026-05-31T10:47:06.958084Z","shell.execute_reply.started":"2026-05-31T10:46:51.537676Z","shell.execute_reply":"2026-05-31T10:47:06.957313Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!bash -lc \"source /kaggle/working/miniconda/etc/profile.d/conda.sh && \\\nconda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \\\nconda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r && \\\nconda create -y -n py37 python=3.7\"","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-05-31T10:47:11.333433Z","iopub.execute_input":"2026-05-31T10:47:11.334086Z","iopub.status.idle":"2026-05-31T10:47:24.360527Z","shell.execute_reply.started":"2026-05-31T10:47:11.334049Z","shell.execute_reply":"2026-05-31T10:47:24.359838Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!bash -lc \"source /kaggle/working/miniconda/etc/profile.d/conda.sh && \\\nconda activate py37 && \\\npython -m pip install scipy tensorboard\"","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-05-31T10:47:50.542983Z","iopub.execute_input":"2026-05-31T10:47:50.543862Z","iopub.status.idle":"2026-05-31T10:48:07.114662Z","shell.execute_reply.started":"2026-05-31T10:47:50.543822Z","shell.execute_reply":"2026-05-31T10:48:07.113943Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!bash -lc \"source /kaggle/working/miniconda/etc/profile.d/conda.sh && \\\nconda activate py37 && \\\npython -m pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 \\\n  --extra-index-url https://download.pytorch.org/whl/cu117 && \\\npython -m pip install pyyaml pillow pandas numpy\"","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-05-31T10:48:12.260869Z","iopub.execute_input":"2026-05-31T10:48:12.261315Z","iopub.status.idle":"2026-05-31T10:49:31.896234Z","shell.execute_reply.started":"2026-05-31T10:48:12.261280Z","shell.execute_reply":"2026-05-31T10:49:31.894242Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"from pathlib import Path\nprint(Path(\"/kaggle/input/competitions/tensorflow-great-barrier-reef/example_test.npy\").exists())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-05-31T11:44:55.128220Z","iopub.execute_input":"2026-05-31T11:44:55.128887Z","iopub.status.idle":"2026-05-31T11:44:55.135395Z","shell.execute_reply.started":"2026-05-31T11:44:55.128856Z","shell.execute_reply":"2026-05-31T11:44:55.134597Z"}},"outputs":[],"execution_count":null}]}