-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix this example application to make it work with SDK v0.6+
Signed-off-by: M Q <mingmelvinq@nvidia.com>
- Loading branch information
Showing
5 changed files
with
49 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,23 @@ | ||
## A MONAI Application Package to deploy breast density classification algorithm | ||
This MAP is based on the Breast Density Model in MONAI [Model-Zoo](https://github.com/Project-MONAI/model-zoo). This model is developed at the Center for Augmented Intelligence in Imaging at the Mayo Clinic, Florida. | ||
## A MONAI Application Package to deploy breast density classification algorithm | ||
This MAP is based on the Breast Density Model in MONAI [Model-Zoo](https://github.com/Project-MONAI/model-zoo). This model is developed at the Center for Augmented Intelligence in Imaging at the Mayo Clinic, Florida. | ||
For any questions, feel free to contact Vikash Gupta (gupta.vikash@mayo.edu) | ||
Sample data and a torchscript model can be downloaded from https://drive.google.com/drive/folders/1Dryozl2MwNunpsGaFPVoaKBLkNbVM3Hu?usp=sharing | ||
|
||
|
||
## Run the application package | ||
### Python CLI | ||
## Run the application code with Python interpreter | ||
``` | ||
python app.py -i <input_dir> -o <out_dir> -m <breast_density_model> | ||
python app.py -i <input_dir> -o <out_dir> -m <breast_density_model> | ||
``` | ||
|
||
### MONAI Deploy CLI | ||
## Package the application as a MONAI Application Package (contianer image) | ||
In order to build the MONAI App Package, go a level up and execute the following command. | ||
``` | ||
monai-deploy exec app.py -i <input_dir> -o <out_dir> -m <breast_density_model> | ||
``` | ||
Alternatively, you can go a level higher and execute | ||
``` | ||
monai-deploy exec breast_density_classification_app -i <input_dir> -o <out_dir> -m <breast_density_model> | ||
monai-deploy package breast_density_classification_app -m <breast_density_model> -c breast_density_classifer_app/app.yaml --tag breast_density:0.1.0 --platform x64-workstation -l DEBUG | ||
``` | ||
|
||
|
||
### Packaging the monai app | ||
In order to build the monai app, Go a level up and execute the following command. | ||
## Run the MONAI Application Package using MONAI Deploy CLI | ||
``` | ||
monai-deploy package -b nvcr.io/nvidia/pytorch:21.12-py3 breast_density_classification_app --tag breast_density:0.1.0 -m $breast_density_model | ||
monai-deploy run breast_density-x64-workstation-dgpu-linux-amd64:0.1.0 -i <input_dir> -o <output_dir> | ||
``` | ||
|
||
|
||
Once the container exits successfully, check the results in the output directory. There should be a newly creeated DICOM instance file and a `output.json` file containing the classification results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
%YAML 1.2 | ||
# SPDX-FileCopyrightText: Copyright (c) 2022-2023 MONAI. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
--- | ||
application: | ||
title: MONAI Deploy App Package - Spleen Seg Inference | ||
version: 1.0 | ||
inputFormats: ["file"] | ||
outputFormats: ["file"] | ||
|
||
resources: | ||
cpu: 1 | ||
gpu: 1 | ||
memory: 1Gi | ||
gpuMemory: 2Gi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
highdicom>=0.18.2 | ||
monai>=1.2.0 | ||
pydicom>=2.3.0 | ||
torch>=1.12.0 |