|
64 | 64 | "import matplotlib.pyplot as plt\n",
|
65 | 65 | "from collections import OrderedDict\n",
|
66 | 66 | "\n",
|
| 67 | + "from monai.apps import download_url\n", |
67 | 68 | "from monai.utils import set_determinism\n",
|
68 | 69 | "from monai.losses import DiceCELoss\n",
|
69 | 70 | "from monai.inferers import sliding_window_inference\n",
|
|
104 | 105 | "metadata": {},
|
105 | 106 | "source": [
|
106 | 107 | "##### Note:\n",
|
107 |
| - "[Beyond the cranial vault](https://www.synapse.org/#!Synapse:syn3193805/wiki/217789) abdominal segmentation multi-class dataset needs to be downloaded for the execution of this notebook. Downloading data to the `data_root` path defined variable is optimal, if data is downloaded at another location please change the path `data_root` accordingly. Please make sure to download the pre-trained weights from [here](https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/ssl_pretrained_weights.pth) to use them in this notebook, the path to the downloaded pre-trained weights needs to be set.\n", |
| 108 | + "[Beyond the cranial vault](https://www.synapse.org/#!Synapse:syn3193805/wiki/217789) abdominal segmentation multi-class dataset needs to be downloaded for the execution of this notebook. Downloading data to the `data_root` path defined variable is optimal, if data is downloaded at another location please change the path `data_root` accordingly.\n", |
108 | 109 | "\n",
|
109 | 110 | "Please see the Readme for more details about the dataset. Multiple data splits have already been provided in subsets of 3, 5, 7, 12 and 24 (full data) with consistent validation splits."
|
110 | 111 | ]
|
|
152 | 153 | "outputs": [],
|
153 | 154 | "source": [
|
154 | 155 | "use_pretrained = True\n",
|
155 |
| - "pretrained_path = os.path.normpath(\"to/be/defined\")" |
| 156 | + "\n", |
| 157 | + "if use_pretrained:\n", |
| 158 | + " resource = (\n", |
| 159 | + " \"https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/ssl_pretrained_weights.pth\"\n", |
| 160 | + " )\n", |
| 161 | + " dst = \"./ssl_pretrained_weights.pth\"\n", |
| 162 | + " download_url(resource, dst)\n", |
| 163 | + " pretrained_path = os.path.normpath(dst)" |
156 | 164 | ]
|
157 | 165 | },
|
158 | 166 | {
|
|
537 | 545 | "name": "python",
|
538 | 546 | "nbconvert_exporter": "python",
|
539 | 547 | "pygments_lexer": "ipython3",
|
540 |
| - "version": "3.8.15" |
| 548 | + "version": "3.8.10" |
541 | 549 | }
|
542 | 550 | },
|
543 | 551 | "nbformat": 4,
|
|
0 commit comments