{"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":"# **libjpeg** & **gdcm** without internet access","metadata":{}},{"cell_type":"markdown","source":"Taken originally from pydicom_conda_helper notebook here[https://www.kaggle.com/awsaf49/pydicom-conda-helper] and add extra packages personalized. ","metadata":{}},{"cell_type":"code","source":"!wget 'https://anaconda.org/conda-forge/libjpeg-turbo/2.1.0/download/linux-64/libjpeg-turbo-2.1.0-h7f98852_0.tar.bz2' -q\n!wget 'https://anaconda.org/conda-forge/libgcc-ng/9.3.0/download/linux-64/libgcc-ng-9.3.0-h2828fa1_19.tar.bz2' -q\n!wget 'https://anaconda.org/conda-forge/gdcm/2.8.9/download/linux-64/gdcm-2.8.9-py37h500ead1_1.tar.bz2' -q\n!wget 'https://anaconda.org/conda-forge/conda/4.10.1/download/linux-64/conda-4.10.1-py37h89c1867_0.tar.bz2' -q\n!wget 'https://anaconda.org/conda-forge/certifi/2020.12.5/download/linux-64/certifi-2020.12.5-py37h89c1867_1.tar.bz2' -q\n!wget 'https://anaconda.org/conda-forge/openssl/1.1.1k/download/linux-64/openssl-1.1.1k-h7f98852_0.tar.bz2' -q","metadata":{"execution":{"iopub.status.busy":"2021-06-15T02:20:17.34211Z","iopub.execute_input":"2021-06-15T02:20:17.3427Z","iopub.status.idle":"2021-06-15T02:20:36.492059Z","shell.execute_reply.started":"2021-06-15T02:20:17.34258Z","shell.execute_reply":"2021-06-15T02:20:36.490239Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip download pyspark\n!pip download fastai\n!pip download wwf\n!pip download efficientnet_pytorch\n!pip download icevision[all]\n!pip download yolov5-icevision\n!pip download icedata","metadata":{"execution":{"iopub.status.busy":"2021-06-15T03:04:46.209142Z","iopub.execute_input":"2021-06-15T03:04:46.209775Z","iopub.status.idle":"2021-06-15T03:04:59.983516Z","shell.execute_reply.started":"2021-06-15T03:04:46.209655Z","shell.execute_reply":"2021-06-15T03:04:59.982403Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# How to use it\n\nInstall the ones you need. \n```\n!conda install 'libjpeg-turbo-2.1.0-h7f98852_0.tar.bz2' -c conda-forge -y\n!conda install 'libgcc-ng-9.3.0-h2828fa1_19.tar.bz2' -c conda-forge -y\n!conda install 'gdcm-2.8.9-py37h500ead1_1.tar.bz2' -c conda-forge -y\n!conda install 'conda-4.10.1-py37h89c1867_0.tar.bz2' -c conda-forge -y\n!conda install 'certifi-2020.12.5-py37h89c1867_1.tar.bz2' -c conda-forge -y\n!conda install 'openssl-1.1.1k-h7f98852_0.tar.bz2' -c conda-forge -y\n!pip install --no-index --find-links \"/kaggle/input/modified-siim-helper/\" pyspark\n!pip install --no-index --find-links \"/kaggle/input/modified-siim-helper/\" fastai\n!pip install --no-index --find-links \"/kaggle/input/modified-siim-helper/\" wwf\n!pip install --no-index --find-links \"/kaggle/input/modified-siim-helper/\" efficientnet_pytorch\n!pip install --no-index --find-links \"/kaggle/input/modified-siim-helper/\" icevision[all] yolov5-icevision icedata\n```","metadata":{}},{"cell_type":"code","source":"!pip install gdown\n!gdown https://drive.google.com/uc?id=1N34aCuCoVAx0lc1kNPf84vrmI7wCgSIV\n!unzip \"/kaggle/working/Assemble-ResNet152.zip\"\n!rm \"./Assemble-ResNet152.zip\"","metadata":{"execution":{"iopub.status.busy":"2021-06-16T05:11:56.810733Z","iopub.execute_input":"2021-06-16T05:11:56.811096Z","iopub.status.idle":"2021-06-16T05:12:13.466755Z","shell.execute_reply.started":"2021-06-16T05:11:56.811053Z","shell.execute_reply":"2021-06-16T05:12:13.465894Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# !pip install -U efficientnet efficientnet_pytorch","metadata":{"execution":{"iopub.status.busy":"2021-06-16T05:25:54.277712Z","iopub.execute_input":"2021-06-16T05:25:54.27808Z","iopub.status.idle":"2021-06-16T05:26:02.939361Z","shell.execute_reply.started":"2021-06-16T05:25:54.278042Z","shell.execute_reply":"2021-06-16T05:26:02.938475Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# !wget https://github.com/lukemelas/EfficientNet-PyTorch/releases/download/1.0/efficientnet-b7-dcc49843.pth","metadata":{"execution":{"iopub.status.busy":"2021-06-16T05:28:36.664498Z","iopub.execute_input":"2021-06-16T05:28:36.664812Z","iopub.status.idle":"2021-06-16T05:28:51.025071Z","shell.execute_reply.started":"2021-06-16T05:28:36.664786Z","shell.execute_reply":"2021-06-16T05:28:51.024197Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Below are from https://github.com/zoogzog/chexnet and https://github.com/arnoweng/CheXNet respectively. ","metadata":{}},{"cell_type":"code","source":"# !wget https://github.com/zoogzog/chexnet/raw/master/models/m-25012018-123527.pth.tar -O chexnet_zoogzog.pth.tar\n# !wget https://github.com/arnoweng/CheXNet/raw/master/model.pth.tar -O arnoweng.pth.tar","metadata":{"execution":{"iopub.status.busy":"2021-06-18T02:07:12.644025Z","iopub.execute_input":"2021-06-18T02:07:12.644404Z","iopub.status.idle":"2021-06-18T02:07:16.543632Z","shell.execute_reply.started":"2021-06-18T02:07:12.644363Z","shell.execute_reply":"2021-06-18T02:07:16.542499Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Icevision Requirement","metadata":{}},{"cell_type":"code","source":"!wget https://raw.githubusercontent.com/airctic/storage/master/SpaceGrotesk-Medium.ttf\n!wget https://download.pytorch.org/models/fasterrcnn_resnet50_fpn_coco-258fb6c6.pth","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"!mkdir --parents /root/.icevision/fonts/  \n!cd /root/.icevision/fonts/  \n!mv ./SpaceGrotesk-Medium.ttf /root/.icevision/fonts/  ","metadata":{}}]}