Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
Signed-off-by: KumoLiu <[email protected]>
  • Loading branch information
KumoLiu committed Sep 6, 2023
1 parent 095597b commit 0bdb79b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
39 changes: 39 additions & 0 deletions bundle/pythonic_usage_guidance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Pythonic Bundle Access Tutorial

A MONAI bundle contains the stored weights of a model, training, inference, post-processing transform sequences and other information. This tutorial aims to explore how to access a bundle in Python and use it in your own application. We'll cover the following topics:
1. Downloading the Bundle.
2. Creating a `BundleWorkflow`.
3. Getting Properties from the Bundle.
4. Updating Properties.
5. Using Components in Your Own Pipeline.
6. Utilizing Pretrained Weights from the Bundle.
7. A Simple Comparison of the Usage between `ConfigParser` and `BundleWorkflow`.

The example training dataset is Task09_Spleen.tar from http://medicaldecathlon.com/.

## Requirements

The script is tested with:

- `Ubuntu 20.04` | `Python 3.8.10` | `CUDA 12.2` | `Pytorch 1.13.1`

- it is tested on 24gb single-gpu machine

## Dependencies and installation

### MONAI

You can conda environments to install the dependencies.

or you can just use MONAI docker.
```bash
docker pull projectmonai/monai:latest
```

For more information please check out [the installation guide](https://docs.monai.io/en/latest/installation.html).

## Questions and bugs

- For questions relating to the use of MONAI, please use our [Discussions tab](https://github.com/Project-MONAI/MONAI/discussions) on the main repository of MONAI.
- For bugs relating to MONAI functionality, please create an issue on the [main repository](https://github.com/Project-MONAI/MONAI/issues).
- For bugs relating to the running of a tutorial, please create an issue in [this repository](https://github.com/Project-MONAI/Tutorials/issues).
6 changes: 3 additions & 3 deletions bundle/pythonic_usage_guidance/pythonic_bundle_access.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,15 @@
"n_splits = 3\n",
"ensemble_transform = MeanEnsembled(keys=[\"pred\"] * n_splits, output_key=\"pred\")\n",
"update_postprocessing = Compose((ensemble_transform, train_workflow.val_postprocessing))\n",
"\n",
"print(update_postprocessing.transforms)\n",
"\n",
"device = train_workflow.device\n",
"train_workflow.add_property(name=\"dataloader\", required=True, config_id=\"train#dataloader\")\n",
"evaluator = EnsembleEvaluator(\n",
" device=train_workflow.device,\n",
" device=device,\n",
" val_data_loader=train_workflow.dataloader,\n",
" pred_keys=[\"pred\"] * n_splits,\n",
" networks=[train_workflow.network_def] * n_splits,\n",
" networks=[train_workflow.network_def.to(train_workflow.device)] * n_splits,\n",
" inferer=train_workflow.train_inferer,\n",
" postprocessing=update_postprocessing,\n",
")\n",
Expand Down

0 comments on commit 0bdb79b

Please sign in to comment.