{"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":"gpu","dataSources":[{"sourceId":30892,"databundleVersionId":2715462,"sourceType":"competition"}],"dockerImageVersionId":30579,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"### Select data input from BKAI-IGH-NEOPolyp","metadata":{}},{"cell_type":"code","source":"!git clone https://github.com/thiemcun203/BKAI-IGH-NeoPolyp-Assignment.git","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-11-15T12:44:59.233001Z","iopub.execute_input":"2023-11-15T12:44:59.233821Z","iopub.status.idle":"2023-11-15T12:45:00.673396Z","shell.execute_reply.started":"2023-11-15T12:44:59.233787Z","shell.execute_reply":"2023-11-15T12:45:00.672264Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import os\nimport requests\n\nurl_model = 'https://drive.google.com/u/0/uc?id=1x4ClKqoPC64o4qRdk2y7Q1RSfqwCRP9L&export=download&confirm=t&uuid=d60e69b0-bbbc-4c0d-b2ea-0305efbbf1a0&at=AB6BwCDAamlj_bNrrNRh6sp1QCuV:1700051167458'\nsave_dir = '/kaggle/working/'\n\nresponse = requests.get(url_model)\n\n\nwith open(os.path.join(save_dir, 'checkpoint_model.pth'), 'wb') as f:\n    f.write(response.content)","metadata":{"execution":{"iopub.status.busy":"2023-11-15T12:45:04.452708Z","iopub.execute_input":"2023-11-15T12:45:04.453065Z","iopub.status.idle":"2023-11-15T12:45:09.097809Z","shell.execute_reply.started":"2023-11-15T12:45:04.453033Z","shell.execute_reply":"2023-11-15T12:45:09.096978Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!mkdir predict_mask ","metadata":{"execution":{"iopub.status.busy":"2023-11-15T12:45:15.186533Z","iopub.execute_input":"2023-11-15T12:45:15.187259Z","iopub.status.idle":"2023-11-15T12:45:16.142589Z","shell.execute_reply.started":"2023-11-15T12:45:15.187226Z","shell.execute_reply":"2023-11-15T12:45:16.141169Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install -r /kaggle/working/BKAI-IGH-NeoPolyp-Assignment/requirements.txt","metadata":{"execution":{"iopub.status.busy":"2023-11-15T12:45:19.394680Z","iopub.execute_input":"2023-11-15T12:45:19.395823Z","iopub.status.idle":"2023-11-15T12:45:38.538352Z","shell.execute_reply.started":"2023-11-15T12:45:19.395764Z","shell.execute_reply":"2023-11-15T12:45:38.537373Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!python /kaggle/working/BKAI-IGH-NeoPolyp-Assignment/infer.py --checkpoint '/kaggle/working/checkpoint_model.pth' --test_dir '/kaggle/input/bkai-igh-neopolyp/test/test' --predict_dir '/kaggle/working/predict_mask'","metadata":{"execution":{"iopub.status.busy":"2023-11-15T12:45:43.780270Z","iopub.execute_input":"2023-11-15T12:45:43.781257Z","iopub.status.idle":"2023-11-15T12:46:31.537694Z","shell.execute_reply.started":"2023-11-15T12:45:43.781208Z","shell.execute_reply":"2023-11-15T12:46:31.536598Z"},"trusted":true},"execution_count":null,"outputs":[]}]}