Skip to content

Commit

Permalink
Monai deploy blog updates
Browse files Browse the repository at this point in the history
  • Loading branch information
saadrahim committed Jun 21, 2024
1 parent 1edf533 commit 0620566
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ docs/about/release-notes.md
docs/about/CHANGELOG.md

.ipynb_checkpoints
.vs/*
blogs/artificial-intelligence/.vs/*
29 changes: 23 additions & 6 deletions blogs/artificial-intelligence/monai-deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,17 @@ To follow along with this blog, you'll need to:
```

* Download a single test subject for inferencing from
[zenodo.org](https://zenodo.org/records/10047263).
[zenodo.org](https://zenodo.org/records/10047263) into the input folder i.e., [ts_data](./src/ts_data)

```bash
curl https://zenodo.org/records/10047263/files/Totalsegmentator_dataset_small_v201.zip --output ts.zip
unzip ts.zip s0011/ct.nii.gz
mv s0011/ct.nii.gz ts_data

// Remove downloads
rm -r s0011
rm ts.zip
```

* Install other required libraries.

Expand All @@ -114,15 +124,22 @@ To follow along with this blog, you'll need to:

[TotalSegmentator](https://github.com/wasserth/TotalSegmentator) is an open source project that uses
a ResNet equivalent to segment 105 parts from a whole body human CT scan. This includes skull,
stomach, heart, lungs, and gastrointestinal tracts.
stomach, heart, lungs, and gastrointestinal tracts. The list of all classes is stored
[here](https://github.com/Project-MONAI/model-zoo/blob/dev/models/wholeBody_ct_segmentation/configs/metadata.json#L86).

![total-body-segmentation.JPG](./images/total-body-segmentation.JPG)

We use MONAI's pre-trained model to build the TotalSegmentator app using MONAI Deploy App SDK.
You can find the training configuration used to pre-train this model on
[GitHub](https://github.com/Project-MONAI/model-zoo/blob/dev/models/wholeBody_ct_segmentation/configs/train.json).
The list of all classes is stored
[here](https://github.com/Project-MONAI/model-zoo/blob/dev/models/wholeBody_ct_segmentation/configs/metadata.json#L86).
[Project-MONAI GitHub repo](https://github.com/Project-MONAI/model-zoo/blob/dev/models/wholeBody_ct_segmentation/configs/train.json).
We shall use this config file to construct the pre-processing and post-processing pipeline
of our model and load it with the
[pretrained checkpoint](https://github.com/Project-MONAI/model-zoo/tree/dev/models/wholeBody_ct_segmentation#high-resolution-and-low-resolution-models). Make sure to download the checkpoint and place it in the input folder i.e., [ts_data](./src/ts_data),
otherwise the scripts throws an error as shown in the code block below.

```bash
curl https://drive.google.com/file/d/1c3osYscnr6710ObqZZS8GkZJQlWlc7rt/view?usp=share_link -o ./ts_data/model.pt
```

Build the first operator of the TotalSegmentator app - PreprocessNiftiOperator, which loads a NIfTI file
and the pre-trained model from the input path.
Expand Down Expand Up @@ -265,7 +282,7 @@ The segmentation of a test example is carried out through the following command;
as NIfTI objects in the output folder.

```bash
monai-deploy exec total_body_segmentation.py -i dcm/ -o output/ -l DEBUG
monai-deploy exec total_body_segmentation.py -i ts_data/ -o output/ -l DEBUG
```

### Results
Expand Down
2 changes: 1 addition & 1 deletion blogs/sphinx/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ sphinx-design==0.6.0
# via rocm-docs-core
sphinx-external-toc==1.0.1
# via rocm-docs-core
sphinx-hoverxref==1.3.0
sphinx-hoverxref==1.4.0
# via -r requirements.in
sphinx-notfound-page==1.0.2
# via rocm-docs-core
Expand Down

0 comments on commit 0620566

Please sign in to comment.