{"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":"markdown","source":"# Functional Tissue Units Segmentation\n\nIn this notebook, we will use the trained weights to submit our solution.","metadata":{}},{"cell_type":"markdown","source":"## Installing Dependencies","metadata":{}},{"cell_type":"code","source":"%cd /kaggle/working\n!cp /kaggle/input/model-dependencies/content /kaggle/working/dependencies.tar.gz\n!tar -xzf dependencies.tar.gz\n!rm dependencies.tar.gz","metadata":{"execution":{"iopub.status.busy":"2023-03-28T15:02:22.073528Z","iopub.execute_input":"2023-03-28T15:02:22.074683Z","iopub.status.idle":"2023-03-28T15:03:05.959284Z","shell.execute_reply.started":"2023-03-28T15:02:22.074625Z","shell.execute_reply":"2023-03-28T15:03:05.957878Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install --disable-pip-version-check \\\n    /kaggle/working/dependencies/src/pip-23.0.1-py3-none-any.whl \\\n    /kaggle/working/dependencies/src/Pillow-7.1.2-cp37-cp37m-manylinux1_x86_64.whl \\\n    /kaggle/working/dependencies/src/torch-1.10.0+cu111-cp37-cp37m-linux_x86_64.whl \\\n    /kaggle/working/dependencies/src/torchvision-0.11.0+cu111-cp37-cp37m-linux_x86_64.whl \\\n    /kaggle/working/dependencies/src/torchaudio-0.10.0+rocm4.1-cp37-cp37m-linux_x86_64.whl \\\n    /kaggle/working/dependencies/src/addict-2.4.0-py3-none-any.whl \\\n    /kaggle/working/dependencies/src/mmcv_full-1.6.0-cp37-cp37m-manylinux1_x86_64.whl \\\n    /kaggle/working/dependencies/mmsegmentation/mmcls-0.25.0-py2.py3-none-any.whl","metadata":{"execution":{"iopub.status.busy":"2023-03-28T15:03:05.961551Z","iopub.execute_input":"2023-03-28T15:03:05.964333Z","iopub.status.idle":"2023-03-28T15:03:07.321650Z","shell.execute_reply.started":"2023-03-28T15:03:05.962211Z","shell.execute_reply":"2023-03-28T15:03:07.320502Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%cd /kaggle/working/dependencies/mmsegmentation\n!pip install --disable-pip-version-check -e .","metadata":{"execution":{"iopub.status.busy":"2023-03-26T14:37:45.642968Z","iopub.execute_input":"2023-03-26T14:37:45.643670Z","iopub.status.idle":"2023-03-26T14:38:00.121754Z","shell.execute_reply.started":"2023-03-26T14:37:45.643633Z","shell.execute_reply":"2023-03-26T14:38:00.120300Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!python mmseg/utils/collect_env.py","metadata":{"execution":{"iopub.status.busy":"2023-03-26T14:38:22.249662Z","iopub.execute_input":"2023-03-26T14:38:22.250082Z","iopub.status.idle":"2023-03-26T14:38:28.176829Z","shell.execute_reply.started":"2023-03-26T14:38:22.250046Z","shell.execute_reply":"2023-03-26T14:38:28.175571Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Inference","metadata":{}},{"cell_type":"code","source":"%cd /kaggle/working\n!mv /kaggle/working/dependencies/model_configs /kaggle/working/model_configs\n!mv /kaggle/working/model_configs/predict.py /kaggle/working/predict.py","metadata":{"execution":{"iopub.status.busy":"2023-03-26T14:39:38.575183Z","iopub.execute_input":"2023-03-26T14:39:38.576382Z","iopub.status.idle":"2023-03-26T14:39:40.526349Z","shell.execute_reply.started":"2023-03-26T14:39:38.576326Z","shell.execute_reply":"2023-03-26T14:39:40.524973Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%writefile /kaggle/working/SETTINGS.json\n{       \n    \"TEST_DATA_IMAGE_PATH\": \"/kaggle/input/hubmap-organ-segmentation/test_images\",\n    \"TEST_DATA_CSV_PATH\": \"/kaggle/input/hubmap-organ-segmentation/test.csv\",\n    \"MODEL_1\": \"/kaggle/input/shamsia-30-06-2023/content\",\n    \"MODEL_CONFIG_1\": \"/kaggle/working/model_configs/segformer-mit_b4_hubmap_960.py\",\n    \"USE_MODEL\":[1],\n    \"SUBMISSION_DIR\": \"/kaggle/working\"\n}","metadata":{"execution":{"iopub.status.busy":"2023-03-26T14:40:02.766950Z","iopub.execute_input":"2023-03-26T14:40:02.767870Z","iopub.status.idle":"2023-03-26T14:40:02.776627Z","shell.execute_reply.started":"2023-03-26T14:40:02.767830Z","shell.execute_reply":"2023-03-26T14:40:02.775327Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%cd /kaggle/working\n!python predict.py","metadata":{"execution":{"iopub.status.busy":"2023-03-26T14:40:11.421279Z","iopub.execute_input":"2023-03-26T14:40:11.421652Z","iopub.status.idle":"2023-03-26T14:40:25.624927Z","shell.execute_reply.started":"2023-03-26T14:40:11.421617Z","shell.execute_reply":"2023-03-26T14:40:25.623609Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%cd /kaggle/working\n!rm -r /kaggle/working/model_configs\n!rm -r /kaggle/working/dependencies","metadata":{"execution":{"iopub.status.busy":"2023-03-25T18:03:58.043441Z","iopub.status.idle":"2023-03-25T18:03:58.051079Z","shell.execute_reply.started":"2023-03-25T18:03:58.050652Z","shell.execute_reply":"2023-03-25T18:03:58.050697Z"},"trusted":true},"execution_count":null,"outputs":[]}]}