Skip to content

Commit 4b348ef

Browse files
authored
Update bundle and acceleration tutorials (#921)
* [DLMED] update bundle path Signed-off-by: Nic Ma <nma@nvidia.com> * [DLMED] update download command Signed-off-by: Nic Ma <nma@nvidia.com> Signed-off-by: Nic Ma <nma@nvidia.com>
1 parent 25eab2b commit 4b348ef

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

bundle/get_started.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"- Override config content at runtime.\n",
2828
"- Hybrid programming with config and python code.\n",
2929
"\n",
30-
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Project-MONAI/tutorials/blob/main/modules/bundle/get_started.ipynb)"
30+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Project-MONAI/tutorials/blob/main/bundle/get_started.ipynb)"
3131
]
3232
},
3333
{
@@ -468,7 +468,7 @@
468468
"Usually we need to execute validation for every N epochs during training to verify the model and save the best model.\n",
469469
"\n",
470470
"Here we don't define the `validate` section step by step as it's similar to the `train` section. The full config is available: \n",
471-
"https://github.com/Project-MONAI/tutorials/blob/main/modules/bundle/spleen_segmentation/configs/train.json\n",
471+
"https://github.com/Project-MONAI/tutorials/blob/main/bundle/spleen_segmentation/configs/train.json\n",
472472
"\n",
473473
"Just show an example of `macro text replacement` to simplify the config content and avoid duplicated text. Please note that it's just token text replacement of the config content, not refer to the instantiated python objects."
474474
]
@@ -503,7 +503,7 @@
503503
"We can define a `metadata` file in the bundle, which contains the metadata information relating to the model, including what the shape and format of inputs and outputs are, what the meaning of the outputs are, what type of model is present, and other information. The structure is a dictionary containing a defined set of keys with additional user-specified keys.\n",
504504
"\n",
505505
"A typical `metadata` example is available: \n",
506-
"https://github.com/Project-MONAI/tutorials/blob/main/modules/bundle/spleen_segmentation/configs/metadata.json"
506+
"https://github.com/Project-MONAI/tutorials/blob/main/bundle/spleen_segmentation/configs/metadata.json"
507507
]
508508
},
509509
{
@@ -591,7 +591,7 @@
591591
"\n",
592592
"5. Download a bundle from Github release or URL.\n",
593593
"```shell\n",
594-
"python -m monai.bundle download --name <bundle_name>\n",
594+
"python -m monai.bundle download --name <bundle_name> --version \"0.1.0\" --bundle_dir \"./\"\n",
595595
"```"
596596
]
597597
},

bundle/hybrid_programming/scripts/inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def run(config_file: Union[str, Sequence[str]], ckpt_path: str):
2323
# edit the config content at runtime for input / output information and lazy instantiation
2424
datalist = list(sorted(glob.glob("/workspace/data/Task09_Spleen/imagesTs/*.nii.gz")))
2525
input_data = [{f"{parser['image_key']}": i} for i in datalist]
26-
output_dir = "/workspace/data/tutorials/modules/bundle/hybrid_programming/eval"
26+
output_dir = "/workspace/data/tutorials/bundle/hybrid_programming/eval"
2727
parser["input_data"] = input_data
2828
parser["output_dir"] = output_dir
2929
parser["inferer"]["roi_size"] = [160, 160, 160]

bundle/spleen_segmentation/configs/inference.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"$import glob",
44
"$import os"
55
],
6-
"bundle_root": "/workspace/data/tutorials/modules/bundle/spleen_segmentation",
6+
"bundle_root": "/workspace/data/tutorials/bundle/spleen_segmentation",
77
"output_dir": "$@bundle_root + '/eval'",
88
"dataset_dir": "/workspace/data/Task09_Spleen",
99
"datalist": "$list(sorted(glob.glob(@dataset_dir + '/imagesTs/*.nii.gz')))",

bundle/spleen_segmentation/configs/train.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"$import os",
55
"$import ignite"
66
],
7-
"bundle_root": "/workspace/data/tutorials/modules/bundle/spleen_segmentation",
7+
"bundle_root": "/workspace/data/tutorials/bundle/spleen_segmentation",
88
"ckpt_dir": "$@bundle_root + '/models'",
99
"output_dir": "$@bundle_root + '/eval'",
1010
"dataset_dir": "/workspace/data/Task09_Spleen",

model_zoo/adapt_bundle_to_another_dataset/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Actual Model Input: 96 x 96 x 96
3333
## Modify ./spleen_ct_segmentation/configs/train.json from the downloaded example
3434
| Old json config | Updated json config |
3535
| --- | --- |
36-
| "bundle_root": "/workspace/data/tutorials/modules/bundle/spleen_segmentation", | "bundle_root": "./spleen_ct_segmentation", |
36+
| "bundle_root": "/workspace/data/tutorials/bundle/spleen_segmentation", | "bundle_root": "./spleen_ct_segmentation", |
3737
| "dataset_dir": "/workspace/data/Task09_Spleen",| "data_file_base_dir": "./data/btcv_spleen", |
3838
| "images": "$list(sorted(glob.glob(@dataset_dir + '/imagesTr/*.nii.gz')))",| "data_list_file_path": "./data/dataset_0.json", |
3939
| "labels": "$list(sorted(glob.glob(@dataset_dir + '/labelsTr/*.nii.gz')))",| "train_datalist": "$monai.data.load_decathlon_datalist(@data_list_file_path, is_segmentation=True, data_list_key='training', base_dir=@data_file_base_dir)", |

0 commit comments

Comments
 (0)