Creating a Deploy App with MONAI Deploy App SDK and MONAI Bundle#
This tutorial shows how to create an application for organ segmentation using a PyTorch model that has been trained with MONAI and packaged in the MONAI Bundle format.
Deploying AI models requires the integration with clinical imaging network, even if just in a for-research-use setting. This means that the AI deploy application will need to support standards-based imaging protocols, and specifically for Radiological imaging, DICOM protocol.
Typically, DICOM network communication, either in DICOM TCP/IP network protocol or DICOMWeb, would be handled by DICOM devices or services, e.g. MONAI Deploy Informatics Gateway, so the deploy application itself would only need to use DICOM Part 10 files as input and save the AI result in DICOM Part10 file(s). For segmentation use cases, the DICOM instance file for AI results could be a DICOM Segmentation object or a DICOM RT Structure Set, and for classification, DICOM Structure Report and/or DICOM Encapsulated PDF.
DICOM instances received from modalities and Picture Archiving and Communications System (PACS) are often times the whole DICOM study, so an AI deploy application has to deal with a whole DICOM study with multiple series, whose images’ spacing may not be the same as expected by the trained model. To address these cases consistently and efficiently, MONAI Deploy Application SDK provides classes, called operators, to parse DICOM studies, select specific series with application-defined rules, and convert the selected DICOM series into domain-specific image format along with meta-data representing the pertinent DICOM attributes. The image is then further processed in the pre-processing stage to normalize spacing, orientation, intensity, etc., before pixel data as Tensors are used for inference.
In the following sections, we will demonstrate how to create a MONAI Deploy application package using the MONAI Deploy App SDK, and importantly, using the built-in MONAI Bundle Inference Operator to perform inference with the Spleen CT Segmentation PyTorch model in a MONAI Bundle.
Note
For local testing, if there is a lack of DICOM Part 10 files, one can use open source programs, e.g. 3D Slicer, to convert a NIfTI file to a DICOM series.
To make running this example simpler, the DICOM files and the Spleen CT Segmentation MONAI Bundle, published in MONAI Model Zoo, have been packaged and shared on Google Drive.
Creating Operators and connecting them in Application class#
We will implement an application that consists of five Operators:
DICOMDataLoaderOperator:
Input(dicom_files): a folder path (
Path)Output(dicom_study_list): a list of DICOM studies in memory (List[
DICOMStudy])
DICOMSeriesSelectorOperator:
Input(dicom_study_list): a list of DICOM studies in memory (List[
DICOMStudy])Input(selection_rules): a selection rule (Dict)
Output(study_selected_series_list): a DICOM series object in memory (
StudySelectedSeries)
DICOMSeriesToVolumeOperator:
Input(study_selected_series_list): a DICOM series object in memory (
StudySelectedSeries)Output(image): an image object in memory (
Image)
MonaiBundleInferenceOperator:
DICOMSegmentationWriterOperator:
Input(seg_image): a segmentation image object in memory (
Image)Input(study_selected_series_list): a DICOM series object in memory (
StudySelectedSeries)Output(dicom_seg_instance): a file path (
Path)
Note
The DICOMSegmentationWriterOperator needs both the segmentation image as well as the original DICOM series meta-data in order to use the patient demographics and the DICOM Study level attributes.
The workflow of the application is illustrated below.
%%{init: {"theme": "base", "themeVariables": { "fontSize": "16px"}} }%%
classDiagram
direction TB
DICOMDataLoaderOperator --|> DICOMSeriesSelectorOperator : dicom_study_list...dicom_study_list
DICOMSeriesSelectorOperator --|> DICOMSeriesToVolumeOperator : study_selected_series_list...study_selected_series_list
DICOMSeriesToVolumeOperator --|> MonaiBundleInferenceOperator : image...image
DICOMSeriesSelectorOperator --|> DICOMSegmentationWriterOperator : study_selected_series_list...study_selected_series_list
MonaiBundleInferenceOperator --|> DICOMSegmentationWriterOperator : pred...seg_image
class DICOMDataLoaderOperator {
<in>dicom_files : DISK
dicom_study_list(out) IN_MEMORY
}
class DICOMSeriesSelectorOperator {
<in>dicom_study_list : IN_MEMORY
<in>selection_rules : IN_MEMORY
study_selected_series_list(out) IN_MEMORY
}
class DICOMSeriesToVolumeOperator {
<in>study_selected_series_list : IN_MEMORY
image(out) IN_MEMORY
}
class MonaiBundleInferenceOperator {
<in>image : IN_MEMORY
pred(out) IN_MEMORY
}
class DICOMSegmentationWriterOperator {
<in>seg_image : IN_MEMORY
<in>study_selected_series_list : IN_MEMORY
dicom_seg_instance(out) DISK
}
Setup environment#
# Install MONAI and other necessary image processing packages for the application
!python -c "import monai" || pip install --upgrade -q "monai<=1.5.0"
!python -c "import torch" || pip install -q "torch>=1.12.0"
!python -c "import numpy" || pip install -q "numpy>=1.21.6"
!python -c "import nibabel" || pip install -q "nibabel>=3.2.1"
!python -c "import pydicom" || pip install -q "pydicom>=2.3.0"
!python -c "import highdicom" || pip install -q "highdicom>=0.18.2"
!python -c "import SimpleITK" || pip install -q "SimpleITK>=2.0.0"
!python -c "import skimage" || pip install -q "scikit-image>=0.17.2"
!python -c "import stl" || pip install -q "numpy-stl>=2.12.0"
!python -c "import trimesh" || pip install -q "trimesh>=3.8.11"
# Install MONAI Deploy App SDK package
!python -c "import holoscan" || pip install --upgrade -q "holoscan>=0.6.0"
!python -c "import monai.deploy" || pip install -q "monai-deploy-app-sdk"
Note: you may need to restart the Jupyter kernel to use the updated packages.
Download/Extract input and model/bundle files from Google Drive#
Note: Data files are now access controlled. Please first request permission to access the shared folder on Google Drive. Please download zip file, mednist_classifieai_spleen_seg_bundle_data.zip in the ai_spleen_seg_app folder, to the same folder as the notebook example.
# Download ai_spleen_bundle_data test data zip file. Please request access and download manually.
# !pip install gdown
# !gdown "https://drive.google.com/uc?id=1IwWMpbo2fd38fKIqeIdL8SKTGvkn31tK"
# After downloading ai_spleen_bundle_data zip file from the web browser or using gdown,
!unzip -o "ai_spleen_seg_bundle_data.zip"
# Need to copy the model.ts file to its own clean subfolder for packaging, to workaround an issue in the Packager
models_folder = "models"
!rm -rf {models_folder} && mkdir -p {models_folder}/model && cp model.ts {models_folder}/model && ls {models_folder}/model
Set up environment variables#
%env HOLOSCAN_INPUT_PATH dcm
%env HOLOSCAN_MODEL_PATH {models_folder}
%env HOLOSCAN_OUTPUT_PATH output
Set up imports#
Let’s import necessary classes/decorators to define Application and Operator.
import logging
from pathlib import Path
# Required for setting SegmentDescription attributes. Direct import as this is not part of App SDK package.
from pydicom.sr.codedict import codes
from monai.deploy.conditions import CountCondition
from monai.deploy.core import AppContext, Application
from monai.deploy.core.domain import Image
from monai.deploy.core.io_type import IOType
from monai.deploy.operators.dicom_data_loader_operator import DICOMDataLoaderOperator
from monai.deploy.operators.dicom_seg_writer_operator import DICOMSegmentationWriterOperator, SegmentDescription
from monai.deploy.operators.dicom_series_selector_operator import DICOMSeriesSelectorOperator
from monai.deploy.operators.dicom_series_to_volume_operator import DICOMSeriesToVolumeOperator
from monai.deploy.operators.monai_bundle_inference_operator import (
BundleConfigNames,
IOMapping,
MonaiBundleInferenceOperator,
)
from monai.deploy.operators.stl_conversion_operator import STLConversionOperator
Determining the Input and Output for the Model Bundle Inference Operator#
The App SDK provides a MonaiBundleInferenceOperator class to perform inference with a MONAI Bundle, which is essentially a PyTorch model in TorchScript with additional metadata describing the model network and processing specification. This operator uses the MONAI utilities to parse a MONAI Bundle to automatically instantiate the objects required for input and output processing as well as inference, as such it depends on MONAI transforms, inferers, and in turn their dependencies.
Each Operator class inherits from the base Operator base class, and its input/output properties are specified in the setup function (as opposed to using decorators @inputand @output in Version 0.5 and below).
For the MonaiBundleInferenceOperator class, the input/output need to be defined to match those of the model network, both in name and data type. For the current release, an IOMapping object is used to connect the operator input/output to those of the model network by using the same names. This is likely to change, to be automated, in the future releases once certain limitation in the App SDK is removed.
The Spleen CT Segmentation model network has a named input, called “image”, and the named output called “pred”, and both are of image type, which can all be mapped to the App SDK Image. This piece of information is typically acquired by examining the model metadata network_data_format attribute in the bundle, as seen in this [example] (https://github.com/Project-MONAI/model-zoo/blob/dev/models/spleen_ct_segmentation/configs/metadata.json).
Creating Application class#
Our application class would look like below.
It defines App class, inheriting the base Application class.
Objects required for DICOM parsing, series selection, pixel data conversion to volume image, model specific inference, and the AI result specific DICOM Segmentation object writers are created. The execution pipeline, as a Directed Acyclic Graph, is then constructed by connecting these objects through self.add_flow().
class AISpleenSegApp(Application):
"""Demonstrates inference with built-in MONAI Bundle inference operator with DICOM files as input/output
This application loads a set of DICOM instances, select the appropriate series, converts the series to
3D volume image, performs inference with the built-in MONAI Bundle inference operator, including pre-processing
and post-processing, save the segmentation image in a DICOM Seg OID in an instance file, and optionally the
surface mesh in STL format.
Pertinent MONAI Bundle:
https://github.com/Project-MONAI/model-zoo/tree/dev/models/spleen_ct_segmentation
Execution Time Estimate:
With a Nvidia GV100 32GB GPU, for an input DICOM Series of 515 instances, the execution time is around
25 seconds with saving both DICOM Seg and surface mesh STL file, and 15 seconds with DICOM Seg only.
"""
def __init__(self, *args, **kwargs):
"""Creates an application instance."""
self._logger = logging.getLogger("{}.{}".format(__name__, type(self).__name__))
super().__init__(*args, **kwargs)
def run(self, *args, **kwargs):
# This method calls the base class to run. Can be omitted if simply calling through.
self._logger.info(f"Begin {self.run.__name__}")
super().run(*args, **kwargs)
self._logger.info(f"End {self.run.__name__}")
def compose(self):
"""Creates the app specific operators and chain them up in the processing DAG."""
logging.info(f"Begin {self.compose.__name__}")
app_context = Application.init_app_context({}) # Do not pass argv in Jupyter Notebook
app_input_path = Path(app_context.input_path)
app_output_path = Path(app_context.output_path)
model_path = Path(app_context.model_path)
# Create the custom operator(s) as well as SDK built-in operator(s).
study_loader_op = DICOMDataLoaderOperator(
self, CountCondition(self, 1), input_folder=app_input_path, name="study_loader_op"
)
series_selector_op = DICOMSeriesSelectorOperator(self, rules=Sample_Rules_Text, name="series_selector_op")
series_to_vol_op = DICOMSeriesToVolumeOperator(self, name="series_to_vol_op")
# Create the inference operator that supports MONAI Bundle and automates the inference.
# The IOMapping labels match the input and prediction keys in the pre and post processing.
# The model_name is optional when the app has only one model.
# The bundle_path argument optionally can be set to an accessible bundle file path in the dev
# environment, so when the app is packaged into a MAP, the operator can complete the bundle parsing
# during init.
config_names = BundleConfigNames(config_names=["inference"]) # Same as the default
bundle_spleen_seg_op = MonaiBundleInferenceOperator(
self,
input_mapping=[IOMapping("image", Image, IOType.IN_MEMORY)],
output_mapping=[IOMapping("pred", Image, IOType.IN_MEMORY)],
app_context=app_context,
bundle_config_names=config_names,
bundle_path=model_path,
name="bundle_spleen_seg_op",
)
# Create DICOM Seg writer providing the required segment description for each segment with
# the actual algorithm and the pertinent organ/tissue. The segment_label, algorithm_name,
# and algorithm_version are of DICOM VR LO type, limited to 64 chars.
# https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html
segment_descriptions = [
SegmentDescription(
segment_label="Spleen",
segmented_property_category=codes.SCT.Organ,
segmented_property_type=codes.SCT.Spleen,
algorithm_name="volumetric (3D) segmentation of the spleen from CT image",
algorithm_family=codes.DCM.ArtificialIntelligence,
algorithm_version="0.3.2",
)
]
custom_tags = {"SeriesDescription": "AI generated Seg, not for clinical use."}
dicom_seg_writer = DICOMSegmentationWriterOperator(
self,
segment_descriptions=segment_descriptions,
custom_tags=custom_tags,
output_folder=app_output_path,
name="dicom_seg_writer",
)
# Create the processing pipeline, by specifying the source and destination operators, and
# ensuring the output from the former matches the input of the latter, in both name and type.
self.add_flow(study_loader_op, series_selector_op, {("dicom_study_list", "dicom_study_list")})
self.add_flow(
series_selector_op, series_to_vol_op, {("study_selected_series_list", "study_selected_series_list")}
)
self.add_flow(series_to_vol_op, bundle_spleen_seg_op, {("image", "image")})
# Note below the dicom_seg_writer requires two inputs, each coming from a source operator.
self.add_flow(
series_selector_op, dicom_seg_writer, {("study_selected_series_list", "study_selected_series_list")}
)
self.add_flow(bundle_spleen_seg_op, dicom_seg_writer, {("pred", "seg_image")})
# Create the surface mesh STL conversion operator and add it to the app execution flow, if needed, by
# uncommenting the following couple lines.
stl_conversion_op = STLConversionOperator(
self, output_file=app_output_path.joinpath("stl/spleen.stl"), name="stl_conversion_op"
)
self.add_flow(bundle_spleen_seg_op, stl_conversion_op, {("pred", "image")})
logging.info(f"End {self.compose.__name__}")
# This is a sample series selection rule in JSON, simply selecting CT series.
# If the study has more than 1 CT series, then all of them will be selected.
# Please see more detail in DICOMSeriesSelectorOperator.
Sample_Rules_Text = """
{
"selections": [
{
"name": "CT Series",
"conditions": {
"StudyDescription": "(.*?)",
"Modality": "(?i)CT",
"SeriesDescription": "(.*?)"
}
}
]
}
"""
Executing app locally#
We can execute the app in the Jupyter notebook. Note that the DICOM files of the CT Abdomen series must be present in the dcm folder and the Torch Script model, model.ts, also in the folder as pointed to by the environment variables.
!rm -rf $HOLOSCAN_OUTPUT_PATH
logging.info(f"Begin {__name__}")
AISpleenSegApp().run()
logging.info(f"End {__name__}")
Once the application is verified inside Jupyter notebook, we can write the above Python code into Python files in an application folder.
The application folder structure would look like below:
my_app
├── __main__.py
└── app.py
# Create an application folder
!mkdir -p my_app && rm -rf my_app/*
app.py#
%%writefile my_app/app.py
# Copyright 2021-2023 MONAI Consortium
# 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.
import logging
from pathlib import Path
# Required for setting SegmentDescription attributes. Direct import as this is not part of App SDK package.
from pydicom.sr.codedict import codes
from monai.deploy.conditions import CountCondition
from monai.deploy.core import AppContext, Application
from monai.deploy.core.domain import Image
from monai.deploy.core.io_type import IOType
from monai.deploy.operators.dicom_data_loader_operator import DICOMDataLoaderOperator
from monai.deploy.operators.dicom_seg_writer_operator import DICOMSegmentationWriterOperator, SegmentDescription
from monai.deploy.operators.dicom_series_selector_operator import DICOMSeriesSelectorOperator
from monai.deploy.operators.dicom_series_to_volume_operator import DICOMSeriesToVolumeOperator
from monai.deploy.operators.monai_bundle_inference_operator import (
BundleConfigNames,
IOMapping,
MonaiBundleInferenceOperator,
)
from monai.deploy.operators.stl_conversion_operator import STLConversionOperator
class AISpleenSegApp(Application):
"""Demonstrates inference with built-in MONAI Bundle inference operator with DICOM files as input/output
This application loads a set of DICOM instances, select the appropriate series, converts the series to
3D volume image, performs inference with the built-in MONAI Bundle inference operator, including pre-processing
and post-processing, save the segmentation image in a DICOM Seg OID in an instance file, and optionally the
surface mesh in STL format.
Pertinent MONAI Bundle:
https://github.com/Project-MONAI/model-zoo/tree/dev/models/spleen_ct_segmentation
Execution Time Estimate:
With a Nvidia GV100 32GB GPU, for an input DICOM Series of 515 instances, the execution time is around
25 seconds with saving both DICOM Seg and surface mesh STL file, and 15 seconds with DICOM Seg only.
"""
def __init__(self, *args, **kwargs):
"""Creates an application instance."""
self._logger = logging.getLogger("{}.{}".format(__name__, type(self).__name__))
super().__init__(*args, **kwargs)
def run(self, *args, **kwargs):
# This method calls the base class to run. Can be omitted if simply calling through.
self._logger.info(f"Begin {self.run.__name__}")
super().run(*args, **kwargs)
self._logger.info(f"End {self.run.__name__}")
def compose(self):
"""Creates the app specific operators and chain them up in the processing DAG."""
logging.info(f"Begin {self.compose.__name__}")
# Use Commandline options over environment variables to init context.
app_context = Application.init_app_context(self.argv)
app_input_path = Path(app_context.input_path)
app_output_path = Path(app_context.output_path)
model_path = Path(app_context.model_path)
# Create the custom operator(s) as well as SDK built-in operator(s).
study_loader_op = DICOMDataLoaderOperator(
self, CountCondition(self, 1), input_folder=app_input_path, name="study_loader_op"
)
series_selector_op = DICOMSeriesSelectorOperator(self, rules=Sample_Rules_Text, name="series_selector_op")
series_to_vol_op = DICOMSeriesToVolumeOperator(self, name="series_to_vol_op")
# Create the inference operator that supports MONAI Bundle and automates the inference.
# The IOMapping labels match the input and prediction keys in the pre and post processing.
# The model_name is optional when the app has only one model.
# The bundle_path argument optionally can be set to an accessible bundle file path in the dev
# environment, so when the app is packaged into a MAP, the operator can complete the bundle parsing
# during init.
config_names = BundleConfigNames(config_names=["inference"]) # Same as the default
bundle_spleen_seg_op = MonaiBundleInferenceOperator(
self,
input_mapping=[IOMapping("image", Image, IOType.IN_MEMORY)],
output_mapping=[IOMapping("pred", Image, IOType.IN_MEMORY)],
app_context=app_context,
bundle_config_names=config_names,
bundle_path=model_path,
name="bundle_spleen_seg_op",
)
# Create DICOM Seg writer providing the required segment description for each segment with
# the actual algorithm and the pertinent organ/tissue. The segment_label, algorithm_name,
# and algorithm_version are of DICOM VR LO type, limited to 64 chars.
# https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html
segment_descriptions = [
SegmentDescription(
segment_label="Spleen",
segmented_property_category=codes.SCT.Organ,
segmented_property_type=codes.SCT.Spleen,
algorithm_name="volumetric (3D) segmentation of the spleen from CT image",
algorithm_family=codes.DCM.ArtificialIntelligence,
algorithm_version="0.3.2",
)
]
custom_tags = {"SeriesDescription": "AI generated Seg, not for clinical use."}
dicom_seg_writer = DICOMSegmentationWriterOperator(
self,
segment_descriptions=segment_descriptions,
custom_tags=custom_tags,
output_folder=app_output_path,
name="dicom_seg_writer",
)
# Create the processing pipeline, by specifying the source and destination operators, and
# ensuring the output from the former matches the input of the latter, in both name and type.
self.add_flow(study_loader_op, series_selector_op, {("dicom_study_list", "dicom_study_list")})
self.add_flow(
series_selector_op, series_to_vol_op, {("study_selected_series_list", "study_selected_series_list")}
)
self.add_flow(series_to_vol_op, bundle_spleen_seg_op, {("image", "image")})
# Note below the dicom_seg_writer requires two inputs, each coming from a source operator.
self.add_flow(
series_selector_op, dicom_seg_writer, {("study_selected_series_list", "study_selected_series_list")}
)
self.add_flow(bundle_spleen_seg_op, dicom_seg_writer, {("pred", "seg_image")})
# Create the surface mesh STL conversion operator and add it to the app execution flow, if needed, by
# uncommenting the following couple lines.
stl_conversion_op = STLConversionOperator(
self, output_file=app_output_path.joinpath("stl/spleen.stl"), name="stl_conversion_op"
)
self.add_flow(bundle_spleen_seg_op, stl_conversion_op, {("pred", "image")})
logging.info(f"End {self.compose.__name__}")
# This is a sample series selection rule in JSON, simply selecting CT series.
# If the study has more than 1 CT series, then all of them will be selected.
# Please see more detail in DICOMSeriesSelectorOperator.
Sample_Rules_Text = """
{
"selections": [
{
"name": "CT Series",
"conditions": {
"StudyDescription": "(.*?)",
"Modality": "(?i)CT",
"SeriesDescription": "(.*?)"
}
}
]
}
"""
if __name__ == "__main__":
AISpleenSegApp().run()
if __name__ == "__main__":
AISpleenSegApp().run()
The above lines are needed to execute the application code by using python interpreter.
__main__.py#
__main__.py is needed for MONAI Application Packager to detect the main application code (app.py) when the application is executed with the application folder path (e.g., python simple_imaging_app).
%%writefile my_app/__main__.py
from app import AISpleenSegApp
if __name__ == "__main__":
AISpleenSegApp().run()
!ls my_app
This time, let’s execute the app in the command line.
Note
Since the environment variables have been set and contain the correct paths, it is not necessary to provide the command line options on running the application. The following command demonstrates the use of the options.
!rm -rf $HOLOSCAN_OUTPUT_PATH
!python my_app -i dcm -o output -m models
!ls output
Packaging app#
Let’s package the app with MONAI Application Packager.
In this version of the App SDK, we need to write out the configuration yaml file as well as the package requirements file, in the application folder.
%%writefile my_app/app.yaml
%YAML 1.2
---
application:
title: MONAI Deploy App Package - MONAI Bundle AI App
version: 1.0
inputFormats: ["file"]
outputFormats: ["file"]
resources:
cpu: 1
gpu: 1
memory: 1Gi
gpuMemory: 6Gi
%%writefile my_app/requirements.txt
highdicom>=0.18.2
monai>=1.0
nibabel>=3.2.1
numpy>=1.21.6
pydicom>=2.3.0
setuptools>=59.5.0 # for pkg_resources
SimpleITK>=2.0.0
scikit-image>=0.17.2
numpy-stl>=2.12.0
trimesh>=3.8.11
torch>=1.12.0
Now we can use the CLI package command to build the MONAI Application Package (MAP) container image based on a supported base image.
Note
Building a MONAI Application Package (Docker image) can take time. Use -l DEBUG option to see the progress.
tag_prefix = "my_app"
!monai-deploy package my_app -m {models_folder} -c my_app/app.yaml -t {tag_prefix}:1.0 --platform x86_64 -l DEBUG
We can see that the MAP Docker image is created
!docker image ls | grep {tag_prefix}
We can choose to display and inspect the MAP manifests by running the container with the show command.
Furthermore, we can also extract the manifests and other contents in the MAP by using the extract command while mapping specific folder to the host’s (we know that our MAP is compliant and supports these commands).
Note
The host folder for storing the extracted content must first be created by the user, and if it has been created by Docker on running the container, the folder needs to be deleted and re-created.
!echo "Display manifests and extract MAP contents to the host folder, ./export"
!docker run --rm {tag_prefix}-x64-workstation-dgpu-linux-amd64:1.0 show
!rm -rf `pwd`/export && mkdir -p `pwd`/export
!docker run --rm -v `pwd`/export/:/var/run/holoscan/export/ {tag_prefix}-x64-workstation-dgpu-linux-amd64:1.0 extract
!ls `pwd`/export
Executing packaged app locally#
The packaged app can be run locally through MONAI Application Runner.
# Clear the output folder and run the MAP. The input is expected to be a folder.
!rm -rf $HOLOSCAN_OUTPUT_PATH
!monai-deploy run -i $HOLOSCAN_INPUT_PATH -o $HOLOSCAN_OUTPUT_PATH my_app-x64-workstation-dgpu-linux-amd64:1.0
!ls $HOLOSCAN_OUTPUT_PATH