diff --git a/notebooks/tutorials/01_simple_app.ipynb b/notebooks/tutorials/01_simple_app.ipynb index a1f10f59..b5da7a51 100644 --- a/notebooks/tutorials/01_simple_app.ipynb +++ b/notebooks/tutorials/01_simple_app.ipynb @@ -54,7 +54,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ @@ -82,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 29, "metadata": {}, "outputs": [ { @@ -95,10 +95,10 @@ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 2, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" }, @@ -145,7 +145,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 30, "metadata": {}, "outputs": [ { @@ -179,7 +179,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 31, "metadata": {}, "outputs": [], "source": [ @@ -212,7 +212,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ @@ -283,7 +283,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 33, "metadata": {}, "outputs": [], "source": [ @@ -335,7 +335,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 34, "metadata": {}, "outputs": [], "source": [ @@ -428,7 +428,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 35, "metadata": {}, "outputs": [ { @@ -507,15 +507,15 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "[2024-04-10 16:18:44,711] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=[])\n", - "[2024-04-10 16:18:44,717] [INFO] (root) - AppContext object: AppContext(input_path=/tmp/simple_app/normal-brain-mri-4.png, output_path=output, model_path=models, workdir=)\n" + "[2024-04-22 15:06:09,647] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=[])\n", + "[2024-04-22 15:06:09,656] [INFO] (root) - AppContext object: AppContext(input_path=/tmp/simple_app/normal-brain-mri-4.png, output_path=output, model_path=models, workdir=)\n" ] }, { @@ -523,6 +523,7 @@ "output_type": "stream", "text": [ "sample_data_path: /tmp/simple_app/normal-brain-mri-4.png\n", + "\u001b[0m2024-04-22 15:06:09.677 INFO gxf/std/greedy_scheduler.cpp@191: Scheduling 3 entities\u001b[0m\n", "Number of times operator sobel_op whose class is defined in __main__ called: 1\n", "Input from: /tmp/simple_app/normal-brain-mri-4.png, whose absolute path: /tmp/simple_app/normal-brain-mri-4.png\n" ] @@ -531,13 +532,11 @@ "name": "stderr", "output_type": "stream", "text": [ - "[info] [gxf_executor.cpp:211] Creating context\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[info] [greedy_scheduler.cpp:190] Scheduling 3 entities\n" + "[info] [gxf_executor.cpp:247] Creating context\n", + "[info] [gxf_executor.cpp:1672] Loading extensions from configs...\n", + "[info] [gxf_executor.cpp:1842] Activating Graph...\n", + "[info] [gxf_executor.cpp:1874] Running Graph...\n", + "[info] [gxf_executor.cpp:1876] Waiting for completion...\n" ] }, { @@ -547,19 +546,18 @@ "Number of times operator median_op whose class is defined in __main__ called: 1\n", "Number of times operator gaussian_op whose class is defined in __main__ called: 1\n", "Data type of output: , max = 0.35821119421406195\n", - "Data type of output post conversion: , max = 91\n" + "Data type of output post conversion: , max = 91\n", + "\u001b[0m2024-04-22 15:06:09.965 INFO gxf/std/greedy_scheduler.cpp@372: Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\u001b[0m\n", + "\u001b[0m2024-04-22 15:06:09.965 INFO gxf/std/greedy_scheduler.cpp@401: Scheduler finished.\u001b[0m\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[info] [gxf_executor.cpp:230] Destroying context\n" + "[info] [gxf_executor.cpp:1879] Deactivating Graph...\n", + "[info] [gxf_executor.cpp:1887] Graph execution finished.\n", + "[info] [gxf_executor.cpp:275] Destroying context\n" ] } ], @@ -570,7 +568,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -587,16 +585,16 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 11, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" }, @@ -643,7 +641,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 39, "metadata": {}, "outputs": [], "source": [ @@ -661,7 +659,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 40, "metadata": {}, "outputs": [ { @@ -741,7 +739,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 41, "metadata": {}, "outputs": [ { @@ -803,7 +801,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 42, "metadata": {}, "outputs": [ { @@ -899,7 +897,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 43, "metadata": {}, "outputs": [ { @@ -1001,7 +999,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 44, "metadata": {}, "outputs": [ { @@ -1022,7 +1020,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 45, "metadata": {}, "outputs": [ { @@ -1052,94 +1050,92 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 46, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[2024-04-10 16:18:49,954] [INFO] (root) - Parsed args: Namespace(log_level='DEBUG', input=PosixPath('/tmp/simple_app'), output=PosixPath('/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output'), model=None, workdir=None, argv=['simple_imaging_app', '-i', '/tmp/simple_app', '-o', 'output', '-l', 'DEBUG'])\n", - "[2024-04-10 16:18:50,126] [INFO] (root) - AppContext object: AppContext(input_path=/tmp/simple_app, output_path=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output, model_path=models, workdir=)\n", - "[2024-04-10 16:18:50,127] [INFO] (root) - sample_data_path: /tmp/simple_app\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:211] Creating context\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1864] Activating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1894] Running Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:190] Scheduling 3 entities\n", + "[2024-04-22 15:06:15,329] [INFO] (root) - Parsed args: Namespace(log_level='DEBUG', input=PosixPath('/tmp/simple_app'), output=PosixPath('/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output'), model=None, workdir=None, argv=['simple_imaging_app', '-i', '/tmp/simple_app', '-o', 'output', '-l', 'DEBUG'])\n", + "[2024-04-22 15:06:15,331] [INFO] (root) - AppContext object: AppContext(input_path=/tmp/simple_app, output_path=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output, model_path=models, workdir=)\n", + "[2024-04-22 15:06:15,331] [INFO] (root) - sample_data_path: /tmp/simple_app\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:247] Creating context\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1672] Loading extensions from configs...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1842] Activating Graph...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1874] Running Graph...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1876] Waiting for completion...\n", + "\u001b[0m2024-04-22 15:06:15.355 INFO gxf/std/greedy_scheduler.cpp@191: Scheduling 3 entities\u001b[0m\n", "Number of times operator sobel_op whose class is defined in sobel_operator called: 1\n", "Input from: /tmp/simple_app, whose absolute path: /tmp/simple_app\n", - "[2024-04-10 16:18:50,179] [DEBUG] (PIL.PngImagePlugin) - STREAM b'IHDR' 16 13\n", - "[2024-04-10 16:18:50,179] [DEBUG] (PIL.PngImagePlugin) - STREAM b'sRGB' 41 1\n", - "[2024-04-10 16:18:50,179] [DEBUG] (PIL.PngImagePlugin) - STREAM b'gAMA' 54 4\n", - "[2024-04-10 16:18:50,179] [DEBUG] (PIL.PngImagePlugin) - STREAM b'pHYs' 70 9\n", - "[2024-04-10 16:18:50,179] [DEBUG] (PIL.PngImagePlugin) - STREAM b'IDAT' 91 65445\n", - "[2024-04-10 16:18:50,179] [DEBUG] (PIL.PngImagePlugin) - STREAM b'IHDR' 16 13\n", - "[2024-04-10 16:18:50,179] [DEBUG] (PIL.PngImagePlugin) - STREAM b'sRGB' 41 1\n", - "[2024-04-10 16:18:50,179] [DEBUG] (PIL.PngImagePlugin) - STREAM b'gAMA' 54 4\n", - "[2024-04-10 16:18:50,180] [DEBUG] (PIL.PngImagePlugin) - STREAM b'pHYs' 70 9\n", - "[2024-04-10 16:18:50,180] [DEBUG] (PIL.PngImagePlugin) - STREAM b'IDAT' 91 65445\n", - "[2024-04-10 16:18:50,185] [DEBUG] (PIL.Image) - Error closing: Operation on closed image\n", + "[2024-04-22 15:06:15,393] [DEBUG] (PIL.PngImagePlugin) - STREAM b'IHDR' 16 13\n", + "[2024-04-22 15:06:15,393] [DEBUG] (PIL.PngImagePlugin) - STREAM b'sRGB' 41 1\n", + "[2024-04-22 15:06:15,393] [DEBUG] (PIL.PngImagePlugin) - STREAM b'gAMA' 54 4\n", + "[2024-04-22 15:06:15,393] [DEBUG] (PIL.PngImagePlugin) - STREAM b'pHYs' 70 9\n", + "[2024-04-22 15:06:15,393] [DEBUG] (PIL.PngImagePlugin) - STREAM b'IDAT' 91 65445\n", + "[2024-04-22 15:06:15,393] [DEBUG] (PIL.PngImagePlugin) - STREAM b'IHDR' 16 13\n", + "[2024-04-22 15:06:15,393] [DEBUG] (PIL.PngImagePlugin) - STREAM b'sRGB' 41 1\n", + "[2024-04-22 15:06:15,393] [DEBUG] (PIL.PngImagePlugin) - STREAM b'gAMA' 54 4\n", + "[2024-04-22 15:06:15,393] [DEBUG] (PIL.PngImagePlugin) - STREAM b'pHYs' 70 9\n", + "[2024-04-22 15:06:15,393] [DEBUG] (PIL.PngImagePlugin) - STREAM b'IDAT' 91 65445\n", + "[2024-04-22 15:06:15,400] [DEBUG] (PIL.Image) - Error closing: Operation on closed image\n", "Number of times operator median_op whose class is defined in median_operator called: 1\n", "Number of times operator gaussian_op whose class is defined in gaussian_operator called: 1\n", "Data type of output: , max = 0.35821119421406195\n", "Data type of output post conversion: , max = 91\n", - "[2024-04-10 16:18:50,402] [DEBUG] (PIL.Image) - Importing BlpImagePlugin\n", - "[2024-04-10 16:18:50,403] [DEBUG] (PIL.Image) - Importing BmpImagePlugin\n", - "[2024-04-10 16:18:50,404] [DEBUG] (PIL.Image) - Importing BufrStubImagePlugin\n", - "[2024-04-10 16:18:50,404] [DEBUG] (PIL.Image) - Importing CurImagePlugin\n", - "[2024-04-10 16:18:50,404] [DEBUG] (PIL.Image) - Importing DcxImagePlugin\n", - "[2024-04-10 16:18:50,404] [DEBUG] (PIL.Image) - Importing DdsImagePlugin\n", - "[2024-04-10 16:18:50,407] [DEBUG] (PIL.Image) - Importing EpsImagePlugin\n", - "[2024-04-10 16:18:50,408] [DEBUG] (PIL.Image) - Importing FitsImagePlugin\n", - "[2024-04-10 16:18:50,408] [DEBUG] (PIL.Image) - Importing FliImagePlugin\n", - "[2024-04-10 16:18:50,408] [DEBUG] (PIL.Image) - Importing FpxImagePlugin\n", - "[2024-04-10 16:18:50,408] [DEBUG] (PIL.Image) - Image: failed to import FpxImagePlugin: No module named 'olefile'\n", - "[2024-04-10 16:18:50,408] [DEBUG] (PIL.Image) - Importing FtexImagePlugin\n", - "[2024-04-10 16:18:50,409] [DEBUG] (PIL.Image) - Importing GbrImagePlugin\n", - "[2024-04-10 16:18:50,409] [DEBUG] (PIL.Image) - Importing GifImagePlugin\n", - "[2024-04-10 16:18:50,409] [DEBUG] (PIL.Image) - Importing GribStubImagePlugin\n", - "[2024-04-10 16:18:50,409] [DEBUG] (PIL.Image) - Importing Hdf5StubImagePlugin\n", - "[2024-04-10 16:18:50,409] [DEBUG] (PIL.Image) - Importing IcnsImagePlugin\n", - "[2024-04-10 16:18:50,411] [DEBUG] (PIL.Image) - Importing IcoImagePlugin\n", - "[2024-04-10 16:18:50,411] [DEBUG] (PIL.Image) - Importing ImImagePlugin\n", - "[2024-04-10 16:18:50,411] [DEBUG] (PIL.Image) - Importing ImtImagePlugin\n", - "[2024-04-10 16:18:50,412] [DEBUG] (PIL.Image) - Importing IptcImagePlugin\n", - "[2024-04-10 16:18:50,412] [DEBUG] (PIL.Image) - Importing JpegImagePlugin\n", - "[2024-04-10 16:18:50,412] [DEBUG] (PIL.Image) - Importing Jpeg2KImagePlugin\n", - "[2024-04-10 16:18:50,412] [DEBUG] (PIL.Image) - Importing McIdasImagePlugin\n", - "[2024-04-10 16:18:50,412] [DEBUG] (PIL.Image) - Importing MicImagePlugin\n", - "[2024-04-10 16:18:50,412] [DEBUG] (PIL.Image) - Image: failed to import MicImagePlugin: No module named 'olefile'\n", - "[2024-04-10 16:18:50,413] [DEBUG] (PIL.Image) - Importing MpegImagePlugin\n", - "[2024-04-10 16:18:50,413] [DEBUG] (PIL.Image) - Importing MpoImagePlugin\n", - "[2024-04-10 16:18:50,414] [DEBUG] (PIL.Image) - Importing MspImagePlugin\n", - "[2024-04-10 16:18:50,414] [DEBUG] (PIL.Image) - Importing PalmImagePlugin\n", - "[2024-04-10 16:18:50,415] [DEBUG] (PIL.Image) - Importing PcdImagePlugin\n", - "[2024-04-10 16:18:50,415] [DEBUG] (PIL.Image) - Importing PcxImagePlugin\n", - "[2024-04-10 16:18:50,415] [DEBUG] (PIL.Image) - Importing PdfImagePlugin\n", - "[2024-04-10 16:18:50,419] [DEBUG] (PIL.Image) - Importing PixarImagePlugin\n", - "[2024-04-10 16:18:50,420] [DEBUG] (PIL.Image) - Importing PngImagePlugin\n", - "[2024-04-10 16:18:50,420] [DEBUG] (PIL.Image) - Importing PpmImagePlugin\n", - "[2024-04-10 16:18:50,420] [DEBUG] (PIL.Image) - Importing PsdImagePlugin\n", - "[2024-04-10 16:18:50,420] [DEBUG] (PIL.Image) - Importing QoiImagePlugin\n", - "[2024-04-10 16:18:50,420] [DEBUG] (PIL.Image) - Importing SgiImagePlugin\n", - "[2024-04-10 16:18:50,420] [DEBUG] (PIL.Image) - Importing SpiderImagePlugin\n", - "[2024-04-10 16:18:50,421] [DEBUG] (PIL.Image) - Importing SunImagePlugin\n", - "[2024-04-10 16:18:50,421] [DEBUG] (PIL.Image) - Importing TgaImagePlugin\n", - "[2024-04-10 16:18:50,421] [DEBUG] (PIL.Image) - Importing TiffImagePlugin\n", - "[2024-04-10 16:18:50,421] [DEBUG] (PIL.Image) - Importing WebPImagePlugin\n", - "[2024-04-10 16:18:50,422] [DEBUG] (PIL.Image) - Importing WmfImagePlugin\n", - "[2024-04-10 16:18:50,422] [DEBUG] (PIL.Image) - Importing XbmImagePlugin\n", - "[2024-04-10 16:18:50,423] [DEBUG] (PIL.Image) - Importing XpmImagePlugin\n", - "[2024-04-10 16:18:50,423] [DEBUG] (PIL.Image) - Importing XVThumbImagePlugin\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:230] Destroying context\n" + "[2024-04-22 15:06:15,629] [DEBUG] (PIL.Image) - Importing BlpImagePlugin\n", + "[2024-04-22 15:06:15,631] [DEBUG] (PIL.Image) - Importing BmpImagePlugin\n", + "[2024-04-22 15:06:15,631] [DEBUG] (PIL.Image) - Importing BufrStubImagePlugin\n", + "[2024-04-22 15:06:15,631] [DEBUG] (PIL.Image) - Importing CurImagePlugin\n", + "[2024-04-22 15:06:15,631] [DEBUG] (PIL.Image) - Importing DcxImagePlugin\n", + "[2024-04-22 15:06:15,632] [DEBUG] (PIL.Image) - Importing DdsImagePlugin\n", + "[2024-04-22 15:06:15,635] [DEBUG] (PIL.Image) - Importing EpsImagePlugin\n", + "[2024-04-22 15:06:15,636] [DEBUG] (PIL.Image) - Importing FitsImagePlugin\n", + "[2024-04-22 15:06:15,636] [DEBUG] (PIL.Image) - Importing FliImagePlugin\n", + "[2024-04-22 15:06:15,637] [DEBUG] (PIL.Image) - Importing FpxImagePlugin\n", + "[2024-04-22 15:06:15,637] [DEBUG] (PIL.Image) - Image: failed to import FpxImagePlugin: No module named 'olefile'\n", + "[2024-04-22 15:06:15,637] [DEBUG] (PIL.Image) - Importing FtexImagePlugin\n", + "[2024-04-22 15:06:15,637] [DEBUG] (PIL.Image) - Importing GbrImagePlugin\n", + "[2024-04-22 15:06:15,638] [DEBUG] (PIL.Image) - Importing GifImagePlugin\n", + "[2024-04-22 15:06:15,638] [DEBUG] (PIL.Image) - Importing GribStubImagePlugin\n", + "[2024-04-22 15:06:15,638] [DEBUG] (PIL.Image) - Importing Hdf5StubImagePlugin\n", + "[2024-04-22 15:06:15,639] [DEBUG] (PIL.Image) - Importing IcnsImagePlugin\n", + "[2024-04-22 15:06:15,641] [DEBUG] (PIL.Image) - Importing IcoImagePlugin\n", + "[2024-04-22 15:06:15,641] [DEBUG] (PIL.Image) - Importing ImImagePlugin\n", + "[2024-04-22 15:06:15,643] [DEBUG] (PIL.Image) - Importing ImtImagePlugin\n", + "[2024-04-22 15:06:15,644] [DEBUG] (PIL.Image) - Importing IptcImagePlugin\n", + "[2024-04-22 15:06:15,644] [DEBUG] (PIL.Image) - Importing JpegImagePlugin\n", + "[2024-04-22 15:06:15,645] [DEBUG] (PIL.Image) - Importing Jpeg2KImagePlugin\n", + "[2024-04-22 15:06:15,645] [DEBUG] (PIL.Image) - Importing McIdasImagePlugin\n", + "[2024-04-22 15:06:15,645] [DEBUG] (PIL.Image) - Importing MicImagePlugin\n", + "[2024-04-22 15:06:15,646] [DEBUG] (PIL.Image) - Image: failed to import MicImagePlugin: No module named 'olefile'\n", + "[2024-04-22 15:06:15,646] [DEBUG] (PIL.Image) - Importing MpegImagePlugin\n", + "[2024-04-22 15:06:15,647] [DEBUG] (PIL.Image) - Importing MpoImagePlugin\n", + "[2024-04-22 15:06:15,650] [DEBUG] (PIL.Image) - Importing MspImagePlugin\n", + "[2024-04-22 15:06:15,650] [DEBUG] (PIL.Image) - Importing PalmImagePlugin\n", + "[2024-04-22 15:06:15,651] [DEBUG] (PIL.Image) - Importing PcdImagePlugin\n", + "[2024-04-22 15:06:15,652] [DEBUG] (PIL.Image) - Importing PcxImagePlugin\n", + "[2024-04-22 15:06:15,652] [DEBUG] (PIL.Image) - Importing PdfImagePlugin\n", + "[2024-04-22 15:06:15,658] [DEBUG] (PIL.Image) - Importing PixarImagePlugin\n", + "[2024-04-22 15:06:15,659] [DEBUG] (PIL.Image) - Importing PngImagePlugin\n", + "[2024-04-22 15:06:15,659] [DEBUG] (PIL.Image) - Importing PpmImagePlugin\n", + "[2024-04-22 15:06:15,659] [DEBUG] (PIL.Image) - Importing PsdImagePlugin\n", + "[2024-04-22 15:06:15,660] [DEBUG] (PIL.Image) - Importing QoiImagePlugin\n", + "[2024-04-22 15:06:15,660] [DEBUG] (PIL.Image) - Importing SgiImagePlugin\n", + "[2024-04-22 15:06:15,661] [DEBUG] (PIL.Image) - Importing SpiderImagePlugin\n", + "[2024-04-22 15:06:15,662] [DEBUG] (PIL.Image) - Importing SunImagePlugin\n", + "[2024-04-22 15:06:15,662] [DEBUG] (PIL.Image) - Importing TgaImagePlugin\n", + "[2024-04-22 15:06:15,663] [DEBUG] (PIL.Image) - Importing TiffImagePlugin\n", + "[2024-04-22 15:06:15,663] [DEBUG] (PIL.Image) - Importing WebPImagePlugin\n", + "[2024-04-22 15:06:15,667] [DEBUG] (PIL.Image) - Importing WmfImagePlugin\n", + "[2024-04-22 15:06:15,668] [DEBUG] (PIL.Image) - Importing XbmImagePlugin\n", + "[2024-04-22 15:06:15,669] [DEBUG] (PIL.Image) - Importing XpmImagePlugin\n", + "[2024-04-22 15:06:15,669] [DEBUG] (PIL.Image) - Importing XVThumbImagePlugin\n", + "\u001b[0m2024-04-22 15:06:15.698 INFO gxf/std/greedy_scheduler.cpp@372: Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\u001b[0m\n", + "\u001b[0m2024-04-22 15:06:15.698 INFO gxf/std/greedy_scheduler.cpp@401: Scheduler finished.\u001b[0m\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1879] Deactivating Graph...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1887] Graph execution finished.\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:275] Destroying context\n" ] } ], @@ -1150,16 +1146,16 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 47, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 20, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" }, @@ -1200,7 +1196,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 48, "metadata": {}, "outputs": [ { @@ -1230,7 +1226,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 49, "metadata": {}, "outputs": [ { @@ -1256,19 +1252,21 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 50, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[2024-04-10 16:18:52,341] [INFO] (packager.parameters) - Application: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/simple_imaging_app\n", - "[2024-04-10 16:18:52,341] [INFO] (packager.parameters) - Detected application type: Python Module\n", - "[2024-04-10 16:18:52,341] [INFO] (packager) - Reading application configuration from /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/simple_imaging_app/app.yaml...\n", - "[2024-04-10 16:18:52,343] [INFO] (packager) - Generating app.json...\n", - "[2024-04-10 16:18:52,343] [INFO] (packager) - Generating pkg.json...\n", - "[2024-04-10 16:18:52,348] [DEBUG] (common) - \n", + "[2024-04-22 15:06:17,601] [INFO] (common) - Downloading CLI manifest file...\n", + "[2024-04-22 15:06:17,892] [DEBUG] (common) - Validating CLI manifest file...\n", + "[2024-04-22 15:06:17,894] [INFO] (packager.parameters) - Application: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/simple_imaging_app\n", + "[2024-04-22 15:06:17,895] [INFO] (packager.parameters) - Detected application type: Python Module\n", + "[2024-04-22 15:06:17,895] [INFO] (packager) - Reading application configuration from /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/simple_imaging_app/app.yaml...\n", + "[2024-04-22 15:06:17,899] [INFO] (packager) - Generating app.json...\n", + "[2024-04-22 15:06:17,899] [INFO] (packager) - Generating pkg.json...\n", + "[2024-04-22 15:06:17,911] [DEBUG] (common) - \n", "=============== Begin app.json ===============\n", "{\n", " \"apiVersion\": \"1.0.0\",\n", @@ -1303,7 +1301,7 @@ "}\n", "================ End app.json ================\n", " \n", - "[2024-04-10 16:18:52,348] [DEBUG] (common) - \n", + "[2024-04-22 15:06:17,912] [DEBUG] (common) - \n", "=============== Begin pkg.json ===============\n", "{\n", " \"apiVersion\": \"1.0.0\",\n", @@ -1321,11 +1319,11 @@ "}\n", "================ End pkg.json ================\n", " \n", - "[2024-04-10 16:18:52,364] [DEBUG] (packager.builder) - \n", + "[2024-04-22 15:06:17,931] [DEBUG] (packager.builder) - \n", "========== Begin Dockerfile ==========\n", "\n", "\n", - "FROM nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", + "FROM nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", "\n", "ENV DEBIAN_FRONTEND=noninteractive\n", "ENV TERM=xterm-256color\n", @@ -1341,11 +1339,11 @@ " && mkdir -p /var/holoscan/input \\\n", " && mkdir -p /var/holoscan/output\n", "\n", - "LABEL base=\"nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\"\n", + "LABEL base=\"nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\"\n", "LABEL tag=\"simple_imaging_app:1.0\"\n", "LABEL org.opencontainers.image.title=\"MONAI Deploy App Package - Simple Imaging App\"\n", "LABEL org.opencontainers.image.version=\"1.0\"\n", - "LABEL org.nvidia.holoscan=\"1.0.3\"\n", + "LABEL org.nvidia.holoscan=\"2.0.0\"\n", "LABEL org.monai.deploy.app-sdk=\"0.5.1\"\n", "\n", "\n", @@ -1371,7 +1369,6 @@ "ENV PYTHONPATH=\"/opt/holoscan/app:$PYTHONPATH\"\n", "\n", "\n", - "\n", "RUN groupadd -f -g $GID $UNAME\n", "RUN useradd -rm -d /home/$UNAME -s /bin/bash -g $GID -G sudo -u $UID $UNAME\n", "RUN chown -R holoscan /var/holoscan \n", @@ -1397,14 +1394,12 @@ "RUN pip install --upgrade pip\n", "RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", "\n", - "# Install Holoscan from PyPI only when sdk_type is Holoscan. \n", - "# For MONAI Deploy, the APP SDK will install it unless user specifies the Holoscan SDK file.\n", + " \n", + "# MONAI Deploy\n", "\n", "# Copy user-specified MONAI Deploy SDK file\n", - "COPY ./monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "\n", - "\n", + "COPY ./monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz /tmp/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", + "RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", "\n", "\n", "\n", @@ -1417,270 +1412,208 @@ "ENTRYPOINT [\"/var/holoscan/tools\"]\n", "=========== End Dockerfile ===========\n", "\n", - "[2024-04-10 16:18:52,365] [INFO] (packager.builder) - \n", + "[2024-04-22 15:06:17,931] [INFO] (packager.builder) - \n", "===============================================================================\n", "Building image for: x64-workstation\n", " Architecture: linux/amd64\n", - " Base Image: nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", + " Base Image: nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", " Build Image: N/A\n", " Cache: Enabled\n", " Configuration: dgpu\n", " Holoscan SDK Package: pypi.org\n", - " MONAI Deploy App SDK Package: /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", + " MONAI Deploy App SDK Package: /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", " gRPC Health Probe: N/A\n", - " SDK Version: 1.0.3\n", + " SDK Version: 2.0.0\n", " SDK: monai-deploy\n", " Tag: simple_imaging_app-x64-workstation-dgpu-linux-amd64:1.0\n", " \n", - "[2024-04-10 16:18:52,650] [INFO] (common) - Using existing Docker BuildKit builder `holoscan_app_builder`\n", - "[2024-04-10 16:18:52,650] [DEBUG] (packager.builder) - Building Holoscan Application Package: tag=simple_imaging_app-x64-workstation-dgpu-linux-amd64:1.0\n", + "[2024-04-22 15:06:18,248] [INFO] (common) - Using existing Docker BuildKit builder `holoscan_app_builder`\n", + "[2024-04-22 15:06:18,248] [DEBUG] (packager.builder) - Building Holoscan Application Package: tag=simple_imaging_app-x64-workstation-dgpu-linux-amd64:1.0\n", "#0 building with \"holoscan_app_builder\" instance using docker-container driver\n", "\n", "#1 [internal] load build definition from Dockerfile\n", - "#1 transferring dockerfile: 2.77kB done\n", - "#1 DONE 0.0s\n", + "#1 transferring dockerfile: 2.60kB done\n", + "#1 DONE 0.1s\n", "\n", - "#2 [internal] load metadata for nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#2 DONE 0.4s\n", + "#2 [internal] load metadata for nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", + "#2 DONE 0.1s\n", "\n", "#3 [internal] load .dockerignore\n", "#3 transferring context: 1.79kB done\n", - "#3 DONE 0.0s\n", + "#3 DONE 0.1s\n", "\n", - "#4 [internal] load build context\n", - "#4 DONE 0.0s\n", + "#4 importing cache manifest from nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", + "#4 ...\n", "\n", - "#5 importing cache manifest from local:14270000836931083776\n", - "#5 inferred cache manifest type: application/vnd.oci.image.index.v1+json done\n", + "#5 [internal] load build context\n", "#5 DONE 0.0s\n", "\n", - "#6 [ 1/20] FROM nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu@sha256:50343c616bf910e2a7651abb59db7833933e82cce64c3c4885f938d7e4af6155\n", - "#6 resolve nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu@sha256:50343c616bf910e2a7651abb59db7833933e82cce64c3c4885f938d7e4af6155 0.0s done\n", + "#6 importing cache manifest from local:5471301144742815488\n", + "#6 inferred cache manifest type: application/vnd.oci.image.index.v1+json done\n", "#6 DONE 0.0s\n", "\n", - "#7 importing cache manifest from nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#7 inferred cache manifest type: application/vnd.docker.distribution.manifest.list.v2+json done\n", - "#7 DONE 0.4s\n", + "#7 [ 1/20] FROM nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu@sha256:20adbccd2c7b12dfb1798f6953f071631c3b85cd337858a7506f8e420add6d4a\n", + "#7 resolve nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu@sha256:20adbccd2c7b12dfb1798f6953f071631c3b85cd337858a7506f8e420add6d4a 0.1s done\n", + "#7 DONE 0.1s\n", + "\n", + "#4 importing cache manifest from nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", + "#4 inferred cache manifest type: application/vnd.docker.distribution.manifest.list.v2+json done\n", + "#4 DONE 0.7s\n", "\n", - "#4 [internal] load build context\n", - "#4 transferring context: 157.50kB 0.0s done\n", - "#4 DONE 0.0s\n", + "#5 [internal] load build context\n", + "#5 transferring context: 133.40kB 0.0s done\n", + "#5 DONE 0.1s\n", "\n", - "#8 [ 5/20] RUN useradd -rm -d /home/holoscan -s /bin/bash -g 1000 -G sudo -u 1000 holoscan\n", + "#8 [17/20] COPY ./map/app.json /etc/holoscan/app.json\n", "#8 CACHED\n", "\n", - "#9 [11/20] RUN chmod +x /var/holoscan/tools\n", + "#9 [13/20] RUN pip install --upgrade pip\n", "#9 CACHED\n", "\n", - "#10 [ 2/20] RUN mkdir -p /etc/holoscan/ && mkdir -p /opt/holoscan/ && mkdir -p /var/holoscan && mkdir -p /opt/holoscan/app && mkdir -p /var/holoscan/input && mkdir -p /var/holoscan/output\n", + "#10 [15/20] COPY ./monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz /tmp/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", "#10 CACHED\n", "\n", - "#11 [ 4/20] RUN groupadd -f -g 1000 holoscan\n", + "#11 [18/20] COPY ./app.config /var/holoscan/app.yaml\n", "#11 CACHED\n", "\n", - "#12 [ 7/20] RUN chown -R holoscan /var/holoscan/input\n", + "#12 [ 6/20] RUN chown -R holoscan /var/holoscan\n", "#12 CACHED\n", "\n", - "#13 [ 8/20] RUN chown -R holoscan /var/holoscan/output\n", + "#13 [19/20] COPY ./map/pkg.json /etc/holoscan/pkg.json\n", "#13 CACHED\n", "\n", - "#14 [ 6/20] RUN chown -R holoscan /var/holoscan\n", + "#14 [ 2/20] RUN mkdir -p /etc/holoscan/ && mkdir -p /opt/holoscan/ && mkdir -p /var/holoscan && mkdir -p /opt/holoscan/app && mkdir -p /var/holoscan/input && mkdir -p /var/holoscan/output\n", "#14 CACHED\n", "\n", - "#15 [ 9/20] WORKDIR /var/holoscan\n", + "#15 [12/20] COPY ./pip/requirements.txt /tmp/requirements.txt\n", "#15 CACHED\n", "\n", - "#16 [ 3/20] RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*\n", + "#16 [ 9/20] WORKDIR /var/holoscan\n", "#16 CACHED\n", "\n", - "#17 [12/20] COPY ./pip/requirements.txt /tmp/requirements.txt\n", + "#17 [ 8/20] RUN chown -R holoscan /var/holoscan/output\n", "#17 CACHED\n", "\n", - "#18 [10/20] COPY ./tools /var/holoscan/tools\n", + "#18 [ 7/20] RUN chown -R holoscan /var/holoscan/input\n", "#18 CACHED\n", "\n", - "#19 [13/20] RUN pip install --upgrade pip\n", + "#19 [ 3/20] RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*\n", "#19 CACHED\n", "\n", - "#20 [14/20] RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", + "#20 [ 4/20] RUN groupadd -f -g 1000 holoscan\n", "#20 CACHED\n", "\n", - "#21 [15/20] COPY ./monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "#21 DONE 0.0s\n", - "\n", - "#22 [16/20] RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "#22 0.662 Defaulting to user installation because normal site-packages is not writeable\n", - "#22 0.757 Processing /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "#22 0.770 Requirement already satisfied: numpy>=1.21.6 in /usr/local/lib/python3.10/dist-packages (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (1.23.5)\n", - "#22 0.949 Collecting holoscan~=1.0 (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.097 Downloading holoscan-1.0.3-cp310-cp310-manylinux_2_35_x86_64.whl.metadata (4.1 kB)\n", - "#22 1.154 Collecting colorama>=0.4.1 (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.158 Downloading colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)\n", - "#22 1.227 Collecting typeguard>=3.0.0 (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.231 Downloading typeguard-4.2.1-py3-none-any.whl.metadata (3.7 kB)\n", - "#22 1.296 Collecting pip==23.3.2 (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.301 Downloading pip-23.3.2-py3-none-any.whl.metadata (3.5 kB)\n", - "#22 1.308 Requirement already satisfied: cupy-cuda12x==12.2 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (12.2.0)\n", - "#22 1.309 Requirement already satisfied: cloudpickle==2.2.1 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2.2.1)\n", - "#22 1.310 Requirement already satisfied: python-on-whales==0.60.1 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (0.60.1)\n", - "#22 1.311 Requirement already satisfied: Jinja2==3.1.2 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.1.2)\n", - "#22 1.311 Requirement already satisfied: packaging==23.1 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (23.1)\n", - "#22 1.312 Requirement already satisfied: pyyaml==6.0 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (6.0)\n", - "#22 1.313 Requirement already satisfied: requests==2.28.2 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2.28.2)\n", - "#22 1.314 Requirement already satisfied: psutil==5.9.6 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (5.9.6)\n", - "#22 1.414 Collecting wheel-axle-runtime<1.0 (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.420 Downloading wheel_axle_runtime-0.0.5-py3-none-any.whl.metadata (7.7 kB)\n", - "#22 1.444 Requirement already satisfied: fastrlock>=0.5 in /usr/local/lib/python3.10/dist-packages (from cupy-cuda12x==12.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (0.8.2)\n", - "#22 1.447 Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from Jinja2==3.1.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2.1.3)\n", - "#22 1.460 Requirement already satisfied: pydantic<2,>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (1.10.14)\n", - "#22 1.461 Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (4.66.1)\n", - "#22 1.461 Requirement already satisfied: typer>=0.4.1 in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (0.9.0)\n", - "#22 1.462 Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (4.7.1)\n", - "#22 1.469 Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.3.2)\n", - "#22 1.470 Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.6)\n", - "#22 1.470 Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (1.26.18)\n", - "#22 1.471 Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2023.11.17)\n", - "#22 1.507 Collecting typing-extensions (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.510 Downloading typing_extensions-4.11.0-py3-none-any.whl.metadata (3.0 kB)\n", - "#22 1.561 Collecting filelock (from wheel-axle-runtime<1.0->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.573 Downloading filelock-3.13.4-py3-none-any.whl.metadata (2.8 kB)\n", - "#22 1.639 Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.10/dist-packages (from typer>=0.4.1->python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (8.1.7)\n", - "#22 1.683 Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)\n", - "#22 1.780 Downloading holoscan-1.0.3-cp310-cp310-manylinux_2_35_x86_64.whl (33.6 MB)\n", - "#22 6.199 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 33.6/33.6 MB 10.0 MB/s eta 0:00:00\n", - "#22 6.209 Downloading pip-23.3.2-py3-none-any.whl (2.1 MB)\n", - "#22 6.254 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 53.3 MB/s eta 0:00:00\n", - "#22 6.263 Downloading typeguard-4.2.1-py3-none-any.whl (34 kB)\n", - "#22 6.280 Downloading typing_extensions-4.11.0-py3-none-any.whl (34 kB)\n", - "#22 6.296 Downloading wheel_axle_runtime-0.0.5-py3-none-any.whl (12 kB)\n", - "#22 6.314 Downloading filelock-3.13.4-py3-none-any.whl (11 kB)\n", - "#22 6.622 Installing collected packages: typing-extensions, pip, filelock, colorama, wheel-axle-runtime, typeguard, holoscan, monai-deploy-app-sdk\n", - "#22 6.643 Attempting uninstall: pip\n", - "#22 6.644 Found existing installation: pip 24.0\n", - "#22 6.709 Uninstalling pip-24.0:\n", - "#22 7.165 Successfully uninstalled pip-24.0\n", - "#22 8.769 Successfully installed colorama-0.4.6 filelock-3.13.4 holoscan-1.0.3 monai-deploy-app-sdk-0.5.1+25.g31e4165.dirty pip-23.3.2 typeguard-4.2.1 typing-extensions-4.11.0 wheel-axle-runtime-0.0.5\n", - "#22 DONE 9.3s\n", - "\n", - "#23 [17/20] COPY ./map/app.json /etc/holoscan/app.json\n", - "#23 DONE 0.1s\n", - "\n", - "#24 [18/20] COPY ./app.config /var/holoscan/app.yaml\n", - "#24 DONE 0.0s\n", - "\n", - "#25 [19/20] COPY ./map/pkg.json /etc/holoscan/pkg.json\n", - "#25 DONE 0.0s\n", + "#21 [14/20] RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", + "#21 CACHED\n", + "\n", + "#22 [10/20] COPY ./tools /var/holoscan/tools\n", + "#22 CACHED\n", + "\n", + "#23 [16/20] RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", + "#23 CACHED\n", + "\n", + "#24 [11/20] RUN chmod +x /var/holoscan/tools\n", + "#24 CACHED\n", + "\n", + "#25 [ 5/20] RUN useradd -rm -d /home/holoscan -s /bin/bash -g 1000 -G sudo -u 1000 holoscan\n", + "#25 CACHED\n", "\n", "#26 [20/20] COPY ./app /opt/holoscan/app\n", - "#26 DONE 0.0s\n", + "#26 CACHED\n", "\n", "#27 exporting to docker image format\n", - "#27 exporting layers\n", - "#27 exporting layers 5.7s done\n", - "#27 exporting manifest sha256:a5d5363b67b4d546c663819215cd3479b9fc8038916c32b1f39a3bd380aa1d27 0.0s done\n", - "#27 exporting config sha256:00503bdec78188be5602490be8caaa715487986151fd9430d0433b996ce4d386 0.0s done\n", + "#27 exporting layers 0.0s done\n", + "#27 exporting manifest sha256:9f7739a7621b1b89bbe3c4853055ce787cd662da652ef8119360427f2d03ced1 0.0s done\n", + "#27 exporting config sha256:f5b1c614b522a03aca9c4e0814d7c4ffa2f1c0b9d585e88f697c040eb3d81570 0.0s done\n", "#27 sending tarball\n", "#27 ...\n", "\n", "#28 importing to docker\n", - "#28 loading layer 1a101d9210ae 32.77kB / 125.57kB\n", - "#28 loading layer c4b083b26ab0 557.06kB / 74.13MB\n", - "#28 loading layer c4b083b26ab0 71.30MB / 74.13MB 2.0s\n", - "#28 loading layer 77455b6ee5d5 492B / 492B\n", - "#28 loading layer 4583ff017de7 313B / 313B\n", - "#28 loading layer 90825b467166 293B / 293B\n", - "#28 loading layer e972a134a523 3.18kB / 3.18kB\n", - "#28 loading layer c4b083b26ab0 71.30MB / 74.13MB 3.1s done\n", - "#28 loading layer 1a101d9210ae 32.77kB / 125.57kB 3.2s done\n", - "#28 loading layer 77455b6ee5d5 492B / 492B 0.6s done\n", - "#28 loading layer 4583ff017de7 313B / 313B 0.6s done\n", - "#28 loading layer 90825b467166 293B / 293B 0.5s done\n", - "#28 loading layer e972a134a523 3.18kB / 3.18kB 0.5s done\n", - "#28 DONE 3.2s\n", + "#28 DONE 1.0s\n", "\n", "#27 exporting to docker image format\n", - "#27 sending tarball 42.0s done\n", - "#27 DONE 47.7s\n", + "#27 sending tarball 47.4s done\n", + "#27 DONE 47.5s\n", "\n", "#29 exporting cache to client directory\n", "#29 preparing build cache for export\n", - "#29 writing layer sha256:00bb4c1319ba1a33ac3edcb3aa1240d8abcb8d0383c6267ed8028d3b6228a8a4\n", - "#29 writing layer sha256:00bb4c1319ba1a33ac3edcb3aa1240d8abcb8d0383c6267ed8028d3b6228a8a4 done\n", + "#29 writing layer sha256:014cff740c9ec6e9a30d0b859219a700ae880eb385d62095d348f5ea136d6015\n", + "#29 preparing build cache for export 0.6s done\n", "#29 writing layer sha256:014cff740c9ec6e9a30d0b859219a700ae880eb385d62095d348f5ea136d6015 done\n", - "#29 writing layer sha256:085504367cb16317416ecf8e22015fdf0c1b46551c023bbf3b8742e23f5aef3c 0.0s done\n", + "#29 writing layer sha256:0487800842442c7a031a39e1e1857bc6dae4b4f7e5daf3d625f7a8a4833fb364 done\n", + "#29 writing layer sha256:06c6aee94862daf0603783db4e1de6f8524b30ac9fbe0374ab3f1d85b2f76f7f done\n", + "#29 writing layer sha256:082f2b536c1281e6c6c0b221b1f23a29e00b2d2e979d7217a7cb790e53d14d11 done\n", "#29 writing layer sha256:0a1756432df4a4350712d8ae5c003f1526bd2180800b3ae6301cfc9ccf370254 done\n", "#29 writing layer sha256:0a77dcbd0e648ddc4f8e5230ade8fdb781d99e24fa4f13ca96a360c7f7e6751f done\n", + "#29 writing layer sha256:0e96421ff2d0c26cb4a56a0d6b88f587eb3682292d0cea96b1f0e7827e16c170 done\n", "#29 writing layer sha256:0ec682bf99715a9f88631226f3749e2271b8b9f254528ef61f65ed829984821c done\n", - "#29 writing layer sha256:1133dfcee0e851b490d17b3567f50c4b25ba5750da02ba4b3f3630655d0b1a7b done\n", - "#29 writing layer sha256:1294b2835667d633f938174d9fecb18a60bbbebb6fb49788a1f939893a25d1af done\n", - "#29 writing layer sha256:14f2a9cb6c8e39537280f2dff8fe283840b8f18d7bd015c27241025096d54378 done\n", - "#29 writing layer sha256:16a03c6e0373b62f9713416da0229bb7ce2585183141081d3ea8427ad2e84408 done\n", - "#29 writing layer sha256:1b1470e024ee74ee621e4349aff9bb255df3295a62d164d58d3d86951cec384a done\n", + "#29 writing layer sha256:1c5c3aa9c2c8bfd1b9eb36248f5b6d67b3db73ef43440f9dd897615771974b39 done\n", + "#29 writing layer sha256:1f73278b7f17492ce1a8b28b139d54596961596d6790dc20046fa6d5909f3e9c done\n", "#29 writing layer sha256:20d331454f5fb557f2692dfbdbe092c718fd2cb55d5db9d661b62228dacca5c2 done\n", - "#29 writing layer sha256:20e6a881b3368d232df85df00b9dbb528d02267a7433bab5776edc8d5c3a7b6a\n", - "#29 writing layer sha256:20e6a881b3368d232df85df00b9dbb528d02267a7433bab5776edc8d5c3a7b6a 1.4s done\n", - "#29 writing layer sha256:2232aeb26b5b7ea57227e9a5b84da4fb229624d7bc976a5f7ce86d9c8653d277\n", - "#29 writing layer sha256:2232aeb26b5b7ea57227e9a5b84da4fb229624d7bc976a5f7ce86d9c8653d277 done\n", "#29 writing layer sha256:238f69a43816e481f0295995fcf5fe74d59facf0f9f99734c8d0a2fb140630e0 done\n", "#29 writing layer sha256:2ad84487f9d4d31cd1e0a92697a5447dd241935253d036b272ef16d31620c1e7 done\n", - "#29 writing layer sha256:2bb73464628bd4a136c4937f42d522c847bea86b2215ae734949e24c1caf450e done\n", - "#29 writing layer sha256:33bbd9145fa428eef0bf280b53d4171773e254445fb47a36de95154c2d66ee99 done\n", + "#29 writing layer sha256:2e367cdca270a2175c84537f99cfd3f00f286e5977884762ba2b7045637f7eb8 done\n", + "#29 writing layer sha256:2f65750928993b5b31fe572d9e085b53853c5a344feeb0e8615898e285a8c256 done\n", + "#29 writing layer sha256:3777c6498f08c0400339c243e827d465075b7296eb2526e38d9b01c84f8764d8 done\n", "#29 writing layer sha256:3e3e04011ebdba380ab129f0ee390626cb2a600623815ca756340c18bedb9517 done\n", "#29 writing layer sha256:42619ce4a0c9e54cfd0ee41a8e5f27d58b3f51becabd1ac6de725fbe6c42b14a done\n", - "#29 writing layer sha256:43a21fb6c76bd2b3715cc09d9f8c3865dc61c51dd9e2327b429f5bec8fff85d1 done\n", + "#29 writing layer sha256:4900bb0140c0a273dabda530856acf6aa03dd9ad01c11387dfce442474cc467a done\n", "#29 writing layer sha256:49bdc9abf8a437ccff67cc11490ba52c976577992909856a86be872a34d3b950 done\n", "#29 writing layer sha256:4b691ba9f48b41eaa0c754feba8366f1c030464fcbc55eeffa6c86675990933a done\n", "#29 writing layer sha256:4d04a8db404f16c2704fa10739cb6745a0187713a21a6ef0deb34b48629b54c1 done\n", "#29 writing layer sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 done\n", - "#29 writing layer sha256:5275a41be8f6691a490c0a15589e0910c73bf971169ad33a850ef570d37f63dd done\n", - "#29 writing layer sha256:52fbfeaf78318d843054ce2bfb5bfc9f71278939a815f6035ab5b14573ad017b done\n", - "#29 writing layer sha256:5792b18b6f162bae61ff5840cdb9e8567e6847a56ac886f940b47e7271c529a7 done\n", + "#29 writing layer sha256:542bc8c8d18fbc95e6794122c3593a4a693f8ab6dda4460406f4d7b1ae64a2bc done\n", "#29 writing layer sha256:57f244836ad318f9bbb3b29856ae1a5b31038bfbb9b43d2466d51c199eb55041 done\n", + "#29 writing layer sha256:5ad6b64603c501d919b9e56d832eec7cc24abee474ced2f8a952434cbfea90b9 done\n", "#29 writing layer sha256:5b5b131e0f20db4cb8e568b623a95f8fc16ed1c6b322a9366df70b59a881f24f done\n", - "#29 writing layer sha256:5ccb787d371fd3697122101438ddd0f55b537832e9756d2c51ab1d8158710ac5 done\n", + "#29 writing layer sha256:5b90d17b5048adcadefd0b1e4dba9a99247a8827a887e1ca042df375c85b518d done\n", "#29 writing layer sha256:62452179df7c18e292f141d4aec29e6aba9ff8270c893731169fc6f41dc07631 done\n", "#29 writing layer sha256:6630c387f5f2115bca2e646fd0c2f64e1f3d5431c2e050abe607633883eda230 done\n", - "#29 writing layer sha256:69af4b756272a77f683a8d118fd5ca55c03ad5f1bacc673b463f54d16b833da5 done\n", - "#29 writing layer sha256:6ae1f1fb92c0cb2b6e219f687b08c8e511501a7af696c943ca20d119eba7cd02 done\n", - "#29 writing layer sha256:6deb3d550b15a5e099c0b3d0cbc242e351722ca16c058d3a6c28ba1a02824d0f done\n", - "#29 writing layer sha256:7386814d57100e2c7389fbf4e16f140f5c549d31434c62c3884a85a3ee5cd2a7 done\n", + "#29 writing layer sha256:6661e0146e77a8bcb03edbfda95bf7780c8bb4c4f98bc03a398c88f4b2403d12 done\n", + "#29 writing layer sha256:717ebf8c9c66ae393ad01e50dbac4413d7b026b9c97d4d348b22ad17052a1a35 done\n", + "#29 writing layer sha256:773c6815e5e7d6855a62f8c5e2fabce3d939ded36c5420f15b54dd7908cdbcfa done\n", "#29 writing layer sha256:7852b73ea931e3a8d3287ee7ef3cf4bad068e44f046583bfc2b81336fb299284 done\n", - "#29 writing layer sha256:7e73869c74822e4539e104a3d2aff853f4622cd0bb873576db1db53c9e91f621 done\n", - "#29 writing layer sha256:7eae142b38745fe88962874372374deb672998600264a17e638c010b79e6b535 done\n", - "#29 writing layer sha256:7f2e5ab2c599fa36698918d3e73c991d8616fff9037077cd230529e7cd1c5e0e done\n", + "#29 writing layer sha256:7f8ec130348bcdac81c295e37fe82b4a6e5e9a3ca980a6343809c561020d82d7 done\n", + "#29 writing layer sha256:80885adcad6b5d021bb9f68b6c952018085bb4ce72011bdc0cf7fe8178b5960b done\n", "#29 writing layer sha256:82a3436133b2b17bb407c7fe488932aa0ca55411f23ab55c34a6134b287c6a27 done\n", + "#29 writing layer sha256:8371d15eb4d69b1d98174dd098b8ddd5c4f19ec6f8d8b67e72dfa9891dc454b4 done\n", + "#29 writing layer sha256:85713f9b166b5add777c524ee807f6265d88b967cbeb9f961d6b09bf220c9a65 done\n", + "#29 writing layer sha256:8fe00505006a09966e763918147ef6ed55bb6695b26e4940c780ee430dc5da8e done\n", "#29 writing layer sha256:90eae6faa5cc5ba62f12c25915cdfb1a7a51abfba0d05cb5818c3f908f4e345f done\n", + "#29 writing layer sha256:9205d97d9d3e906698bcc6c42d45727c2fa6ec2622abf953d46778c3b8c78edc done\n", + "#29 writing layer sha256:993369dbcc13162a6654d2a3e990b8d8b5f37963564d25710e12764337261ae3 done\n", + "#29 writing layer sha256:99e42a4adebadb39bf55bf94bbd9fb8034230ee19b6b0a42e6ff96f2e7794f30 done\n", "#29 writing layer sha256:9ac855545fa90ed2bf3b388fdff9ef06ac9427b0c0fca07c9e59161983d8827e done\n", "#29 writing layer sha256:9d19ee268e0d7bcf6716e6658ee1b0384a71d6f2f9aa1ae2085610cf7c7b316f done\n", - "#29 writing layer sha256:a10c8d7d2714eabf661d1f43a1ccb87a51748cbb9094d5bc0b713e2481b5d329 done\n", + "#29 writing layer sha256:9fafbd4203c4fefe007a462e0d2cd4c1c7c41db2cfdc58d212279e1b9b4b230c done\n", "#29 writing layer sha256:a1748eee9d376f97bd19225ba61dfada9986f063f4fc429e435f157abb629fc6 done\n", + "#29 writing layer sha256:a251fe5ae6c6d2d5034e4ca88b5dfe5d4827ff90b18e9b143a073232a32bb18d done\n", "#29 writing layer sha256:a68f4e0ec09ec3b78cb4cf8e4511d658e34e7b6f676d7806ad9703194ff17604 done\n", "#29 writing layer sha256:a8e4decc8f7289623b8fd7b9ba1ca555b5a755ebdbf81328d68209f148d9e602 done\n", - "#29 writing layer sha256:ad2ce23d07e249bf72ef2c987780659b7b366010d159a616441860e7092ac630 0.0s done\n", "#29 writing layer sha256:afde1c269453ce68a0f2b54c1ba8c5ecddeb18a19e5618a4acdef1f0fe3921af done\n", + "#29 writing layer sha256:b406feb20a37b8c87ef4f5ef814039e3adc90473d50c366b7d9bb6ded4e94a2e done\n", "#29 writing layer sha256:b48a5fafcaba74eb5d7e7665601509e2889285b50a04b5b639a23f8adc818157 done\n", + "#29 writing layer sha256:b81a338aa8a66234f506c0f43894070953a5ea771f81fd5a12c64d7e0a2c099a done\n", + "#29 writing layer sha256:b98f5f4d1c99ef6c3b4ecce24d32753787f67982a13b216d17115c13fee3aa58 done\n", + "#29 writing layer sha256:ba64637beb4e69fab9219c0ded5ca860e7a78b347dfd15a1cdea5ab0ecd9b2fe done\n", "#29 writing layer sha256:ba9f7c75e4dd7942b944679995365aab766d3677da2e69e1d74472f471a484dd done\n", - "#29 writing layer sha256:bdfc73b2a0fa11b4086677e117a2f9feb6b4ffeccb23a3d58a30543339607e31 done\n", - "#29 writing layer sha256:c175bb235295e50de2961fa1e1a2235c57e6eba723a914287dfc26d3be0eac11 done\n", + "#29 writing layer sha256:bdc13166216ae226fa6976f9ce91f4f259d43972f1e0a9b723e436919534b2f4 done\n", + "#29 writing layer sha256:c815f0be64eded102822d81e029bd23b0d8d9a0fbfeb492ec0b4b0bc4ee777bf done\n", "#29 writing layer sha256:c98533d2908f36a5e9b52faae83809b3b6865b50e90e2817308acfc64cd3655f done\n", - "#29 writing layer sha256:cb6c95b33bc30dd285c5b3cf99a05281b8f12decae1c932ab64bd58f56354021 done\n", "#29 writing layer sha256:d7da5c5e9a40c476c4b3188a845e3276dedfd752e015ea5113df5af64d4d43f7 done\n", - "#29 writing layer sha256:de5a53c62648303a3a81f6443a00acfdaceea5d81a55b26a9dfcff656363ec2c 0.0s done\n", - "#29 writing layer sha256:e32a133f2d3ec74bbd17b59c6276eb0bffaff9e0737558a385e2f2280b4ca568 0.0s done\n", - "#29 writing layer sha256:e4aedc686433c0ec5e676e6cc54a164345f7016aa0eb714f00c07e11664a1168 done\n", + "#29 writing layer sha256:db20521a869adda8244cb64b783c65e1a911efaae0e73ae00e4a34ea6213d6ce done\n", + "#29 writing layer sha256:df4fd0ac710d7af949afbc6d25b5b4daf3f0596dabf3dec36fa7ca8fa6e1d049 done\n", + "#29 writing layer sha256:e16d56ac40a253ee3622e4a00c4d5f0cc28effdef15ac4b2c51b78f4732abcef done\n", + "#29 writing layer sha256:e291ddecfbe16b95ee9e90b5e90b1a3d0cfd53dc5e720d6b0f3d28e4a47cf5ac done\n", "#29 writing layer sha256:e8acb678f16bc0c369d5cf9c184f2d3a1c773986816526e5e3e9c0354f7e757f done\n", "#29 writing layer sha256:e9225f7ab6606813ec9acba98a064826ebfd6713a9645a58cd068538af1ecddb done\n", - "#29 writing layer sha256:f06b2d19cffd90387b7ccd4e80ace09ab21995cf85c940091e6c80907532bda8\n", - "#29 preparing build cache for export 1.9s done\n", - "#29 writing layer sha256:f06b2d19cffd90387b7ccd4e80ace09ab21995cf85c940091e6c80907532bda8 0.0s done\n", - "#29 writing layer sha256:f33546e75bf1a7d9dc9e21b9a2c54c9d09b24790ad7a4192a8509002ceb14688 done\n", + "#29 writing layer sha256:f249faf9663a96b0911a903f8803b11a553c59b698013fb8343492fefdaaea90 done\n", "#29 writing layer sha256:f608e2fbff86e98627b7e462057e7d2416522096d73fe4664b82fe6ce8a4047d done\n", - "#29 writing layer sha256:f7702077ced42a1ee35e7f5e45f72634328ff3bcfe3f57735ba80baa5ec45daf done\n", - "#29 writing layer sha256:fa66a49172c6e821a1bace57c007c01da10cbc61507c44f8cdfeed8c4e5febab done\n", - "#29 writing config sha256:488336ab32415713da34c305ad87c5f983293c64534687f5fb685eb5b957c49c 0.0s done\n", - "#29 writing cache manifest sha256:69fe5811c303d48c634f794997602fd274d7922354e7aedf0dcd70b373a7a6a8 0.0s done\n", - "#29 DONE 1.9s\n", - "[2024-04-10 16:19:53,891] [INFO] (packager) - Build Summary:\n", + "#29 writing layer sha256:f65d191416580d6c38e3d95eee12377b75a4df548be1492618ce2a8c3c41b99e done\n", + "#29 writing config sha256:667dd53a9dabe2a6df74998fba6696aa65cff11b6674224ea5fd11636dd17830 done\n", + "#29 writing cache manifest sha256:61eef6c09598c4acc5e04f3511b9ba07ecb6d0dd5fdef2c1e14216a8458fbd78 done\n", + "#29 DONE 0.6s\n", + "[2024-04-22 15:07:09,074] [INFO] (packager) - Build Summary:\n", "\n", "Platform: x64-workstation/dgpu\n", " Status: Succeeded\n", @@ -1692,7 +1625,7 @@ "source": [ "tag_prefix = \"simple_imaging_app\"\n", "\n", - "!monai-deploy package simple_imaging_app -c simple_imaging_app/app.yaml -t {tag_prefix}:1.0 --platform x64-workstation -l DEBUG" + "!monai-deploy package simple_imaging_app -c simple_imaging_app/app.yaml -t {tag_prefix}:1.0 --platform x64-workstation -l DEBUG --monai-deploy-sdk-file /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz" ] }, { @@ -1710,14 +1643,14 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 51, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "simple_imaging_app-x64-workstation-dgpu-linux-amd64 1.0 00503bdec781 51 seconds ago 12.3GB\n" + "simple_imaging_app-x64-workstation-dgpu-linux-amd64 1.0 f5b1c614b522 About an hour ago 12.5GB\n" ] } ], @@ -1739,7 +1672,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 52, "metadata": {}, "outputs": [ { @@ -1797,17 +1730,17 @@ " \"platformConfig\": \"dgpu\"\n", "}\n", "\n", - "2024-04-10 23:19:57 [INFO] Copying application from /opt/holoscan/app to /var/run/holoscan/export/app\n", + "2024-04-22 22:07:11 [INFO] Copying application from /opt/holoscan/app to /var/run/holoscan/export/app\n", "\n", - "2024-04-10 23:19:57 [INFO] Copying application manifest file from /etc/holoscan/app.json to /var/run/holoscan/export/config/app.json\n", - "2024-04-10 23:19:57 [INFO] Copying pkg manifest file from /etc/holoscan/pkg.json to /var/run/holoscan/export/config/pkg.json\n", - "2024-04-10 23:19:57 [INFO] Copying application configuration from /var/holoscan/app.yaml to /var/run/holoscan/export/config/app.yaml\n", + "2024-04-22 22:07:11 [INFO] Copying application manifest file from /etc/holoscan/app.json to /var/run/holoscan/export/config/app.json\n", + "2024-04-22 22:07:11 [INFO] Copying pkg manifest file from /etc/holoscan/pkg.json to /var/run/holoscan/export/config/pkg.json\n", + "2024-04-22 22:07:11 [INFO] Copying application configuration from /var/holoscan/app.yaml to /var/run/holoscan/export/config/app.yaml\n", "\n", - "2024-04-10 23:19:57 [INFO] Copying models from /opt/holoscan/models to /var/run/holoscan/export/models\n", - "2024-04-10 23:19:57 [INFO] '/opt/holoscan/models' cannot be found.\n", + "2024-04-22 22:07:11 [INFO] Copying models from /opt/holoscan/models to /var/run/holoscan/export/models\n", + "2024-04-22 22:07:11 [INFO] '/opt/holoscan/models' cannot be found.\n", "\n", - "2024-04-10 23:19:57 [INFO] Copying documentation from /opt/holoscan/docs/ to /var/run/holoscan/export/docs\n", - "2024-04-10 23:19:57 [INFO] '/opt/holoscan/docs/' cannot be found.\n", + "2024-04-22 22:07:11 [INFO] Copying documentation from /opt/holoscan/docs/ to /var/run/holoscan/export/docs\n", + "2024-04-22 22:07:11 [INFO] '/opt/holoscan/docs/' cannot be found.\n", "\n", "app config\n" ] @@ -1834,29 +1767,29 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 53, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[2024-04-10 16:19:58,260] [INFO] (runner) - Checking dependencies...\n", - "[2024-04-10 16:19:58,260] [INFO] (runner) - --> Verifying if \"docker\" is installed...\n", + "[2024-04-22 15:07:12,840] [INFO] (runner) - Checking dependencies...\n", + "[2024-04-22 15:07:12,840] [INFO] (runner) - --> Verifying if \"docker\" is installed...\n", "\n", - "[2024-04-10 16:19:58,260] [INFO] (runner) - --> Verifying if \"docker-buildx\" is installed...\n", + "[2024-04-22 15:07:12,840] [INFO] (runner) - --> Verifying if \"docker-buildx\" is installed...\n", "\n", - "[2024-04-10 16:19:58,260] [INFO] (runner) - --> Verifying if \"simple_imaging_app-x64-workstation-dgpu-linux-amd64:1.0\" is available...\n", + "[2024-04-22 15:07:12,840] [INFO] (runner) - --> Verifying if \"simple_imaging_app-x64-workstation-dgpu-linux-amd64:1.0\" is available...\n", "\n", - "[2024-04-10 16:19:58,323] [INFO] (runner) - Reading HAP/MAP manifest...\n", - "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.56kB to /tmp/tmpkogym2cj/app.json\n", - "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.05kB to /tmp/tmpkogym2cj/pkg.json\n", - "[2024-04-10 16:19:58,545] [INFO] (runner) - --> Verifying if \"nvidia-ctk\" is installed...\n", + "[2024-04-22 15:07:12,923] [INFO] (runner) - Reading HAP/MAP manifest...\n", + "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.56kB to /tmp/tmpvd04qix3/app.json\n", + "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.05kB to /tmp/tmpvd04qix3/pkg.json\n", + "[2024-04-22 15:07:13,155] [INFO] (runner) - --> Verifying if \"nvidia-ctk\" is installed...\n", "\n", - "[2024-04-10 16:19:58,545] [INFO] (runner) - --> Verifying \"nvidia-ctk\" version...\n", + "[2024-04-22 15:07:13,156] [INFO] (runner) - --> Verifying \"nvidia-ctk\" version...\n", "\n", - "[2024-04-10 16:19:58,814] [INFO] (common) - Launching container (8e18e862585f) using image 'simple_imaging_app-x64-workstation-dgpu-linux-amd64:1.0'...\n", - " container name: unruffled_kalam\n", + "[2024-04-22 15:07:13,414] [INFO] (common) - Launching container (0a33b953c981) using image 'simple_imaging_app-x64-workstation-dgpu-linux-amd64:1.0'...\n", + " container name: zealous_greider\n", " host name: mingq-dt\n", " network: host\n", " user: 1000:1000\n", @@ -1866,43 +1799,39 @@ " shared memory size: 67108864\n", " devices: \n", " group_add: 44\n", - "2024-04-10 23:19:59 [INFO] Launching application python3 /opt/holoscan/app ...\n", + "2024-04-22 22:07:13 [INFO] Launching application python3 /opt/holoscan/app ...\n", "\n", - "[2024-04-10 23:20:00,177] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['/opt/holoscan/app'])\n", + "[2024-04-22 22:07:14,707] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['/opt/holoscan/app'])\n", "\n", - "[2024-04-10 23:20:00,178] [INFO] (root) - AppContext object: AppContext(input_path=/var/holoscan/input, output_path=/var/holoscan/output, model_path=/opt/holoscan/models, workdir=/var/holoscan)\n", + "[2024-04-22 22:07:14,707] [INFO] (root) - AppContext object: AppContext(input_path=/var/holoscan/input, output_path=/var/holoscan/output, model_path=/opt/holoscan/models, workdir=/var/holoscan)\n", "\n", - "[2024-04-10 23:20:00,178] [INFO] (root) - sample_data_path: /var/holoscan/input\n", + "[2024-04-22 22:07:14,707] [INFO] (root) - sample_data_path: /var/holoscan/input\n", "\n", "[info] [app_driver.cpp:1161] Launching the driver/health checking service\n", "\n", - "[info] [gxf_executor.cpp:211] Creating context\n", + "[info] [gxf_executor.cpp:247] Creating context\n", "\n", "[info] [server.cpp:87] Health checking server listening on 0.0.0.0:8777\n", "\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", - "\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", + "[info] [gxf_executor.cpp:1672] Loading extensions from configs...\n", "\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", + "[info] [gxf_executor.cpp:1842] Activating Graph...\n", "\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", + "[info] [gxf_executor.cpp:1874] Running Graph...\n", "\n", - "[info] [greedy_scheduler.cpp:190] Scheduling 3 entities\n", + "[info] [gxf_executor.cpp:1876] Waiting for completion...\n", "\n", - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", + "\u001b[0m2024-04-22 22:07:14.743 INFO gxf/std/greedy_scheduler.cpp@191: Scheduling 3 entities\u001b[0m\n", "\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", + "\u001b[0m2024-04-22 22:07:15.616 INFO gxf/std/greedy_scheduler.cpp@372: Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\u001b[0m\n", "\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", + "[info] [gxf_executor.cpp:1879] Deactivating Graph...\n", "\n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", + "\u001b[0m2024-04-22 22:07:15.616 INFO gxf/std/greedy_scheduler.cpp@401: Scheduler finished.\u001b[0m\n", "\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", + "[info] [gxf_executor.cpp:1887] Graph execution finished.\n", "\n", - "[info] [gxf_executor.cpp:230] Destroying context\n", + "[info] [gxf_executor.cpp:275] Destroying context\n", "\n", "Number of times operator sobel_op whose class is defined in sobel_operator called: 1\n", "\n", @@ -1916,7 +1845,7 @@ "\n", "Data type of output post conversion: , max = 91\n", "\n", - "[2024-04-10 16:20:01,327] [INFO] (common) - Container 'unruffled_kalam'(8e18e862585f) exited.\n" + "[2024-04-22 15:07:16,003] [INFO] (common) - Container 'zealous_greider'(0a33b953c981) exited.\n" ] } ], @@ -1928,16 +1857,16 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 54, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 27, + "execution_count": 54, "metadata": {}, "output_type": "execute_result" }, diff --git a/notebooks/tutorials/02_mednist_app-prebuilt.ipynb b/notebooks/tutorials/02_mednist_app-prebuilt.ipynb index 97757a6e..e69de29b 100644 --- a/notebooks/tutorials/02_mednist_app-prebuilt.ipynb +++ b/notebooks/tutorials/02_mednist_app-prebuilt.ipynb @@ -1,1951 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Deploying a MedNIST Classifier App with MONAI Deploy App SDK (Prebuilt Model)\n", - "\n", - "This tutorial demos the process of packaging up a trained model using MONAI Deploy App SDK into an deployable inference application which can be run as a local program, as well as an MONAI Application Package (MAP) for containerized workflow execution." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Clone the github project (the latest version of the main branch only)" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Cloning into 'source'...\n", - "remote: Enumerating objects: 276, done.\u001b[K\n", - "remote: Counting objects: 100% (276/276), done.\u001b[K\n", - "remote: Compressing objects: 100% (222/222), done.\u001b[K\n", - "remote: Total 276 (delta 55), reused 150 (delta 32), pack-reused 0\u001b[K\n", - "Receiving objects: 100% (276/276), 1.43 MiB | 3.51 MiB/s, done.\n", - "Resolving deltas: 100% (55/55), done.\n" - ] - } - ], - "source": [ - "!rm -rf source \\\n", - " && git clone --branch main --depth 1 https://github.com/Project-MONAI/monai-deploy-app-sdk.git source \\\n", - " && rm -rf source/.git" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "app.yaml mednist_classifier_monaideploy.py requirements.txt\n" - ] - } - ], - "source": [ - "!ls source/examples/apps/mednist_classifier_monaideploy/" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Install monai-deploy-app-sdk package" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: monai-deploy-app-sdk in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (0.5.1+12.gb2f5a07.dirty)\n", - "Requirement already satisfied: numpy>=1.21.6 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from monai-deploy-app-sdk) (1.26.4)\n", - "Requirement already satisfied: holoscan~=1.0 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from monai-deploy-app-sdk) (1.0.3)\n", - "Requirement already satisfied: colorama>=0.4.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from monai-deploy-app-sdk) (0.4.6)\n", - "Requirement already satisfied: typeguard>=3.0.0 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from monai-deploy-app-sdk) (4.2.1)\n", - "Requirement already satisfied: pip==23.3.2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from holoscan~=1.0->monai-deploy-app-sdk) (23.3.2)\n", - "Requirement already satisfied: cupy-cuda12x==12.2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from holoscan~=1.0->monai-deploy-app-sdk) (12.2.0)\n", - "Requirement already satisfied: cloudpickle==2.2.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from holoscan~=1.0->monai-deploy-app-sdk) (2.2.1)\n", - "Requirement already satisfied: python-on-whales==0.60.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from holoscan~=1.0->monai-deploy-app-sdk) (0.60.1)\n", - "Requirement already satisfied: Jinja2==3.1.2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from holoscan~=1.0->monai-deploy-app-sdk) (3.1.2)\n", - "Requirement already satisfied: packaging==23.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from holoscan~=1.0->monai-deploy-app-sdk) (23.1)\n", - "Requirement already satisfied: pyyaml==6.0 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from holoscan~=1.0->monai-deploy-app-sdk) (6.0)\n", - "Requirement already satisfied: requests==2.28.2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from holoscan~=1.0->monai-deploy-app-sdk) (2.28.2)\n", - "Requirement already satisfied: psutil==5.9.6 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from holoscan~=1.0->monai-deploy-app-sdk) (5.9.6)\n", - "Requirement already satisfied: wheel-axle-runtime<1.0 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from holoscan~=1.0->monai-deploy-app-sdk) (0.0.5)\n", - "Requirement already satisfied: fastrlock>=0.5 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from cupy-cuda12x==12.2->holoscan~=1.0->monai-deploy-app-sdk) (0.8.2)\n", - "Requirement already satisfied: MarkupSafe>=2.0 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from Jinja2==3.1.2->holoscan~=1.0->monai-deploy-app-sdk) (2.1.5)\n", - "Requirement already satisfied: pydantic<2,>=1.5 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk) (1.10.15)\n", - "Requirement already satisfied: tqdm in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk) (4.66.2)\n", - "Requirement already satisfied: typer>=0.4.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk) (0.12.2)\n", - "Requirement already satisfied: typing-extensions in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk) (4.11.0)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk) (3.3.2)\n", - "Requirement already satisfied: idna<4,>=2.5 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk) (3.6)\n", - "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk) (1.26.18)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk) (2024.2.2)\n", - "Requirement already satisfied: filelock in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from wheel-axle-runtime<1.0->holoscan~=1.0->monai-deploy-app-sdk) (3.13.3)\n", - "Requirement already satisfied: click>=8.0.0 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from typer>=0.4.1->python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk) (8.1.7)\n", - "Requirement already satisfied: shellingham>=1.3.0 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from typer>=0.4.1->python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk) (1.5.4)\n", - "Requirement already satisfied: rich>=10.11.0 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from typer>=0.4.1->python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk) (13.7.1)\n", - "Requirement already satisfied: markdown-it-py>=2.2.0 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from rich>=10.11.0->typer>=0.4.1->python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk) (3.0.0)\n", - "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from rich>=10.11.0->typer>=0.4.1->python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk) (2.17.2)\n", - "Requirement already satisfied: mdurl~=0.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer>=0.4.1->python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk) (0.1.2)\n", - "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.3.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.0\u001b[0m\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n" - ] - } - ], - "source": [ - "!pip install monai-deploy-app-sdk" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Install necessary packages for the app" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: monai in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (1.3.0)\n", - "Requirement already satisfied: Pillow in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (10.3.0)\n", - "Requirement already satisfied: numpy>=1.20 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from monai) (1.26.4)\n", - "Requirement already satisfied: torch>=1.9 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from monai) (2.0.1)\n", - "Requirement already satisfied: filelock in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (3.13.3)\n", - "Requirement already satisfied: typing-extensions in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (4.11.0)\n", - "Requirement already satisfied: sympy in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (1.12)\n", - "Requirement already satisfied: networkx in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (3.1)\n", - "Requirement already satisfied: jinja2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (3.1.2)\n", - "Requirement already satisfied: nvidia-cuda-nvrtc-cu11==11.7.99 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (11.7.99)\n", - "Requirement already satisfied: nvidia-cuda-runtime-cu11==11.7.99 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (11.7.99)\n", - "Requirement already satisfied: nvidia-cuda-cupti-cu11==11.7.101 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (11.7.101)\n", - "Requirement already satisfied: nvidia-cudnn-cu11==8.5.0.96 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (8.5.0.96)\n", - "Requirement already satisfied: nvidia-cublas-cu11==11.10.3.66 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (11.10.3.66)\n", - "Requirement already satisfied: nvidia-cufft-cu11==10.9.0.58 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (10.9.0.58)\n", - "Requirement already satisfied: nvidia-curand-cu11==10.2.10.91 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (10.2.10.91)\n", - "Requirement already satisfied: nvidia-cusolver-cu11==11.4.0.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (11.4.0.1)\n", - "Requirement already satisfied: nvidia-cusparse-cu11==11.7.4.91 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (11.7.4.91)\n", - "Requirement already satisfied: nvidia-nccl-cu11==2.14.3 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (2.14.3)\n", - "Requirement already satisfied: nvidia-nvtx-cu11==11.7.91 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (11.7.91)\n", - "Requirement already satisfied: triton==2.0.0 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from torch>=1.9->monai) (2.0.0)\n", - "Requirement already satisfied: setuptools in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from nvidia-cublas-cu11==11.10.3.66->torch>=1.9->monai) (69.2.0)\n", - "Requirement already satisfied: wheel in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from nvidia-cublas-cu11==11.10.3.66->torch>=1.9->monai) (0.43.0)\n", - "Requirement already satisfied: cmake in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from triton==2.0.0->torch>=1.9->monai) (3.29.0.1)\n", - "Requirement already satisfied: lit in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from triton==2.0.0->torch>=1.9->monai) (18.1.2)\n", - "Requirement already satisfied: MarkupSafe>=2.0 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from jinja2->torch>=1.9->monai) (2.1.5)\n", - "Requirement already satisfied: mpmath>=0.19 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from sympy->torch>=1.9->monai) (1.3.0)\n", - "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.3.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.0\u001b[0m\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n" - ] - } - ], - "source": [ - "!pip install monai Pillow # for MONAI transforms and Pillow\n", - "!python -c \"import pydicom\" || pip install -q \"pydicom>=1.4.2\"\n", - "!python -c \"import highdicom\" || pip install -q \"highdicom>=0.18.2\" # for the use of DICOM Writer operators" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Download/Extract mednist_classifier_data.zip from Google Drive" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: gdown in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (5.1.0)\n", - "Requirement already satisfied: beautifulsoup4 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (4.12.3)\n", - "Requirement already satisfied: filelock in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (3.13.3)\n", - "Requirement already satisfied: requests[socks] in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (2.28.2)\n", - "Requirement already satisfied: tqdm in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (4.66.2)\n", - "Requirement already satisfied: soupsieve>1.2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from beautifulsoup4->gdown) (2.5)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.3.2)\n", - "Requirement already satisfied: idna<4,>=2.5 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.6)\n", - "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (1.26.18)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (2024.2.2)\n", - "Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (1.7.1)\n", - "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.3.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.0\u001b[0m\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", - "Downloading...\n", - "From (original): https://drive.google.com/uc?id=1yJ4P-xMNEfN6lIOq_u6x1eMAq1_MJu-E\n", - "From (redirected): https://drive.google.com/uc?id=1yJ4P-xMNEfN6lIOq_u6x1eMAq1_MJu-E&confirm=t&uuid=8dfa9939-2267-4d12-ba17-3e35b1626357\n", - "To: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/mednist_classifier_data.zip\n", - "100%|██████████████████████████████████████| 28.6M/28.6M [00:00<00:00, 62.3MB/s]\n" - ] - } - ], - "source": [ - "# Download mednist_classifier_data.zip\n", - "!pip install gdown \n", - "!gdown \"https://drive.google.com/uc?id=1yJ4P-xMNEfN6lIOq_u6x1eMAq1_MJu-E\"" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Archive: mednist_classifier_data.zip\n", - " extracting: classifier.zip \n", - " extracting: input/AbdomenCT_007000.jpeg \n", - "classifier.zip\n" - ] - } - ], - "source": [ - "# Unzip the downloaded mednist_classifier_data.zip from the web browser or using gdown, and set up folders\n", - "input_folder = \"input\"\n", - "output_folder = \"output\"\n", - "models_folder = \"models\"\n", - "!rm -rf {input_folder}\n", - "!unzip -o \"mednist_classifier_data.zip\"\n", - "\n", - "# Need to copy the model file to its own clean subfolder for pacakging, to workaround an issue in the Packager\n", - "models_folder = \"models\"\n", - "!rm -rf {models_folder} && mkdir -p {models_folder}/model && cp classifier.zip {models_folder}/model && ls {models_folder}/model" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Set up environment variables\n", - "The application uses well-known enviornment variables for the input/output data path, working dir, as well as AI model file path if applicable. Defaults are used if these environment variable are absent.\n", - "\n", - "Set the environment variables corresponding to the extracted data path." - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "env: HOLOSCAN_INPUT_PATH=input\n", - "env: HOLOSCAN_OUTPUT_PATH=output\n", - "env: HOLOSCAN_MODEL_PATH=models\n" - ] - } - ], - "source": [ - "%env HOLOSCAN_INPUT_PATH {input_folder}\n", - "%env HOLOSCAN_OUTPUT_PATH {output_folder}\n", - "%env HOLOSCAN_MODEL_PATH {models_folder}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Package app (creating MAP container image)\n", - "\n", - "Now we can use the CLI package command to build the MONAI Application Package (MAP) container image based on a supported base image\n", - "\n", - "Use `-l DEBUG` option to see progress.\n", - "\n", - ":::{note}\n", - "This assumes that NVIDIA Container Toolkit or nvidia docker is installed on the local machine.\n", - ":::" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2024-04-10 16:23:51,962] [INFO] (packager.parameters) - Application: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/source/examples/apps/mednist_classifier_monaideploy/mednist_classifier_monaideploy.py\n", - "[2024-04-10 16:23:51,962] [INFO] (packager.parameters) - Detected application type: Python File\n", - "[2024-04-10 16:23:51,962] [INFO] (packager) - Scanning for models in /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models...\n", - "[2024-04-10 16:23:51,962] [DEBUG] (packager) - Model model=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models/model added.\n", - "[2024-04-10 16:23:51,962] [INFO] (packager) - Reading application configuration from /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/source/examples/apps/mednist_classifier_monaideploy/app.yaml...\n", - "[2024-04-10 16:23:51,964] [INFO] (packager) - Generating app.json...\n", - "[2024-04-10 16:23:51,964] [INFO] (packager) - Generating pkg.json...\n", - "[2024-04-10 16:23:51,969] [DEBUG] (common) - \n", - "=============== Begin app.json ===============\n", - "{\n", - " \"apiVersion\": \"1.0.0\",\n", - " \"command\": \"[\\\"python3\\\", \\\"/opt/holoscan/app/mednist_classifier_monaideploy.py\\\"]\",\n", - " \"environment\": {\n", - " \"HOLOSCAN_APPLICATION\": \"/opt/holoscan/app\",\n", - " \"HOLOSCAN_INPUT_PATH\": \"input/\",\n", - " \"HOLOSCAN_OUTPUT_PATH\": \"output/\",\n", - " \"HOLOSCAN_WORKDIR\": \"/var/holoscan\",\n", - " \"HOLOSCAN_MODEL_PATH\": \"/opt/holoscan/models\",\n", - " \"HOLOSCAN_CONFIG_PATH\": \"/var/holoscan/app.yaml\",\n", - " \"HOLOSCAN_APP_MANIFEST_PATH\": \"/etc/holoscan/app.json\",\n", - " \"HOLOSCAN_PKG_MANIFEST_PATH\": \"/etc/holoscan/pkg.json\",\n", - " \"HOLOSCAN_DOCS_PATH\": \"/opt/holoscan/docs\",\n", - " \"HOLOSCAN_LOGS_PATH\": \"/var/holoscan/logs\"\n", - " },\n", - " \"input\": {\n", - " \"path\": \"input/\",\n", - " \"formats\": null\n", - " },\n", - " \"liveness\": null,\n", - " \"output\": {\n", - " \"path\": \"output/\",\n", - " \"formats\": null\n", - " },\n", - " \"readiness\": null,\n", - " \"sdk\": \"monai-deploy\",\n", - " \"sdkVersion\": \"0.5.1\",\n", - " \"timeout\": 0,\n", - " \"version\": 1.0,\n", - " \"workingDirectory\": \"/var/holoscan\"\n", - "}\n", - "================ End app.json ================\n", - " \n", - "[2024-04-10 16:23:51,969] [DEBUG] (common) - \n", - "=============== Begin pkg.json ===============\n", - "{\n", - " \"apiVersion\": \"1.0.0\",\n", - " \"applicationRoot\": \"/opt/holoscan/app\",\n", - " \"modelRoot\": \"/opt/holoscan/models\",\n", - " \"models\": {\n", - " \"model\": \"/opt/holoscan/models/model\"\n", - " },\n", - " \"resources\": {\n", - " \"cpu\": 1,\n", - " \"gpu\": 1,\n", - " \"memory\": \"1Gi\",\n", - " \"gpuMemory\": \"1Gi\"\n", - " },\n", - " \"version\": 1.0,\n", - " \"platformConfig\": \"dgpu\"\n", - "}\n", - "================ End pkg.json ================\n", - " \n", - "[2024-04-10 16:23:52,003] [DEBUG] (packager.builder) - \n", - "========== Begin Dockerfile ==========\n", - "\n", - "\n", - "FROM nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "\n", - "ENV DEBIAN_FRONTEND=noninteractive\n", - "ENV TERM=xterm-256color\n", - "\n", - "ARG UNAME\n", - "ARG UID\n", - "ARG GID\n", - "\n", - "RUN mkdir -p /etc/holoscan/ \\\n", - " && mkdir -p /opt/holoscan/ \\\n", - " && mkdir -p /var/holoscan \\\n", - " && mkdir -p /opt/holoscan/app \\\n", - " && mkdir -p /var/holoscan/input \\\n", - " && mkdir -p /var/holoscan/output\n", - "\n", - "LABEL base=\"nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\"\n", - "LABEL tag=\"mednist_app:1.0\"\n", - "LABEL org.opencontainers.image.title=\"MONAI Deploy App Package - MedNIST Classifier App\"\n", - "LABEL org.opencontainers.image.version=\"1.0\"\n", - "LABEL org.nvidia.holoscan=\"1.0.3\"\n", - "LABEL org.monai.deploy.app-sdk=\"0.5.1\"\n", - "\n", - "\n", - "ENV HOLOSCAN_ENABLE_HEALTH_CHECK=true\n", - "ENV HOLOSCAN_INPUT_PATH=/var/holoscan/input\n", - "ENV HOLOSCAN_OUTPUT_PATH=/var/holoscan/output\n", - "ENV HOLOSCAN_WORKDIR=/var/holoscan\n", - "ENV HOLOSCAN_APPLICATION=/opt/holoscan/app\n", - "ENV HOLOSCAN_TIMEOUT=0\n", - "ENV HOLOSCAN_MODEL_PATH=/opt/holoscan/models\n", - "ENV HOLOSCAN_DOCS_PATH=/opt/holoscan/docs\n", - "ENV HOLOSCAN_CONFIG_PATH=/var/holoscan/app.yaml\n", - "ENV HOLOSCAN_APP_MANIFEST_PATH=/etc/holoscan/app.json\n", - "ENV HOLOSCAN_PKG_MANIFEST_PATH=/etc/holoscan/pkg.json\n", - "ENV HOLOSCAN_LOGS_PATH=/var/holoscan/logs\n", - "ENV PATH=/root/.local/bin:/opt/nvidia/holoscan:$PATH\n", - "ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/libtorch/1.13.1/lib/:/opt/nvidia/holoscan/lib\n", - "\n", - "RUN apt-get update \\\n", - " && apt-get install -y curl jq \\\n", - " && rm -rf /var/lib/apt/lists/*\n", - "\n", - "ENV PYTHONPATH=\"/opt/holoscan/app:$PYTHONPATH\"\n", - "\n", - "\n", - "\n", - "RUN groupadd -f -g $GID $UNAME\n", - "RUN useradd -rm -d /home/$UNAME -s /bin/bash -g $GID -G sudo -u $UID $UNAME\n", - "RUN chown -R holoscan /var/holoscan \n", - "RUN chown -R holoscan /var/holoscan/input \n", - "RUN chown -R holoscan /var/holoscan/output \n", - "\n", - "# Set the working directory\n", - "WORKDIR /var/holoscan\n", - "\n", - "# Copy HAP/MAP tool script\n", - "COPY ./tools /var/holoscan/tools\n", - "RUN chmod +x /var/holoscan/tools\n", - "\n", - "\n", - "# Copy gRPC health probe\n", - "\n", - "USER $UNAME\n", - "\n", - "ENV PATH=/root/.local/bin:/home/holoscan/.local/bin:/opt/nvidia/holoscan:$PATH\n", - "\n", - "COPY ./pip/requirements.txt /tmp/requirements.txt\n", - "\n", - "RUN pip install --upgrade pip\n", - "RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", - "\n", - "# Install Holoscan from PyPI only when sdk_type is Holoscan. \n", - "# For MONAI Deploy, the APP SDK will install it unless user specifies the Holoscan SDK file.\n", - "\n", - "# Copy user-specified MONAI Deploy SDK file\n", - "COPY ./monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "\n", - "\n", - "\n", - "\n", - "COPY ./models /opt/holoscan/models\n", - "\n", - "COPY ./map/app.json /etc/holoscan/app.json\n", - "COPY ./app.config /var/holoscan/app.yaml\n", - "COPY ./map/pkg.json /etc/holoscan/pkg.json\n", - "\n", - "COPY ./app /opt/holoscan/app\n", - "\n", - "ENTRYPOINT [\"/var/holoscan/tools\"]\n", - "=========== End Dockerfile ===========\n", - "\n", - "[2024-04-10 16:23:52,003] [INFO] (packager.builder) - \n", - "===============================================================================\n", - "Building image for: x64-workstation\n", - " Architecture: linux/amd64\n", - " Base Image: nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - " Build Image: N/A\n", - " Cache: Enabled\n", - " Configuration: dgpu\n", - " Holoscan SDK Package: pypi.org\n", - " MONAI Deploy App SDK Package: /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - " gRPC Health Probe: N/A\n", - " SDK Version: 1.0.3\n", - " SDK: monai-deploy\n", - " Tag: mednist_app-x64-workstation-dgpu-linux-amd64:1.0\n", - " \n", - "[2024-04-10 16:23:52,265] [INFO] (common) - Using existing Docker BuildKit builder `holoscan_app_builder`\n", - "[2024-04-10 16:23:52,265] [DEBUG] (packager.builder) - Building Holoscan Application Package: tag=mednist_app-x64-workstation-dgpu-linux-amd64:1.0\n", - "#0 building with \"holoscan_app_builder\" instance using docker-container driver\n", - "\n", - "#1 [internal] load build definition from Dockerfile\n", - "#1 transferring dockerfile: 2.81kB done\n", - "#1 DONE 0.1s\n", - "\n", - "#2 [internal] load metadata for nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#2 DONE 0.1s\n", - "\n", - "#3 [internal] load .dockerignore\n", - "#3 transferring context: 1.79kB done\n", - "#3 DONE 0.1s\n", - "\n", - "#4 importing cache manifest from nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#4 ...\n", - "\n", - "#5 [internal] load build context\n", - "#5 DONE 0.0s\n", - "\n", - "#6 importing cache manifest from local:3023656059275295125\n", - "#6 inferred cache manifest type: application/vnd.oci.image.index.v1+json done\n", - "#6 DONE 0.0s\n", - "\n", - "#7 [ 1/21] FROM nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu@sha256:50343c616bf910e2a7651abb59db7833933e82cce64c3c4885f938d7e4af6155\n", - "#7 resolve nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu@sha256:50343c616bf910e2a7651abb59db7833933e82cce64c3c4885f938d7e4af6155 0.1s done\n", - "#7 DONE 0.1s\n", - "\n", - "#4 importing cache manifest from nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#4 inferred cache manifest type: application/vnd.docker.distribution.manifest.list.v2+json done\n", - "#4 DONE 0.7s\n", - "\n", - "#5 [internal] load build context\n", - "#5 transferring context: 28.73MB 0.2s done\n", - "#5 DONE 0.2s\n", - "\n", - "#8 [ 9/21] WORKDIR /var/holoscan\n", - "#8 CACHED\n", - "\n", - "#9 [ 2/21] RUN mkdir -p /etc/holoscan/ && mkdir -p /opt/holoscan/ && mkdir -p /var/holoscan && mkdir -p /opt/holoscan/app && mkdir -p /var/holoscan/input && mkdir -p /var/holoscan/output\n", - "#9 CACHED\n", - "\n", - "#10 [ 5/21] RUN useradd -rm -d /home/holoscan -s /bin/bash -g 1000 -G sudo -u 1000 holoscan\n", - "#10 CACHED\n", - "\n", - "#11 [12/21] COPY ./pip/requirements.txt /tmp/requirements.txt\n", - "#11 CACHED\n", - "\n", - "#12 [ 6/21] RUN chown -R holoscan /var/holoscan\n", - "#12 CACHED\n", - "\n", - "#13 [11/21] RUN chmod +x /var/holoscan/tools\n", - "#13 CACHED\n", - "\n", - "#14 [13/21] RUN pip install --upgrade pip\n", - "#14 CACHED\n", - "\n", - "#15 [10/21] COPY ./tools /var/holoscan/tools\n", - "#15 CACHED\n", - "\n", - "#16 [ 8/21] RUN chown -R holoscan /var/holoscan/output\n", - "#16 CACHED\n", - "\n", - "#17 [ 4/21] RUN groupadd -f -g 1000 holoscan\n", - "#17 CACHED\n", - "\n", - "#18 [ 3/21] RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*\n", - "#18 CACHED\n", - "\n", - "#19 [ 7/21] RUN chown -R holoscan /var/holoscan/input\n", - "#19 CACHED\n", - "\n", - "#20 [14/21] RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", - "#20 CACHED\n", - "\n", - "#21 [15/21] COPY ./monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "#21 DONE 0.3s\n", - "\n", - "#22 [16/21] RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "#22 0.682 Defaulting to user installation because normal site-packages is not writeable\n", - "#22 0.793 Processing /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "#22 0.803 Requirement already satisfied: numpy>=1.21.6 in /usr/local/lib/python3.10/dist-packages (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (1.23.5)\n", - "#22 0.906 Collecting holoscan~=1.0 (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 0.971 Downloading holoscan-1.0.3-cp310-cp310-manylinux_2_35_x86_64.whl.metadata (4.1 kB)\n", - "#22 1.044 Collecting colorama>=0.4.1 (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.050 Downloading colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)\n", - "#22 1.135 Collecting typeguard>=3.0.0 (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.139 Downloading typeguard-4.2.1-py3-none-any.whl.metadata (3.7 kB)\n", - "#22 1.248 Collecting pip==23.3.2 (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.254 Downloading pip-23.3.2-py3-none-any.whl.metadata (3.5 kB)\n", - "#22 1.269 Requirement already satisfied: cupy-cuda12x==12.2 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (12.2.0)\n", - "#22 1.269 Requirement already satisfied: cloudpickle==2.2.1 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2.2.1)\n", - "#22 1.271 Requirement already satisfied: python-on-whales==0.60.1 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (0.60.1)\n", - "#22 1.272 Requirement already satisfied: Jinja2==3.1.2 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.1.2)\n", - "#22 1.272 Requirement already satisfied: packaging==23.1 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (23.1)\n", - "#22 1.273 Requirement already satisfied: pyyaml==6.0 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (6.0)\n", - "#22 1.274 Requirement already satisfied: requests==2.28.2 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2.28.2)\n", - "#22 1.275 Requirement already satisfied: psutil==5.9.6 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (5.9.6)\n", - "#22 1.308 Collecting wheel-axle-runtime<1.0 (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.313 Downloading wheel_axle_runtime-0.0.5-py3-none-any.whl.metadata (7.7 kB)\n", - "#22 1.347 Requirement already satisfied: fastrlock>=0.5 in /usr/local/lib/python3.10/dist-packages (from cupy-cuda12x==12.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (0.8.2)\n", - "#22 1.351 Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from Jinja2==3.1.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2.1.3)\n", - "#22 1.366 Requirement already satisfied: pydantic<2,>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (1.10.14)\n", - "#22 1.367 Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (4.66.1)\n", - "#22 1.367 Requirement already satisfied: typer>=0.4.1 in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (0.9.0)\n", - "#22 1.369 Requirement already satisfied: typing-extensions in /home/holoscan/.local/lib/python3.10/site-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (4.10.0)\n", - "#22 1.380 Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.3.2)\n", - "#22 1.381 Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.6)\n", - "#22 1.382 Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (1.26.18)\n", - "#22 1.383 Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2023.11.17)\n", - "#22 1.401 Requirement already satisfied: filelock in /home/holoscan/.local/lib/python3.10/site-packages (from wheel-axle-runtime<1.0->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.13.3)\n", - "#22 1.443 Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.10/dist-packages (from typer>=0.4.1->python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (8.1.7)\n", - "#22 1.490 Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)\n", - "#22 1.516 Downloading holoscan-1.0.3-cp310-cp310-manylinux_2_35_x86_64.whl (33.6 MB)\n", - "#22 1.982 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 33.6/33.6 MB 43.1 MB/s eta 0:00:00\n", - "#22 1.989 Downloading pip-23.3.2-py3-none-any.whl (2.1 MB)\n", - "#22 2.032 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 53.0 MB/s eta 0:00:00\n", - "#22 2.039 Downloading typeguard-4.2.1-py3-none-any.whl (34 kB)\n", - "#22 2.064 Downloading wheel_axle_runtime-0.0.5-py3-none-any.whl (12 kB)\n", - "#22 2.417 Installing collected packages: wheel-axle-runtime, typeguard, pip, colorama, holoscan, monai-deploy-app-sdk\n", - "#22 2.492 Attempting uninstall: pip\n", - "#22 2.493 Found existing installation: pip 24.0\n", - "#22 2.547 Uninstalling pip-24.0:\n", - "#22 2.977 Successfully uninstalled pip-24.0\n", - "#22 4.656 Successfully installed colorama-0.4.6 holoscan-1.0.3 monai-deploy-app-sdk-0.5.1+25.g31e4165.dirty pip-23.3.2 typeguard-4.2.1 wheel-axle-runtime-0.0.5\n", - "#22 DONE 5.2s\n", - "\n", - "#23 [17/21] COPY ./models /opt/holoscan/models\n", - "#23 DONE 0.2s\n", - "\n", - "#24 [18/21] COPY ./map/app.json /etc/holoscan/app.json\n", - "#24 DONE 0.1s\n", - "\n", - "#25 [19/21] COPY ./app.config /var/holoscan/app.yaml\n", - "#25 DONE 0.1s\n", - "\n", - "#26 [20/21] COPY ./map/pkg.json /etc/holoscan/pkg.json\n", - "#26 DONE 0.1s\n", - "\n", - "#27 [21/21] COPY ./app /opt/holoscan/app\n", - "#27 DONE 0.1s\n", - "\n", - "#28 exporting to docker image format\n", - "#28 exporting layers\n", - "#28 exporting layers 6.0s done\n", - "#28 exporting manifest sha256:02c9015ef90dc072d10044946ce69d29e7dbd7e748cd98b56713e2a32f1823bc 0.0s done\n", - "#28 exporting config sha256:26b7cd41adaba5d7700f104387d1c2d4b66829292de9fe656dff6f30ba20e56d 0.0s done\n", - "#28 sending tarball\n", - "#28 ...\n", - "\n", - "#29 importing to docker\n", - "#29 loading layer 3c784a11874c 32.77kB / 125.57kB\n", - "#29 loading layer 71abc17edeb9 557.06kB / 73.96MB\n", - "#29 loading layer 71abc17edeb9 73.53MB / 73.96MB 2.0s\n", - "#29 loading layer 8eee96e0be35 262.14kB / 25.59MB\n", - "#29 loading layer 81dfa72eaf50 512B / 512B\n", - "#29 loading layer c726a53666d2 697B / 697B\n", - "#29 loading layer 0266dfb048c0 297B / 297B\n", - "#29 loading layer d4a6edcf43fc 4.17kB / 4.17kB\n", - "#29 loading layer 3c784a11874c 32.77kB / 125.57kB 5.0s done\n", - "#29 loading layer 71abc17edeb9 73.53MB / 73.96MB 4.9s done\n", - "#29 loading layer 8eee96e0be35 262.14kB / 25.59MB 2.8s done\n", - "#29 loading layer 81dfa72eaf50 512B / 512B 2.2s done\n", - "#29 loading layer c726a53666d2 697B / 697B 1.9s done\n", - "#29 loading layer 0266dfb048c0 297B / 297B 1.5s done\n", - "#29 loading layer d4a6edcf43fc 4.17kB / 4.17kB 1.1s done\n", - "#29 DONE 5.0s\n", - "\n", - "#28 exporting to docker image format\n", - "#28 sending tarball 65.8s done\n", - "#28 DONE 72.0s\n", - "\n", - "#30 exporting cache to client directory\n", - "#30 preparing build cache for export\n", - "#30 writing layer sha256:00bb4c1319ba1a33ac3edcb3aa1240d8abcb8d0383c6267ed8028d3b6228a8a4\n", - "#30 writing layer sha256:00bb4c1319ba1a33ac3edcb3aa1240d8abcb8d0383c6267ed8028d3b6228a8a4 done\n", - "#30 writing layer sha256:014cff740c9ec6e9a30d0b859219a700ae880eb385d62095d348f5ea136d6015 done\n", - "#30 writing layer sha256:03a29f2f0e10f79ee63a9017483d2f5c668ef6c02e479f306e7ec76203d450a9 0.0s done\n", - "#30 writing layer sha256:0a1756432df4a4350712d8ae5c003f1526bd2180800b3ae6301cfc9ccf370254 done\n", - "#30 writing layer sha256:0a77dcbd0e648ddc4f8e5230ade8fdb781d99e24fa4f13ca96a360c7f7e6751f done\n", - "#30 writing layer sha256:0ec682bf99715a9f88631226f3749e2271b8b9f254528ef61f65ed829984821c done\n", - "#30 writing layer sha256:1133dfcee0e851b490d17b3567f50c4b25ba5750da02ba4b3f3630655d0b1a7b done\n", - "#30 writing layer sha256:1294b2835667d633f938174d9fecb18a60bbbebb6fb49788a1f939893a25d1af done\n", - "#30 writing layer sha256:16a03c6e0373b62f9713416da0229bb7ce2585183141081d3ea8427ad2e84408 done\n", - "#30 writing layer sha256:20d331454f5fb557f2692dfbdbe092c718fd2cb55d5db9d661b62228dacca5c2 done\n", - "#30 writing layer sha256:2232aeb26b5b7ea57227e9a5b84da4fb229624d7bc976a5f7ce86d9c8653d277 done\n", - "#30 writing layer sha256:238f69a43816e481f0295995fcf5fe74d59facf0f9f99734c8d0a2fb140630e0 done\n", - "#30 writing layer sha256:2ad84487f9d4d31cd1e0a92697a5447dd241935253d036b272ef16d31620c1e7 done\n", - "#30 writing layer sha256:2bb73464628bd4a136c4937f42d522c847bea86b2215ae734949e24c1caf450e done\n", - "#30 writing layer sha256:3e3e04011ebdba380ab129f0ee390626cb2a600623815ca756340c18bedb9517 done\n", - "#30 writing layer sha256:3f26964a76655c86158d285c57a280ad1e8f9c246a879db10773dc0218685fbc\n", - "#30 writing layer sha256:3f26964a76655c86158d285c57a280ad1e8f9c246a879db10773dc0218685fbc 0.5s done\n", - "#30 writing layer sha256:42619ce4a0c9e54cfd0ee41a8e5f27d58b3f51becabd1ac6de725fbe6c42b14a\n", - "#30 writing layer sha256:42619ce4a0c9e54cfd0ee41a8e5f27d58b3f51becabd1ac6de725fbe6c42b14a done\n", - "#30 writing layer sha256:43a21fb6c76bd2b3715cc09d9f8c3865dc61c51dd9e2327b429f5bec8fff85d1 done\n", - "#30 writing layer sha256:49bdc9abf8a437ccff67cc11490ba52c976577992909856a86be872a34d3b950 done\n", - "#30 writing layer sha256:4b691ba9f48b41eaa0c754feba8366f1c030464fcbc55eeffa6c86675990933a done\n", - "#30 writing layer sha256:4d04a8db404f16c2704fa10739cb6745a0187713a21a6ef0deb34b48629b54c1 done\n", - "#30 writing layer sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 done\n", - "#30 writing layer sha256:5275a41be8f6691a490c0a15589e0910c73bf971169ad33a850ef570d37f63dd done\n", - "#30 writing layer sha256:52fbfeaf78318d843054ce2bfb5bfc9f71278939a815f6035ab5b14573ad017b done\n", - "#30 writing layer sha256:5792b18b6f162bae61ff5840cdb9e8567e6847a56ac886f940b47e7271c529a7 done\n", - "#30 writing layer sha256:57f244836ad318f9bbb3b29856ae1a5b31038bfbb9b43d2466d51c199eb55041 done\n", - "#30 writing layer sha256:5b5b131e0f20db4cb8e568b623a95f8fc16ed1c6b322a9366df70b59a881f24f done\n", - "#30 writing layer sha256:5ccb787d371fd3697122101438ddd0f55b537832e9756d2c51ab1d8158710ac5 done\n", - "#30 writing layer sha256:62452179df7c18e292f141d4aec29e6aba9ff8270c893731169fc6f41dc07631 done\n", - "#30 writing layer sha256:6630c387f5f2115bca2e646fd0c2f64e1f3d5431c2e050abe607633883eda230 done\n", - "#30 writing layer sha256:69af4b756272a77f683a8d118fd5ca55c03ad5f1bacc673b463f54d16b833da5 done\n", - "#30 writing layer sha256:6ae1f1fb92c0cb2b6e219f687b08c8e511501a7af696c943ca20d119eba7cd02 done\n", - "#30 writing layer sha256:6deb3d550b15a5e099c0b3d0cbc242e351722ca16c058d3a6c28ba1a02824d0f done\n", - "#30 writing layer sha256:7386814d57100e2c7389fbf4e16f140f5c549d31434c62c3884a85a3ee5cd2a7 done\n", - "#30 writing layer sha256:76e786eeb0fbc65fd083d100043e47d0c35ba615444907aa299e635d624bd426 0.0s done\n", - "#30 writing layer sha256:77e0d1bb7a2b6458b8bd911429c58386169319dfb6ae2e9ae05f57571522d815 0.0s done\n", - "#30 writing layer sha256:7852b73ea931e3a8d3287ee7ef3cf4bad068e44f046583bfc2b81336fb299284 done\n", - "#30 writing layer sha256:7e73869c74822e4539e104a3d2aff853f4622cd0bb873576db1db53c9e91f621 done\n", - "#30 writing layer sha256:7eae142b38745fe88962874372374deb672998600264a17e638c010b79e6b535 done\n", - "#30 writing layer sha256:7f2e5ab2c599fa36698918d3e73c991d8616fff9037077cd230529e7cd1c5e0e done\n", - "#30 writing layer sha256:82a3436133b2b17bb407c7fe488932aa0ca55411f23ab55c34a6134b287c6a27 done\n", - "#30 writing layer sha256:82b1d37999127ab8412181eae2a5ff1c1a1854f9a76064512942ba9bde82afaa done\n", - "#30 writing layer sha256:90eae6faa5cc5ba62f12c25915cdfb1a7a51abfba0d05cb5818c3f908f4e345f done\n", - "#30 writing layer sha256:9ac855545fa90ed2bf3b388fdff9ef06ac9427b0c0fca07c9e59161983d8827e done\n", - "#30 writing layer sha256:9d19ee268e0d7bcf6716e6658ee1b0384a71d6f2f9aa1ae2085610cf7c7b316f done\n", - "#30 writing layer sha256:a10c8d7d2714eabf661d1f43a1ccb87a51748cbb9094d5bc0b713e2481b5d329 done\n", - "#30 writing layer sha256:a1748eee9d376f97bd19225ba61dfada9986f063f4fc429e435f157abb629fc6 done\n", - "#30 writing layer sha256:a68f4e0ec09ec3b78cb4cf8e4511d658e34e7b6f676d7806ad9703194ff17604 done\n", - "#30 writing layer sha256:a8e4decc8f7289623b8fd7b9ba1ca555b5a755ebdbf81328d68209f148d9e602\n", - "#30 writing layer sha256:a8e4decc8f7289623b8fd7b9ba1ca555b5a755ebdbf81328d68209f148d9e602 done\n", - "#30 writing layer sha256:afde1c269453ce68a0f2b54c1ba8c5ecddeb18a19e5618a4acdef1f0fe3921af done\n", - "#30 writing layer sha256:b48a5fafcaba74eb5d7e7665601509e2889285b50a04b5b639a23f8adc818157 done\n", - "#30 writing layer sha256:ba9f7c75e4dd7942b944679995365aab766d3677da2e69e1d74472f471a484dd done\n", - "#30 writing layer sha256:bafd0706f1969063f2baea22f5df92629ba228c67819e957f88b20582aaa4801\n", - "#30 writing layer sha256:bafd0706f1969063f2baea22f5df92629ba228c67819e957f88b20582aaa4801 1.5s done\n", - "#30 writing layer sha256:bdfc73b2a0fa11b4086677e117a2f9feb6b4ffeccb23a3d58a30543339607e31\n", - "#30 writing layer sha256:bdfc73b2a0fa11b4086677e117a2f9feb6b4ffeccb23a3d58a30543339607e31 done\n", - "#30 writing layer sha256:c175bb235295e50de2961fa1e1a2235c57e6eba723a914287dfc26d3be0eac11 done\n", - "#30 writing layer sha256:c2a80b194dd0ff43e8e6ea838efe3b6f24371797b498b6d2d7ac53fb9d4aee8b done\n", - "#30 writing layer sha256:c6e0f549352b7817454c6c4540b863766f732e9216158288017cfcb19cd91bef 0.0s done\n", - "#30 writing layer sha256:c98533d2908f36a5e9b52faae83809b3b6865b50e90e2817308acfc64cd3655f done\n", - "#30 writing layer sha256:cb6c95b33bc30dd285c5b3cf99a05281b8f12decae1c932ab64bd58f56354021 done\n", - "#30 writing layer sha256:d7da5c5e9a40c476c4b3188a845e3276dedfd752e015ea5113df5af64d4d43f7 done\n", - "#30 writing layer sha256:e4aedc686433c0ec5e676e6cc54a164345f7016aa0eb714f00c07e11664a1168 done\n", - "#30 writing layer sha256:e4e14fa6c90d19eb19aad3f52f9cd59a25c44007ba201741ac7cbff722837883 done\n", - "#30 writing layer sha256:e8acb678f16bc0c369d5cf9c184f2d3a1c773986816526e5e3e9c0354f7e757f done\n", - "#30 writing layer sha256:e9225f7ab6606813ec9acba98a064826ebfd6713a9645a58cd068538af1ecddb done\n", - "#30 writing layer sha256:f33546e75bf1a7d9dc9e21b9a2c54c9d09b24790ad7a4192a8509002ceb14688 done\n", - "#30 writing layer sha256:f608e2fbff86e98627b7e462057e7d2416522096d73fe4664b82fe6ce8a4047d done\n", - "#30 writing layer sha256:f7702077ced42a1ee35e7f5e45f72634328ff3bcfe3f57735ba80baa5ec45daf done\n", - "#30 writing layer sha256:fa66a49172c6e821a1bace57c007c01da10cbc61507c44f8cdfeed8c4e5febab done\n", - "#30 writing layer sha256:fc1f60b32aa696c9cfeacbee0e2c0aeefd8331e0a38fcd082b60ae33b67e34e4 0.0s done\n", - "#30 writing config sha256:b2150835373b386791df4e482a3f33750ce9ec1d81393ee061a6d9c06dc8d52a 0.0s done\n", - "#30 preparing build cache for export 2.8s done\n", - "#30 writing cache manifest sha256:ed8fc8e6d14dafb96aed8205ce985667c75f419d2bf7ce449e533b415b01b699 0.0s done\n", - "#30 DONE 2.8s\n", - "[2024-04-10 16:25:16,137] [INFO] (packager) - Build Summary:\n", - "\n", - "Platform: x64-workstation/dgpu\n", - " Status: Succeeded\n", - " Docker Tag: mednist_app-x64-workstation-dgpu-linux-amd64:1.0\n", - " Tarball: None\n" - ] - } - ], - "source": [ - "tag_prefix = \"mednist_app\"\n", - "\n", - "!monai-deploy package \"source/examples/apps/mednist_classifier_monaideploy/mednist_classifier_monaideploy.py\" -m {models_folder} -c \"source/examples/apps/mednist_classifier_monaideploy/app.yaml\" -t {tag_prefix}:1.0 --platform x64-workstation -l DEBUG" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We can see that the MAP Docker image is created" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "mednist_app-x64-workstation-dgpu-linux-amd64 1.0 26b7cd41adab About a minute ago 17.5GB\n" - ] - } - ], - "source": [ - "!docker image ls | grep {tag_prefix}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We can choose to display and inspect the MAP manifests by running the container with the `show` command.\n", - "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).\n", - "\n", - ":::{note}\n", - "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.\n", - ":::" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Display manifests and extract MAP contents to the host folder, ./export\n", - "\n", - "============================== app.json ==============================\n", - "{\n", - " \"apiVersion\": \"1.0.0\",\n", - " \"command\": \"[\\\"python3\\\", \\\"/opt/holoscan/app/mednist_classifier_monaideploy.py\\\"]\",\n", - " \"environment\": {\n", - " \"HOLOSCAN_APPLICATION\": \"/opt/holoscan/app\",\n", - " \"HOLOSCAN_INPUT_PATH\": \"input/\",\n", - " \"HOLOSCAN_OUTPUT_PATH\": \"output/\",\n", - " \"HOLOSCAN_WORKDIR\": \"/var/holoscan\",\n", - " \"HOLOSCAN_MODEL_PATH\": \"/opt/holoscan/models\",\n", - " \"HOLOSCAN_CONFIG_PATH\": \"/var/holoscan/app.yaml\",\n", - " \"HOLOSCAN_APP_MANIFEST_PATH\": \"/etc/holoscan/app.json\",\n", - " \"HOLOSCAN_PKG_MANIFEST_PATH\": \"/etc/holoscan/pkg.json\",\n", - " \"HOLOSCAN_DOCS_PATH\": \"/opt/holoscan/docs\",\n", - " \"HOLOSCAN_LOGS_PATH\": \"/var/holoscan/logs\"\n", - " },\n", - " \"input\": {\n", - " \"path\": \"input/\",\n", - " \"formats\": null\n", - " },\n", - " \"liveness\": null,\n", - " \"output\": {\n", - " \"path\": \"output/\",\n", - " \"formats\": null\n", - " },\n", - " \"readiness\": null,\n", - " \"sdk\": \"monai-deploy\",\n", - " \"sdkVersion\": \"0.5.1\",\n", - " \"timeout\": 0,\n", - " \"version\": 1,\n", - " \"workingDirectory\": \"/var/holoscan\"\n", - "}\n", - "\n", - "============================== pkg.json ==============================\n", - "{\n", - " \"apiVersion\": \"1.0.0\",\n", - " \"applicationRoot\": \"/opt/holoscan/app\",\n", - " \"modelRoot\": \"/opt/holoscan/models\",\n", - " \"models\": {\n", - " \"model\": \"/opt/holoscan/models/model\"\n", - " },\n", - " \"resources\": {\n", - " \"cpu\": 1,\n", - " \"gpu\": 1,\n", - " \"memory\": \"1Gi\",\n", - " \"gpuMemory\": \"1Gi\"\n", - " },\n", - " \"version\": 1,\n", - " \"platformConfig\": \"dgpu\"\n", - "}\n", - "\n", - "2024-04-10 23:25:19 [INFO] Copying application from /opt/holoscan/app to /var/run/holoscan/export/app\n", - "\n", - "2024-04-10 23:25:19 [INFO] Copying application manifest file from /etc/holoscan/app.json to /var/run/holoscan/export/config/app.json\n", - "2024-04-10 23:25:19 [INFO] Copying pkg manifest file from /etc/holoscan/pkg.json to /var/run/holoscan/export/config/pkg.json\n", - "2024-04-10 23:25:19 [INFO] Copying application configuration from /var/holoscan/app.yaml to /var/run/holoscan/export/config/app.yaml\n", - "\n", - "2024-04-10 23:25:19 [INFO] Copying models from /opt/holoscan/models to /var/run/holoscan/export/models\n", - "\n", - "2024-04-10 23:25:19 [INFO] Copying documentation from /opt/holoscan/docs/ to /var/run/holoscan/export/docs\n", - "2024-04-10 23:25:19 [INFO] '/opt/holoscan/docs/' cannot be found.\n", - "\n", - "app config models\n" - ] - } - ], - "source": [ - "!echo \"Display manifests and extract MAP contents to the host folder, ./export\"\n", - "!docker run --rm {tag_prefix}-x64-workstation-dgpu-linux-amd64:1.0 show\n", - "!rm -rf `pwd`/export && mkdir -p `pwd`/export\n", - "!docker run --rm -v `pwd`/export/:/var/run/holoscan/export/ {tag_prefix}-x64-workstation-dgpu-linux-amd64:1.0 extract\n", - "!ls `pwd`/export" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Executing packaged app locally\n", - "\n", - "The packaged app can be run locally through [MONAI Application Runner](/developing_with_sdk/executing_packaged_app_locally)." - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2024-04-10 16:25:20,790] [INFO] (runner) - Checking dependencies...\n", - "[2024-04-10 16:25:20,790] [INFO] (runner) - --> Verifying if \"docker\" is installed...\n", - "\n", - "[2024-04-10 16:25:20,791] [INFO] (runner) - --> Verifying if \"docker-buildx\" is installed...\n", - "\n", - "[2024-04-10 16:25:20,791] [INFO] (runner) - --> Verifying if \"mednist_app-x64-workstation-dgpu-linux-amd64:1.0\" is available...\n", - "\n", - "[2024-04-10 16:25:20,871] [INFO] (runner) - Reading HAP/MAP manifest...\n", - "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.56kB to /tmp/tmpryp430i1/app.json\n", - "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.05kB to /tmp/tmpryp430i1/pkg.json\n", - "[2024-04-10 16:25:21,124] [INFO] (runner) - --> Verifying if \"nvidia-ctk\" is installed...\n", - "\n", - "[2024-04-10 16:25:21,124] [INFO] (runner) - --> Verifying \"nvidia-ctk\" version...\n", - "\n", - "[2024-04-10 16:25:21,410] [INFO] (common) - Launching container (7cf522bd06c4) using image 'mednist_app-x64-workstation-dgpu-linux-amd64:1.0'...\n", - " container name: dazzling_hugle\n", - " host name: mingq-dt\n", - " network: host\n", - " user: 1000:1000\n", - " ulimits: memlock=-1:-1, stack=67108864:67108864\n", - " cap_add: CAP_SYS_PTRACE\n", - " ipc mode: host\n", - " shared memory size: 67108864\n", - " devices: \n", - " group_add: 44\n", - "2024-04-10 23:25:22 [INFO] Launching application python3 /opt/holoscan/app/mednist_classifier_monaideploy.py ...\n", - "\n", - "[2024-04-10 23:25:31,408] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['/opt/holoscan/app/mednist_classifier_monaideploy.py'])\n", - "\n", - "[2024-04-10 23:25:31,419] [INFO] (root) - AppContext object: AppContext(input_path=/var/holoscan/input, output_path=/var/holoscan/output, model_path=/opt/holoscan/models, workdir=/var/holoscan)\n", - "\n", - "[info] [app_driver.cpp:1161] Launching the driver/health checking service\n", - "\n", - "[info] [gxf_executor.cpp:211] Creating context\n", - "\n", - "[info] [server.cpp:87] Health checking server listening on 0.0.0.0:8777\n", - "\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", - "\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", - "\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", - "\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "\n", - "[info] [greedy_scheduler.cpp:190] Scheduling 3 entities\n", - "\n", - "/home/holoscan/.local/lib/python3.10/site-packages/monai/data/meta_tensor.py:116: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)\n", - "\n", - " return torch.as_tensor(x, *args, **_kwargs).as_subclass(cls)\n", - "\n", - "[2024-04-10 23:25:34,063] [INFO] (root) - Finished writing DICOM instance to file /var/holoscan/output/1.2.826.0.1.3680043.8.498.23303108191806495091599558367348667557.dcm\n", - "\n", - "[2024-04-10 23:25:34,064] [INFO] (monai.deploy.operators.dicom_text_sr_writer_operator.DICOMTextSRWriterOperator) - DICOM SOP instance saved in /var/holoscan/output/1.2.826.0.1.3680043.8.498.23303108191806495091599558367348667557.dcm\n", - "\n", - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "\n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "\n", - "[info] [gxf_executor.cpp:230] Destroying context\n", - "\n", - "AbdomenCT\n", - "\n", - "[2024-04-10 16:25:35,771] [INFO] (common) - Container 'dazzling_hugle'(7cf522bd06c4) exited.\n" - ] - } - ], - "source": [ - "# Clear the output folder and run the MAP. The input is expected to be a folder.\n", - "!rm -rf {ouput_folder}\n", - "!monai-deploy run -i $HOLOSCAN_INPUT_PATH -o $HOLOSCAN_OUTPUT_PATH mednist_app-x64-workstation-dgpu-linux-amd64:1.0" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\"AbdomenCT\"" - ] - } - ], - "source": [ - "!cat {output_folder}/output.json" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Implementing and Packaging Application with MONAI Deploy App SDK\n", - "\n", - "In the following sections we will discuss the details of buildng the application that was packaged and run above.\n", - "\n", - "Based on the Torchscript model(`classifier.zip`), we will implement an application that process an input Jpeg image and write the prediction(classification) result as JSON file(`output.json`).\n", - "\n", - "In our inference application, we will define two operators:\n", - "\n", - "1. `LoadPILOperator` - Load a JPEG image from the input path and pass the loaded image object to the next operator.\n", - " - **Input**: a file path (`Path`)\n", - " - **Output**: an image object in memory ([`Image`](/modules/_autosummary/monai.deploy.core.domain.Image))\n", - "2. `MedNISTClassifierOperator` - Pre-transform the given image by using MONAI's `Compose` class, feed to the Torchscript model (`classifier.zip`), and write the prediction into JSON file(`output.json`)\n", - " - Pre-transforms consist of three transforms -- `EnsureChannelFirst`, `ScaleIntensity`, and `EnsureType`.\n", - " - **Input**: an image object in memory ([`Image`](/modules/_autosummary/monai.deploy.core.domain.Image))\n", - " - **Output**: a folder path that the prediction result(`output.json`) would be written (`Path`)\n", - "\n", - "The workflow of the application would look like this.\n", - "\n", - "\"Workflow\"\n" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Setup imports\n", - "\n", - "Let's import necessary classes/decorators and define `MEDNIST_CLASSES`." - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": {}, - "outputs": [], - "source": [ - "import logging\n", - "import os\n", - "from pathlib import Path\n", - "from typing import Optional\n", - "\n", - "import torch\n", - "\n", - "from monai.deploy.conditions import CountCondition\n", - "from monai.deploy.core import AppContext, Application, ConditionType, Fragment, Image, Operator, OperatorSpec\n", - "from monai.deploy.operators.dicom_text_sr_writer_operator import DICOMTextSRWriterOperator, EquipmentInfo, ModelInfo\n", - "from monai.transforms import EnsureChannelFirst, Compose, EnsureType, ScaleIntensity\n", - "\n", - "MEDNIST_CLASSES = [\"AbdomenCT\", \"BreastMRI\", \"CXR\", \"ChestCT\", \"Hand\", \"HeadCT\"]" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Creating Operator classes\n", - "\n", - "#### LoadPILOperator" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": {}, - "outputs": [], - "source": [ - "class LoadPILOperator(Operator):\n", - " \"\"\"Load image from the given input (DataPath) and set numpy array to the output (Image).\"\"\"\n", - "\n", - " DEFAULT_INPUT_FOLDER = Path.cwd() / \"input\"\n", - " DEFAULT_OUTPUT_NAME = \"image\"\n", - "\n", - " # For now, need to have the input folder as an instance attribute, set on init.\n", - " # If dynamically changing the input folder, per compute, then use a (optional) input port to convey the\n", - " # value of the input folder, which is then emitted by a upstream operator.\n", - " def __init__(\n", - " self,\n", - " fragment: Fragment,\n", - " *args,\n", - " input_folder: Path = DEFAULT_INPUT_FOLDER,\n", - " output_name: str = DEFAULT_OUTPUT_NAME,\n", - " **kwargs,\n", - " ):\n", - " \"\"\"Creates an loader object with the input folder and the output port name overrides as needed.\n", - "\n", - " Args:\n", - " fragment (Fragment): An instance of the Application class which is derived from Fragment.\n", - " input_folder (Path): Folder from which to load input file(s).\n", - " Defaults to `input` in the current working directory.\n", - " output_name (str): Name of the output port, which is an image object. Defaults to `image`.\n", - " \"\"\"\n", - "\n", - " self._logger = logging.getLogger(\"{}.{}\".format(__name__, type(self).__name__))\n", - " self.input_path = input_folder\n", - " self.index = 0\n", - " self.output_name_image = (\n", - " output_name.strip() if output_name and len(output_name.strip()) > 0 else LoadPILOperator.DEFAULT_OUTPUT_NAME\n", - " )\n", - "\n", - " super().__init__(fragment, *args, **kwargs)\n", - "\n", - " def setup(self, spec: OperatorSpec):\n", - " \"\"\"Set up the named input and output port(s)\"\"\"\n", - " spec.output(self.output_name_image)\n", - "\n", - " def compute(self, op_input, op_output, context):\n", - " import numpy as np\n", - " from PIL import Image as PILImage\n", - "\n", - " # Input path is stored in the object attribute, but could change to use a named port if need be.\n", - " input_path = self.input_path\n", - " if input_path.is_dir():\n", - " input_path = next(self.input_path.glob(\"*.*\")) # take the first file\n", - "\n", - " image = PILImage.open(input_path)\n", - " image = image.convert(\"L\") # convert to greyscale image\n", - " image_arr = np.asarray(image)\n", - "\n", - " output_image = Image(image_arr) # create Image domain object with a numpy array\n", - " op_output.emit(output_image, self.output_name_image) # cannot omit the name even if single output.\n", - "\n" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### MedNISTClassifierOperator" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": {}, - "outputs": [], - "source": [ - "class MedNISTClassifierOperator(Operator):\n", - " \"\"\"Classifies the given image and returns the class name.\n", - "\n", - " Named inputs:\n", - " image: Image object for which to generate the classification.\n", - " output_folder: Optional, the path to save the results JSON file, overridingthe the one set on __init__\n", - "\n", - " Named output:\n", - " result_text: The classification results in text.\n", - " \"\"\"\n", - "\n", - " DEFAULT_OUTPUT_FOLDER = Path.cwd() / \"classification_results\"\n", - " # For testing the app directly, the model should be at the following path.\n", - " MODEL_LOCAL_PATH = Path(os.environ.get(\"HOLOSCAN_MODEL_PATH\", Path.cwd() / \"model/model.ts\"))\n", - "\n", - " def __init__(\n", - " self,\n", - " frament: Fragment,\n", - " *args,\n", - " app_context: AppContext,\n", - " model_name: Optional[str] = \"\",\n", - " model_path: Path = MODEL_LOCAL_PATH,\n", - " output_folder: Path = DEFAULT_OUTPUT_FOLDER,\n", - " **kwargs,\n", - " ):\n", - " \"\"\"Creates an instance with the reference back to the containing application/fragment.\n", - "\n", - " fragment (Fragment): An instance of the Application class which is derived from Fragment.\n", - " model_name (str, optional): Name of the model. Default to \"\" for single model app.\n", - " model_path (Path): Path to the model file. Defaults to model/models.ts of current working dir.\n", - " output_folder (Path, optional): output folder for saving the classification results JSON file.\n", - " \"\"\"\n", - "\n", - " # the names used for the model inference input and output\n", - " self._input_dataset_key = \"image\"\n", - " self._pred_dataset_key = \"pred\"\n", - "\n", - " # The names used for the operator input and output\n", - " self.input_name_image = \"image\"\n", - " self.output_name_result = \"result_text\"\n", - "\n", - " # The name of the optional input port for passing data to override the output folder path.\n", - " self.input_name_output_folder = \"output_folder\"\n", - "\n", - " # The output folder set on the object can be overriden at each compute by data in the optional named input\n", - " self.output_folder = output_folder\n", - "\n", - " # Need the name when there are multiple models loaded\n", - " self._model_name = model_name.strip() if isinstance(model_name, str) else \"\"\n", - " # Need the path to load the models when they are not loaded in the execution context\n", - " self.model_path = model_path\n", - " self.app_context = app_context\n", - " self.model = self._get_model(self.app_context, self.model_path, self._model_name)\n", - "\n", - " # This needs to be at the end of the constructor.\n", - " super().__init__(frament, *args, **kwargs)\n", - "\n", - " def _get_model(self, app_context: AppContext, model_path: Path, model_name: str):\n", - " \"\"\"Load the model with the given name from context or model path\n", - "\n", - " Args:\n", - " app_context (AppContext): The application context object holding the model(s)\n", - " model_path (Path): The path to the model file, as a backup to load model directly\n", - " model_name (str): The name of the model, when multiples are loaded in the context\n", - " \"\"\"\n", - "\n", - " if app_context.models:\n", - " # `app_context.models.get(model_name)` returns a model instance if exists.\n", - " # If model_name is not specified and only one model exists, it returns that model.\n", - " model = app_context.models.get(model_name)\n", - " else:\n", - " model = torch.jit.load(\n", - " MedNISTClassifierOperator.MODEL_LOCAL_PATH,\n", - " map_location=torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\"),\n", - " )\n", - "\n", - " return model\n", - "\n", - " def setup(self, spec: OperatorSpec):\n", - " \"\"\"Set up the operator named input and named output, both are in-memory objects.\"\"\"\n", - "\n", - " spec.input(self.input_name_image)\n", - " spec.input(self.input_name_output_folder).condition(ConditionType.NONE) # Optional for overriding.\n", - " spec.output(self.output_name_result).condition(ConditionType.NONE) # Not forcing a downstream receiver.\n", - "\n", - " @property\n", - " def transform(self):\n", - " return Compose([EnsureChannelFirst(channel_dim=\"no_channel\"), ScaleIntensity(), EnsureType()])\n", - "\n", - " def compute(self, op_input, op_output, context):\n", - " import json\n", - "\n", - " import torch\n", - "\n", - " img = op_input.receive(self.input_name_image).asnumpy() # (64, 64), uint8. Input validation can be added.\n", - " image_tensor = self.transform(img) # (1, 64, 64), torch.float64\n", - " image_tensor = image_tensor[None].float() # (1, 1, 64, 64), torch.float32\n", - "\n", - " device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n", - " image_tensor = image_tensor.to(device)\n", - "\n", - " with torch.no_grad():\n", - " outputs = self.model(image_tensor)\n", - "\n", - " _, output_classes = outputs.max(dim=1)\n", - "\n", - " result = MEDNIST_CLASSES[output_classes[0]] # get the class name\n", - " print(result)\n", - " op_output.emit(result, self.output_name_result)\n", - "\n", - " # Get output folder, with value in optional input port overriding the obj attribute\n", - " output_folder_on_compute = op_input.receive(self.input_name_output_folder) or self.output_folder\n", - " Path.mkdir(output_folder_on_compute, parents=True, exist_ok=True) # Let exception bubble up if raised.\n", - " output_path = output_folder_on_compute / \"output.json\"\n", - " with open(output_path, \"w\") as fp:\n", - " json.dump(result, fp)\n", - "\n" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Creating Application class\n", - "\n", - "Our application class would look like below.\n", - "\n", - "It defines `App` class inheriting `Application` class.\n", - "\n", - "`LoadPILOperator` is connected to `MedNISTClassifierOperator` by using `self.add_flow()` in `compose()` method of `App`." - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": {}, - "outputs": [], - "source": [ - "class App(Application):\n", - " \"\"\"Application class for the MedNIST classifier.\"\"\"\n", - "\n", - " def compose(self):\n", - " app_context = Application.init_app_context({}) # Do not pass argv in Jupyter Notebook\n", - " app_input_path = Path(app_context.input_path)\n", - " app_output_path = Path(app_context.output_path)\n", - " model_path = Path(app_context.model_path)\n", - " load_pil_op = LoadPILOperator(self, CountCondition(self, 1), input_folder=app_input_path, name=\"pil_loader_op\")\n", - " classifier_op = MedNISTClassifierOperator(\n", - " self, app_context=app_context, output_folder=app_output_path, model_path=model_path, name=\"classifier_op\"\n", - " )\n", - "\n", - " my_model_info = ModelInfo(\"MONAI WG Trainer\", \"MEDNIST Classifier\", \"0.1\", \"xyz\")\n", - " my_equipment = EquipmentInfo(manufacturer=\"MOANI Deploy App SDK\", manufacturer_model=\"DICOM SR Writer\")\n", - " my_special_tags = {\"SeriesDescription\": \"Not for clinical use. The result is for research use only.\"}\n", - " dicom_sr_operator = DICOMTextSRWriterOperator(\n", - " self,\n", - " copy_tags=False,\n", - " model_info=my_model_info,\n", - " equipment_info=my_equipment,\n", - " custom_tags=my_special_tags,\n", - " output_folder=app_output_path,\n", - " )\n", - "\n", - " self.add_flow(load_pil_op, classifier_op, {(\"image\", \"image\")})\n", - " self.add_flow(classifier_op, dicom_sr_operator, {(\"result_text\", \"text\")})\n" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Executing app locally" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We can execute the app in the Jupyter notebook. Before doing so, we also need to clean the output folder which was created by running the packaged containerizd app in the previous cell." - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[2024-04-10 16:25:39,884] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=[])\n", - "[2024-04-10 16:25:39,898] [INFO] (root) - AppContext object: AppContext(input_path=input, output_path=output, model_path=models, workdir=)\n", - "[info] [gxf_executor.cpp:211] Creating context\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[info] [greedy_scheduler.cpp:190] Scheduling 3 entities\n", - "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/monai/data/meta_tensor.py:116: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)\n", - " return torch.as_tensor(x, *args, **_kwargs).as_subclass(cls)\n", - "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/pydicom/valuerep.py:443: UserWarning: Invalid value for VR UI: 'xyz'. Please see for allowed values for each VR.\n", - " warnings.warn(msg)\n", - "[2024-04-10 16:25:42,470] [INFO] (root) - Finished writing DICOM instance to file output/1.2.826.0.1.3680043.8.498.71636533308287156684391922232397043508.dcm\n", - "[2024-04-10 16:25:42,472] [INFO] (monai.deploy.operators.dicom_text_sr_writer_operator.DICOMTextSRWriterOperator) - DICOM SOP instance saved in output/1.2.826.0.1.3680043.8.498.71636533308287156684391922232397043508.dcm\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "AbdomenCT\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[info] [gxf_executor.cpp:230] Destroying context\n" - ] - } - ], - "source": [ - "!rm -rf $HOLOSCAN_OUTPUT_PATH\n", - "app = App().run()" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\"AbdomenCT\"" - ] - } - ], - "source": [ - "!cat $HOLOSCAN_OUTPUT_PATH/output.json" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "tags": [] - }, - "source": [ - "Once the application is verified inside Jupyter notebook, we can write the whole application as a file(`mednist_classifier_monaideploy.py`) by concatenating code above, then add the following lines:\n", - "\n", - "```python\n", - "if __name__ == \"__main__\":\n", - " App().run()\n", - "```\n", - "\n", - "The above lines are needed to execute the application code by using `python` interpreter." - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": {}, - "outputs": [], - "source": [ - "# Create an application folder\n", - "!mkdir -p mednist_app && rm -rf mednist_app/*" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing mednist_app/mednist_classifier_monaideploy.py\n" - ] - } - ], - "source": [ - "%%writefile mednist_app/mednist_classifier_monaideploy.py\n", - "\n", - "# Copyright 2021-2023 MONAI Consortium\n", - "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", - "# you may not use this file except in compliance with the License.\n", - "# You may obtain a copy of the License at\n", - "# http://www.apache.org/licenses/LICENSE-2.0\n", - "# Unless required by applicable law or agreed to in writing, software\n", - "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", - "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", - "# See the License for the specific language governing permissions and\n", - "# limitations under the License.\n", - "\n", - "import logging\n", - "import os\n", - "from pathlib import Path\n", - "from typing import Optional\n", - "\n", - "import torch\n", - "\n", - "from monai.deploy.conditions import CountCondition\n", - "from monai.deploy.core import AppContext, Application, ConditionType, Fragment, Image, Operator, OperatorSpec\n", - "from monai.deploy.operators.dicom_text_sr_writer_operator import DICOMTextSRWriterOperator, EquipmentInfo, ModelInfo\n", - "from monai.transforms import EnsureChannelFirst, Compose, EnsureType, ScaleIntensity\n", - "\n", - "MEDNIST_CLASSES = [\"AbdomenCT\", \"BreastMRI\", \"CXR\", \"ChestCT\", \"Hand\", \"HeadCT\"]\n", - "\n", - "\n", - "# @md.env(pip_packages=[\"pillow\"])\n", - "class LoadPILOperator(Operator):\n", - " \"\"\"Load image from the given input (DataPath) and set numpy array to the output (Image).\"\"\"\n", - "\n", - " DEFAULT_INPUT_FOLDER = Path.cwd() / \"input\"\n", - " DEFAULT_OUTPUT_NAME = \"image\"\n", - "\n", - " # For now, need to have the input folder as an instance attribute, set on init.\n", - " # If dynamically changing the input folder, per compute, then use a (optional) input port to convey the\n", - " # value of the input folder, which is then emitted by a upstream operator.\n", - " def __init__(\n", - " self,\n", - " fragment: Fragment,\n", - " *args,\n", - " input_folder: Path = DEFAULT_INPUT_FOLDER,\n", - " output_name: str = DEFAULT_OUTPUT_NAME,\n", - " **kwargs,\n", - " ):\n", - " \"\"\"Creates an loader object with the input folder and the output port name overrides as needed.\n", - "\n", - " Args:\n", - " fragment (Fragment): An instance of the Application class which is derived from Fragment.\n", - " input_folder (Path): Folder from which to load input file(s).\n", - " Defaults to `input` in the current working directory.\n", - " output_name (str): Name of the output port, which is an image object. Defaults to `image`.\n", - " \"\"\"\n", - "\n", - " self._logger = logging.getLogger(\"{}.{}\".format(__name__, type(self).__name__))\n", - " self.input_path = input_folder\n", - " self.index = 0\n", - " self.output_name_image = (\n", - " output_name.strip() if output_name and len(output_name.strip()) > 0 else LoadPILOperator.DEFAULT_OUTPUT_NAME\n", - " )\n", - "\n", - " super().__init__(fragment, *args, **kwargs)\n", - "\n", - " def setup(self, spec: OperatorSpec):\n", - " \"\"\"Set up the named input and output port(s)\"\"\"\n", - " spec.output(self.output_name_image)\n", - "\n", - " def compute(self, op_input, op_output, context):\n", - " import numpy as np\n", - " from PIL import Image as PILImage\n", - "\n", - " # Input path is stored in the object attribute, but could change to use a named port if need be.\n", - " input_path = self.input_path\n", - " if input_path.is_dir():\n", - " input_path = next(self.input_path.glob(\"*.*\")) # take the first file\n", - "\n", - " image = PILImage.open(input_path)\n", - " image = image.convert(\"L\") # convert to greyscale image\n", - " image_arr = np.asarray(image)\n", - "\n", - " output_image = Image(image_arr) # create Image domain object with a numpy array\n", - " op_output.emit(output_image, self.output_name_image) # cannot omit the name even if single output.\n", - "\n", - "\n", - "# @md.env(pip_packages=[\"monai\"])\n", - "class MedNISTClassifierOperator(Operator):\n", - " \"\"\"Classifies the given image and returns the class name.\n", - "\n", - " Named inputs:\n", - " image: Image object for which to generate the classification.\n", - " output_folder: Optional, the path to save the results JSON file, overridingthe the one set on __init__\n", - "\n", - " Named output:\n", - " result_text: The classification results in text.\n", - " \"\"\"\n", - "\n", - " DEFAULT_OUTPUT_FOLDER = Path.cwd() / \"classification_results\"\n", - " # For testing the app directly, the model should be at the following path.\n", - " MODEL_LOCAL_PATH = Path(os.environ.get(\"HOLOSCAN_MODEL_PATH\", Path.cwd() / \"model/model.ts\"))\n", - "\n", - " def __init__(\n", - " self,\n", - " frament: Fragment,\n", - " *args,\n", - " app_context: AppContext,\n", - " model_name: Optional[str] = \"\",\n", - " model_path: Path = MODEL_LOCAL_PATH,\n", - " output_folder: Path = DEFAULT_OUTPUT_FOLDER,\n", - " **kwargs,\n", - " ):\n", - " \"\"\"Creates an instance with the reference back to the containing application/fragment.\n", - "\n", - " fragment (Fragment): An instance of the Application class which is derived from Fragment.\n", - " model_name (str, optional): Name of the model. Default to \"\" for single model app.\n", - " model_path (Path): Path to the model file. Defaults to model/models.ts of current working dir.\n", - " output_folder (Path, optional): output folder for saving the classification results JSON file.\n", - " \"\"\"\n", - "\n", - " # the names used for the model inference input and output\n", - " self._input_dataset_key = \"image\"\n", - " self._pred_dataset_key = \"pred\"\n", - "\n", - " # The names used for the operator input and output\n", - " self.input_name_image = \"image\"\n", - " self.output_name_result = \"result_text\"\n", - "\n", - " # The name of the optional input port for passing data to override the output folder path.\n", - " self.input_name_output_folder = \"output_folder\"\n", - "\n", - " # The output folder set on the object can be overriden at each compute by data in the optional named input\n", - " self.output_folder = output_folder\n", - "\n", - " # Need the name when there are multiple models loaded\n", - " self._model_name = model_name.strip() if isinstance(model_name, str) else \"\"\n", - " # Need the path to load the models when they are not loaded in the execution context\n", - " self.model_path = model_path\n", - " self.app_context = app_context\n", - " self.model = self._get_model(self.app_context, self.model_path, self._model_name)\n", - "\n", - " # This needs to be at the end of the constructor.\n", - " super().__init__(frament, *args, **kwargs)\n", - "\n", - " def _get_model(self, app_context: AppContext, model_path: Path, model_name: str):\n", - " \"\"\"Load the model with the given name from context or model path\n", - "\n", - " Args:\n", - " app_context (AppContext): The application context object holding the model(s)\n", - " model_path (Path): The path to the model file, as a backup to load model directly\n", - " model_name (str): The name of the model, when multiples are loaded in the context\n", - " \"\"\"\n", - "\n", - " if app_context.models:\n", - " # `app_context.models.get(model_name)` returns a model instance if exists.\n", - " # If model_name is not specified and only one model exists, it returns that model.\n", - " model = app_context.models.get(model_name)\n", - " else:\n", - " model = torch.jit.load(\n", - " MedNISTClassifierOperator.MODEL_LOCAL_PATH,\n", - " map_location=torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\"),\n", - " )\n", - "\n", - " return model\n", - "\n", - " def setup(self, spec: OperatorSpec):\n", - " \"\"\"Set up the operator named input and named output, both are in-memory objects.\"\"\"\n", - "\n", - " spec.input(self.input_name_image)\n", - " spec.input(self.input_name_output_folder).condition(ConditionType.NONE) # Optional for overriding.\n", - " spec.output(self.output_name_result).condition(ConditionType.NONE) # Not forcing a downstream receiver.\n", - "\n", - " @property\n", - " def transform(self):\n", - " return Compose([EnsureChannelFirst(channel_dim=\"no_channel\"), ScaleIntensity(), EnsureType()])\n", - "\n", - " def compute(self, op_input, op_output, context):\n", - " import json\n", - "\n", - " import torch\n", - "\n", - " img = op_input.receive(self.input_name_image).asnumpy() # (64, 64), uint8. Input validation can be added.\n", - " image_tensor = self.transform(img) # (1, 64, 64), torch.float64\n", - " image_tensor = image_tensor[None].float() # (1, 1, 64, 64), torch.float32\n", - "\n", - " device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n", - " image_tensor = image_tensor.to(device)\n", - "\n", - " with torch.no_grad():\n", - " outputs = self.model(image_tensor)\n", - "\n", - " _, output_classes = outputs.max(dim=1)\n", - "\n", - " result = MEDNIST_CLASSES[output_classes[0]] # get the class name\n", - " print(result)\n", - " op_output.emit(result, self.output_name_result)\n", - "\n", - " # Get output folder, with value in optional input port overriding the obj attribute\n", - " output_folder_on_compute = op_input.receive(self.input_name_output_folder) or self.output_folder\n", - " Path.mkdir(output_folder_on_compute, parents=True, exist_ok=True) # Let exception bubble up if raised.\n", - " output_path = output_folder_on_compute / \"output.json\"\n", - " with open(output_path, \"w\") as fp:\n", - " json.dump(result, fp)\n", - "\n", - "\n", - "# @md.resource(cpu=1, gpu=1, memory=\"1Gi\")\n", - "class App(Application):\n", - " \"\"\"Application class for the MedNIST classifier.\"\"\"\n", - "\n", - " def compose(self):\n", - " # Use Commandline options over environment variables to init context.\n", - " app_context = Application.init_app_context(self.argv)\n", - " app_input_path = Path(app_context.input_path)\n", - " app_output_path = Path(app_context.output_path)\n", - " model_path = Path(app_context.model_path)\n", - " load_pil_op = LoadPILOperator(self, CountCondition(self, 1), input_folder=app_input_path, name=\"pil_loader_op\")\n", - " classifier_op = MedNISTClassifierOperator(\n", - " self, app_context=app_context, output_folder=app_output_path, model_path=model_path, name=\"classifier_op\"\n", - " )\n", - "\n", - " my_model_info = ModelInfo(\"MONAI WG Trainer\", \"MEDNIST Classifier\", \"0.1\", \"xyz\")\n", - " my_equipment = EquipmentInfo(manufacturer=\"MOANI Deploy App SDK\", manufacturer_model=\"DICOM SR Writer\")\n", - " my_special_tags = {\"SeriesDescription\": \"Not for clinical use. The result is for research use only.\"}\n", - " dicom_sr_operator = DICOMTextSRWriterOperator(\n", - " self,\n", - " copy_tags=False,\n", - " model_info=my_model_info,\n", - " equipment_info=my_equipment,\n", - " custom_tags=my_special_tags,\n", - " output_folder=app_output_path,\n", - " )\n", - "\n", - " self.add_flow(load_pil_op, classifier_op, {(\"image\", \"image\")})\n", - " self.add_flow(classifier_op, dicom_sr_operator, {(\"result_text\", \"text\")})\n", - "\n", - "\n", - "if __name__ == \"__main__\":\n", - " App().run()\n" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This time, let's execute the app on the command line.\n", - "\n", - ":::{note}\n", - "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, though the following demonstrates the use of the options.\n", - ":::" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2024-04-10 16:25:46,989] [INFO] (root) - Parsed args: Namespace(log_level='DEBUG', input=PosixPath('/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/input'), output=PosixPath('/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output'), model=PosixPath('/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models'), workdir=None, argv=['mednist_app/mednist_classifier_monaideploy.py', '-i', 'input', '-o', 'output', '-m', 'models', '-l', 'DEBUG'])\n", - "[2024-04-10 16:25:46,993] [INFO] (root) - AppContext object: AppContext(input_path=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/input, output_path=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output, model_path=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models, workdir=)\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:211] Creating context\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1864] Activating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1894] Running Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:190] Scheduling 3 entities\n", - "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/monai/data/meta_tensor.py:116: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)\n", - " return torch.as_tensor(x, *args, **_kwargs).as_subclass(cls)\n", - "AbdomenCT\n", - "[2024-04-10 16:25:49,239] [DEBUG] (monai.deploy.operators.dicom_text_sr_writer_operator.DICOMTextSRWriterOperator) - Writing DICOM object...\n", - "\n", - "[2024-04-10 16:25:49,239] [DEBUG] (root) - Writing DICOM common modules...\n", - "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/pydicom/valuerep.py:443: UserWarning: Invalid value for VR UI: 'xyz'. Please see for allowed values for each VR.\n", - " warnings.warn(msg)\n", - "[2024-04-10 16:25:49,242] [DEBUG] (root) - DICOM common modules written:\n", - "Dataset.file_meta -------------------------------\n", - "(0002, 0000) File Meta Information Group Length UL: 198\n", - "(0002, 0001) File Meta Information Version OB: b'01'\n", - "(0002, 0002) Media Storage SOP Class UID UI: Basic Text SR Storage\n", - "(0002, 0003) Media Storage SOP Instance UID UI: 1.2.826.0.1.3680043.8.498.10219575881227434107206425977009168141\n", - "(0002, 0010) Transfer Syntax UID UI: Implicit VR Little Endian\n", - "(0002, 0012) Implementation Class UID UI: 1.2.40.0.13.1.1.1\n", - "(0002, 0013) Implementation Version Name SH: '0.5.1+25.g31e41'\n", - "-------------------------------------------------\n", - "(0008, 0005) Specific Character Set CS: 'ISO_IR 100'\n", - "(0008, 0012) Instance Creation Date DA: '20240410'\n", - "(0008, 0013) Instance Creation Time TM: '162549'\n", - "(0008, 0016) SOP Class UID UI: Basic Text SR Storage\n", - "(0008, 0018) SOP Instance UID UI: 1.2.826.0.1.3680043.8.498.10219575881227434107206425977009168141\n", - "(0008, 0020) Study Date DA: '20240410'\n", - "(0008, 0021) Series Date DA: '20240410'\n", - "(0008, 0023) Content Date DA: '20240410'\n", - "(0008, 002a) Acquisition DateTime DT: '20240410162549'\n", - "(0008, 0030) Study Time TM: '162549'\n", - "(0008, 0031) Series Time TM: '162549'\n", - "(0008, 0033) Content Time TM: '162549'\n", - "(0008, 0050) Accession Number SH: ''\n", - "(0008, 0060) Modality CS: 'SR'\n", - "(0008, 0070) Manufacturer LO: 'MOANI Deploy App SDK'\n", - "(0008, 0090) Referring Physician's Name PN: ''\n", - "(0008, 0201) Timezone Offset From UTC SH: '-0700'\n", - "(0008, 1030) Study Description LO: 'AI results.'\n", - "(0008, 103e) Series Description LO: 'CAUTION: Not for Diagnostic Use, for research use only.'\n", - "(0008, 1090) Manufacturer's Model Name LO: 'DICOM SR Writer'\n", - "(0010, 0010) Patient's Name PN: ''\n", - "(0010, 0020) Patient ID LO: ''\n", - "(0010, 0021) Issuer of Patient ID LO: ''\n", - "(0010, 0030) Patient's Birth Date DA: ''\n", - "(0010, 0040) Patient's Sex CS: ''\n", - "(0018, 0015) Body Part Examined CS: ''\n", - "(0018, 1020) Software Versions LO: '0.5.1+25.g31e41'\n", - "(0018, a001) Contributing Equipment Sequence 1 item(s) ---- \n", - " (0008, 0070) Manufacturer LO: 'MONAI WG Trainer'\n", - " (0008, 1090) Manufacturer's Model Name LO: 'MEDNIST Classifier'\n", - " (0018, 1002) Device UID UI: xyz\n", - " (0018, 1020) Software Versions LO: '0.1'\n", - " (0040, a170) Purpose of Reference Code Sequence 1 item(s) ---- \n", - " (0008, 0100) Code Value SH: 'Newcode1'\n", - " (0008, 0102) Coding Scheme Designator SH: '99IHE'\n", - " (0008, 0104) Code Meaning LO: '\"Processing Algorithm'\n", - " ---------\n", - " ---------\n", - "(0020, 000d) Study Instance UID UI: 1.2.826.0.1.3680043.8.498.99895869772559254532078552857455521250\n", - "(0020, 000e) Series Instance UID UI: 1.2.826.0.1.3680043.8.498.11097411469528473023282906105369639673\n", - "(0020, 0010) Study ID SH: '1'\n", - "(0020, 0011) Series Number IS: '7823'\n", - "(0020, 0013) Instance Number IS: '1'\n", - "(0040, 1001) Requested Procedure ID SH: ''\n", - "[2024-04-10 16:25:49,242] [DEBUG] (root) - DICOM dataset to be written:Dataset.file_meta -------------------------------\n", - "(0002, 0000) File Meta Information Group Length UL: 198\n", - "(0002, 0001) File Meta Information Version OB: b'01'\n", - "(0002, 0002) Media Storage SOP Class UID UI: Basic Text SR Storage\n", - "(0002, 0003) Media Storage SOP Instance UID UI: 1.2.826.0.1.3680043.8.498.10219575881227434107206425977009168141\n", - "(0002, 0010) Transfer Syntax UID UI: Implicit VR Little Endian\n", - "(0002, 0012) Implementation Class UID UI: 1.2.40.0.13.1.1.1\n", - "(0002, 0013) Implementation Version Name SH: '0.5.1+25.g31e41'\n", - "-------------------------------------------------\n", - "(0008, 0005) Specific Character Set CS: 'ISO_IR 100'\n", - "(0008, 0012) Instance Creation Date DA: '20240410'\n", - "(0008, 0013) Instance Creation Time TM: '162549'\n", - "(0008, 0016) SOP Class UID UI: Basic Text SR Storage\n", - "(0008, 0018) SOP Instance UID UI: 1.2.826.0.1.3680043.8.498.10219575881227434107206425977009168141\n", - "(0008, 0020) Study Date DA: '20240410'\n", - "(0008, 0021) Series Date DA: '20240410'\n", - "(0008, 0023) Content Date DA: '20240410'\n", - "(0008, 002a) Acquisition DateTime DT: '20240410162549'\n", - "(0008, 0030) Study Time TM: '162549'\n", - "(0008, 0031) Series Time TM: '162549'\n", - "(0008, 0033) Content Time TM: '162549'\n", - "(0008, 0050) Accession Number SH: ''\n", - "(0008, 0060) Modality CS: 'SR'\n", - "(0008, 0070) Manufacturer LO: 'MOANI Deploy App SDK'\n", - "(0008, 0090) Referring Physician's Name PN: ''\n", - "(0008, 0201) Timezone Offset From UTC SH: '-0700'\n", - "(0008, 1030) Study Description LO: 'AI results.'\n", - "(0008, 103e) Series Description LO: 'Not for clinical use. The result is for research use only.'\n", - "(0008, 1090) Manufacturer's Model Name LO: 'DICOM SR Writer'\n", - "(0010, 0010) Patient's Name PN: ''\n", - "(0010, 0020) Patient ID LO: ''\n", - "(0010, 0021) Issuer of Patient ID LO: ''\n", - "(0010, 0030) Patient's Birth Date DA: ''\n", - "(0010, 0040) Patient's Sex CS: ''\n", - "(0018, 0015) Body Part Examined CS: ''\n", - "(0018, 1020) Software Versions LO: '0.5.1+25.g31e41'\n", - "(0018, a001) Contributing Equipment Sequence 1 item(s) ---- \n", - " (0008, 0070) Manufacturer LO: 'MONAI WG Trainer'\n", - " (0008, 1090) Manufacturer's Model Name LO: 'MEDNIST Classifier'\n", - " (0018, 1002) Device UID UI: xyz\n", - " (0018, 1020) Software Versions LO: '0.1'\n", - " (0040, a170) Purpose of Reference Code Sequence 1 item(s) ---- \n", - " (0008, 0100) Code Value SH: 'Newcode1'\n", - " (0008, 0102) Coding Scheme Designator SH: '99IHE'\n", - " (0008, 0104) Code Meaning LO: '\"Processing Algorithm'\n", - " ---------\n", - " ---------\n", - "(0020, 000d) Study Instance UID UI: 1.2.826.0.1.3680043.8.498.99895869772559254532078552857455521250\n", - "(0020, 000e) Series Instance UID UI: 1.2.826.0.1.3680043.8.498.11097411469528473023282906105369639673\n", - "(0020, 0010) Study ID SH: '1'\n", - "(0020, 0011) Series Number IS: '7823'\n", - "(0020, 0013) Instance Number IS: '1'\n", - "(0040, 1001) Requested Procedure ID SH: ''\n", - "(0040, a040) Value Type CS: 'CONTAINER'\n", - "(0040, a043) Concept Name Code Sequence 1 item(s) ---- \n", - " (0008, 0100) Code Value SH: '18748-4'\n", - " (0008, 0102) Coding Scheme Designator SH: 'LN'\n", - " (0008, 0104) Code Meaning LO: 'Diagnostic Imaging Report'\n", - " ---------\n", - "(0040, a050) Continuity Of Content CS: 'SEPARATE'\n", - "(0040, a493) Verification Flag CS: 'UNVERIFIED'\n", - "(0040, a730) Content Sequence 1 item(s) ---- \n", - " (0040, a010) Relationship Type CS: 'CONTAINS'\n", - " (0040, a040) Value Type CS: 'TEXT'\n", - " (0040, a043) Concept Name Code Sequence 1 item(s) ---- \n", - " (0008, 0100) Code Value SH: '111412'\n", - " (0008, 0102) Coding Scheme Designator SH: 'DCM'\n", - " (0008, 0104) Code Meaning LO: 'Narrative Summary'\n", - " ---------\n", - " (0040, a160) Text Value UT: 'AbdomenCT'\n", - " ---------\n", - "[2024-04-10 16:25:49,245] [INFO] (root) - Finished writing DICOM instance to file /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output/1.2.826.0.1.3680043.8.498.10219575881227434107206425977009168141.dcm\n", - "[2024-04-10 16:25:49,246] [INFO] (monai.deploy.operators.dicom_text_sr_writer_operator.DICOMTextSRWriterOperator) - DICOM SOP instance saved in /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output/1.2.826.0.1.3680043.8.498.10219575881227434107206425977009168141.dcm\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:230] Destroying context\n" - ] - } - ], - "source": [ - "!python \"mednist_app/mednist_classifier_monaideploy.py\" -i {input_folder} -o {output_folder} -m {models_folder} -l DEBUG" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\"AbdomenCT\"" - ] - } - ], - "source": [ - "!cat {output_folder}/output.json" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Additional file required for packaging the app (creating MAP Docker image)\n", - "\n", - "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." - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing mednist_app/app.yaml\n" - ] - } - ], - "source": [ - "%%writefile mednist_app/app.yaml\n", - "%YAML 1.2\n", - "---\n", - "application:\n", - " title: MONAI Deploy App Package - MedNIST Classifier App\n", - " version: 1.0\n", - " inputFormats: [\"file\"]\n", - " outputFormats: [\"file\"]\n", - "\n", - "resources:\n", - " cpu: 1\n", - " gpu: 1\n", - " memory: 1Gi\n", - " gpuMemory: 1Gi" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing mednist_app/requirements.txt\n" - ] - } - ], - "source": [ - "%%writefile mednist_app/requirements.txt\n", - "monai>=1.2.0\n", - "Pillow>=8.4.0\n", - "pydicom>=2.3.0\n", - "highdicom>=0.18.2\n", - "SimpleITK>=2.0.0\n", - "setuptools>=59.5.0 # for pkg_resources" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "By now, we have built the application and prepared all necessary files for create the MONAI Application Package (MAP)." - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.12" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/notebooks/tutorials/02_mednist_app.ipynb b/notebooks/tutorials/02_mednist_app.ipynb index 595cb471..a507bb04 100644 --- a/notebooks/tutorials/02_mednist_app.ipynb +++ b/notebooks/tutorials/02_mednist_app.ipynb @@ -27,7 +27,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -51,48 +51,11 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "MONAI version: 1.3.0\n", - "Numpy version: 1.26.4\n", - "Pytorch version: 2.0.1+cu117\n", - "MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False\n", - "MONAI rev id: 865972f7a791bf7b42efbcd87c8402bd865b329e\n", - "MONAI __file__: /home//src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/monai/__init__.py\n", - "\n", - "Optional dependencies:\n", - "Pytorch Ignite version: 0.4.11\n", - "ITK version: NOT INSTALLED or UNKNOWN VERSION.\n", - "Nibabel version: 5.2.1\n", - "scikit-image version: 0.22.0\n", - "scipy version: 1.13.0\n", - "Pillow version: 10.3.0\n", - "Tensorboard version: NOT INSTALLED or UNKNOWN VERSION.\n", - "gdown version: 4.7.3\n", - "TorchVision version: NOT INSTALLED or UNKNOWN VERSION.\n", - "tqdm version: 4.66.2\n", - "lmdb version: NOT INSTALLED or UNKNOWN VERSION.\n", - "psutil version: 5.9.6\n", - "pandas version: NOT INSTALLED or UNKNOWN VERSION.\n", - "einops version: NOT INSTALLED or UNKNOWN VERSION.\n", - "transformers version: NOT INSTALLED or UNKNOWN VERSION.\n", - "mlflow version: NOT INSTALLED or UNKNOWN VERSION.\n", - "pynrrd version: NOT INSTALLED or UNKNOWN VERSION.\n", - "clearml version: NOT INSTALLED or UNKNOWN VERSION.\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n" - ] - } - ], + "outputs": [], "source": [ "# Copyright 2020 MONAI Consortium\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", @@ -154,52 +117,11 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "/tmp/tmpz1q9ch5_\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Downloading...\n", - "From (original): https://drive.google.com/uc?id=1QsnnkvZyJPcbRoV_ArW8SnE1OTuoVbKE\n", - "From (redirected): https://drive.google.com/uc?id=1QsnnkvZyJPcbRoV_ArW8SnE1OTuoVbKE&confirm=t&uuid=6052caf3-cb8c-4cb3-b8b8-804d8dc90e06\n", - "To: /tmp/tmpq9pcg2c8/MedNIST.tar.gz\n", - "100%|██████████| 61.8M/61.8M [00:00<00:00, 81.1MB/s]" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2024-04-10 16:28:05,802 - INFO - Downloaded: /tmp/tmpz1q9ch5_/MedNIST.tar.gz\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2024-04-10 16:28:05,912 - INFO - Verified 'MedNIST.tar.gz', md5: 0bc7306e7427e00ad1c5526a6677552d.\n", - "2024-04-10 16:28:05,914 - INFO - Writing into directory: /tmp/tmpz1q9ch5_.\n" - ] - } - ], + "outputs": [], "source": [ "directory = os.environ.get(\"MONAI_DATA_DIRECTORY\")\n", "root_dir = tempfile.mkdtemp() if directory is None else directory\n", @@ -216,20 +138,9 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Label names: ['AbdomenCT', 'BreastMRI', 'CXR', 'ChestCT', 'Hand', 'HeadCT']\n", - "Label counts: [10000, 8954, 10000, 10000, 10000, 10000]\n", - "Total image count: 58954\n", - "Image dimensions: 64 x 64\n" - ] - } - ], + "outputs": [], "source": [ "subdirs = sorted(glob.glob(f\"{data_dir}/*/\"))\n", "\n", @@ -259,7 +170,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -278,7 +189,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -302,7 +213,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -315,21 +226,9 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Epoch 1/5 Loss: 0.18928290903568268\n", - "Epoch 2/5 Loss: 0.06710730493068695\n", - "Epoch 3/5 Loss: 0.029032323509454727\n", - "Epoch 4/5 Loss: 0.01877668686211109\n", - "Epoch 5/5 Loss: 0.01939055137336254\n" - ] - } - ], + "outputs": [], "source": [ "def _prepare_batch(batch, device, non_blocking):\n", " return tuple(b.to(device) for b in batch)\n", @@ -355,7 +254,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -438,21 +337,9 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "001420.jpeg\n", - "classifier.zip\n", - "env: HOLOSCAN_INPUT_PATH=input\n", - "env: HOLOSCAN_OUTPUT_PATH=output\n", - "env: HOLOSCAN_MODEL_PATH=models\n" - ] - } - ], + "outputs": [], "source": [ "input_folder = \"input\"\n", "output_foler = \"output\"\n", @@ -480,7 +367,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -510,7 +397,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -580,7 +467,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -718,7 +605,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -762,50 +649,9 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[2024-04-10 16:35:53,768] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=[])\n", - "[2024-04-10 16:35:53,778] [INFO] (root) - AppContext object: AppContext(input_path=input, output_path=output, model_path=models, workdir=)\n", - "[info] [gxf_executor.cpp:211] Creating context\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[info] [greedy_scheduler.cpp:190] Scheduling 3 entities\n", - "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/monai/data/meta_tensor.py:116: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)\n", - " return torch.as_tensor(x, *args, **_kwargs).as_subclass(cls)\n", - "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/pydicom/valuerep.py:443: UserWarning: Invalid value for VR UI: 'xyz'. Please see for allowed values for each VR.\n", - " warnings.warn(msg)\n", - "[2024-04-10 16:35:54,545] [INFO] (root) - Finished writing DICOM instance to file output/1.2.826.0.1.3680043.8.498.91196297255331853052707757292596626343.dcm\n", - "[2024-04-10 16:35:54,548] [INFO] (monai.deploy.operators.dicom_text_sr_writer_operator.DICOMTextSRWriterOperator) - DICOM SOP instance saved in output/1.2.826.0.1.3680043.8.498.91196297255331853052707757292596626343.dcm\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "AbdomenCT\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[info] [gxf_executor.cpp:230] Destroying context\n" - ] - } - ], + "outputs": [], "source": [ "!rm -rf $HOLOSCAN_OUTPUT_PATH\n", "app = App().run()" @@ -813,17 +659,9 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\"AbdomenCT\"" - ] - } - ], + "outputs": [], "source": [ "!cat $HOLOSCAN_OUTPUT_PATH/output.json" ] @@ -844,7 +682,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -855,17 +693,9 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing mednist_app/mednist_classifier_monaideploy.py\n" - ] - } - ], + "outputs": [], "source": [ "%%writefile mednist_app/mednist_classifier_monaideploy.py\n", "\n", @@ -1114,51 +944,18 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:211] Creating context\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1864] Activating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1894] Running Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:190] Scheduling 3 entities\n", - "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/monai/data/meta_tensor.py:116: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)\n", - " return torch.as_tensor(x, *args, **_kwargs).as_subclass(cls)\n", - "AbdomenCT\n", - "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/pydicom/valuerep.py:443: UserWarning: Invalid value for VR UI: 'xyz'. Please see for allowed values for each VR.\n", - " warnings.warn(msg)\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:230] Destroying context\n" - ] - } - ], + "outputs": [], "source": [ "!python \"mednist_app/mednist_classifier_monaideploy.py\"" ] }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\"AbdomenCT\"" - ] - } - ], + "outputs": [], "source": [ "!cat $HOLOSCAN_OUTPUT_PATH/output.json" ] @@ -1181,17 +978,9 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing mednist_app/app.yaml\n" - ] - } - ], + "outputs": [], "source": [ "%%writefile mednist_app/app.yaml\n", "%YAML 1.2\n", @@ -1211,17 +1000,9 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing mednist_app/requirements.txt\n" - ] - } - ], + "outputs": [], "source": [ "%%writefile mednist_app/requirements.txt\n", "monai>=1.2.0\n", @@ -1234,453 +1015,13 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2024-04-10 16:36:05,007] [INFO] (packager.parameters) - Application: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/mednist_app/mednist_classifier_monaideploy.py\n", - "[2024-04-10 16:36:05,007] [INFO] (packager.parameters) - Detected application type: Python File\n", - "[2024-04-10 16:36:05,007] [INFO] (packager) - Scanning for models in /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models...\n", - "[2024-04-10 16:36:05,007] [DEBUG] (packager) - Model model=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models/model added.\n", - "[2024-04-10 16:36:05,007] [INFO] (packager) - Reading application configuration from /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/mednist_app/app.yaml...\n", - "[2024-04-10 16:36:05,009] [INFO] (packager) - Generating app.json...\n", - "[2024-04-10 16:36:05,009] [INFO] (packager) - Generating pkg.json...\n", - "[2024-04-10 16:36:05,015] [DEBUG] (common) - \n", - "=============== Begin app.json ===============\n", - "{\n", - " \"apiVersion\": \"1.0.0\",\n", - " \"command\": \"[\\\"python3\\\", \\\"/opt/holoscan/app/mednist_classifier_monaideploy.py\\\"]\",\n", - " \"environment\": {\n", - " \"HOLOSCAN_APPLICATION\": \"/opt/holoscan/app\",\n", - " \"HOLOSCAN_INPUT_PATH\": \"input/\",\n", - " \"HOLOSCAN_OUTPUT_PATH\": \"output/\",\n", - " \"HOLOSCAN_WORKDIR\": \"/var/holoscan\",\n", - " \"HOLOSCAN_MODEL_PATH\": \"/opt/holoscan/models\",\n", - " \"HOLOSCAN_CONFIG_PATH\": \"/var/holoscan/app.yaml\",\n", - " \"HOLOSCAN_APP_MANIFEST_PATH\": \"/etc/holoscan/app.json\",\n", - " \"HOLOSCAN_PKG_MANIFEST_PATH\": \"/etc/holoscan/pkg.json\",\n", - " \"HOLOSCAN_DOCS_PATH\": \"/opt/holoscan/docs\",\n", - " \"HOLOSCAN_LOGS_PATH\": \"/var/holoscan/logs\"\n", - " },\n", - " \"input\": {\n", - " \"path\": \"input/\",\n", - " \"formats\": null\n", - " },\n", - " \"liveness\": null,\n", - " \"output\": {\n", - " \"path\": \"output/\",\n", - " \"formats\": null\n", - " },\n", - " \"readiness\": null,\n", - " \"sdk\": \"monai-deploy\",\n", - " \"sdkVersion\": \"0.5.1\",\n", - " \"timeout\": 0,\n", - " \"version\": 1.0,\n", - " \"workingDirectory\": \"/var/holoscan\"\n", - "}\n", - "================ End app.json ================\n", - " \n", - "[2024-04-10 16:36:05,015] [DEBUG] (common) - \n", - "=============== Begin pkg.json ===============\n", - "{\n", - " \"apiVersion\": \"1.0.0\",\n", - " \"applicationRoot\": \"/opt/holoscan/app\",\n", - " \"modelRoot\": \"/opt/holoscan/models\",\n", - " \"models\": {\n", - " \"model\": \"/opt/holoscan/models/model\"\n", - " },\n", - " \"resources\": {\n", - " \"cpu\": 1,\n", - " \"gpu\": 1,\n", - " \"memory\": \"1Gi\",\n", - " \"gpuMemory\": \"1Gi\"\n", - " },\n", - " \"version\": 1.0,\n", - " \"platformConfig\": \"dgpu\"\n", - "}\n", - "================ End pkg.json ================\n", - " \n", - "[2024-04-10 16:36:05,050] [DEBUG] (packager.builder) - \n", - "========== Begin Dockerfile ==========\n", - "\n", - "\n", - "FROM nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "\n", - "ENV DEBIAN_FRONTEND=noninteractive\n", - "ENV TERM=xterm-256color\n", - "\n", - "ARG UNAME\n", - "ARG UID\n", - "ARG GID\n", - "\n", - "RUN mkdir -p /etc/holoscan/ \\\n", - " && mkdir -p /opt/holoscan/ \\\n", - " && mkdir -p /var/holoscan \\\n", - " && mkdir -p /opt/holoscan/app \\\n", - " && mkdir -p /var/holoscan/input \\\n", - " && mkdir -p /var/holoscan/output\n", - "\n", - "LABEL base=\"nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\"\n", - "LABEL tag=\"mednist_app:1.0\"\n", - "LABEL org.opencontainers.image.title=\"MONAI Deploy App Package - MedNIST Classifier App\"\n", - "LABEL org.opencontainers.image.version=\"1.0\"\n", - "LABEL org.nvidia.holoscan=\"1.0.3\"\n", - "LABEL org.monai.deploy.app-sdk=\"0.5.1\"\n", - "\n", - "\n", - "ENV HOLOSCAN_ENABLE_HEALTH_CHECK=true\n", - "ENV HOLOSCAN_INPUT_PATH=/var/holoscan/input\n", - "ENV HOLOSCAN_OUTPUT_PATH=/var/holoscan/output\n", - "ENV HOLOSCAN_WORKDIR=/var/holoscan\n", - "ENV HOLOSCAN_APPLICATION=/opt/holoscan/app\n", - "ENV HOLOSCAN_TIMEOUT=0\n", - "ENV HOLOSCAN_MODEL_PATH=/opt/holoscan/models\n", - "ENV HOLOSCAN_DOCS_PATH=/opt/holoscan/docs\n", - "ENV HOLOSCAN_CONFIG_PATH=/var/holoscan/app.yaml\n", - "ENV HOLOSCAN_APP_MANIFEST_PATH=/etc/holoscan/app.json\n", - "ENV HOLOSCAN_PKG_MANIFEST_PATH=/etc/holoscan/pkg.json\n", - "ENV HOLOSCAN_LOGS_PATH=/var/holoscan/logs\n", - "ENV PATH=/root/.local/bin:/opt/nvidia/holoscan:$PATH\n", - "ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/libtorch/1.13.1/lib/:/opt/nvidia/holoscan/lib\n", - "\n", - "RUN apt-get update \\\n", - " && apt-get install -y curl jq \\\n", - " && rm -rf /var/lib/apt/lists/*\n", - "\n", - "ENV PYTHONPATH=\"/opt/holoscan/app:$PYTHONPATH\"\n", - "\n", - "\n", - "\n", - "RUN groupadd -f -g $GID $UNAME\n", - "RUN useradd -rm -d /home/$UNAME -s /bin/bash -g $GID -G sudo -u $UID $UNAME\n", - "RUN chown -R holoscan /var/holoscan \n", - "RUN chown -R holoscan /var/holoscan/input \n", - "RUN chown -R holoscan /var/holoscan/output \n", - "\n", - "# Set the working directory\n", - "WORKDIR /var/holoscan\n", - "\n", - "# Copy HAP/MAP tool script\n", - "COPY ./tools /var/holoscan/tools\n", - "RUN chmod +x /var/holoscan/tools\n", - "\n", - "\n", - "# Copy gRPC health probe\n", - "\n", - "USER $UNAME\n", - "\n", - "ENV PATH=/root/.local/bin:/home/holoscan/.local/bin:/opt/nvidia/holoscan:$PATH\n", - "\n", - "COPY ./pip/requirements.txt /tmp/requirements.txt\n", - "\n", - "RUN pip install --upgrade pip\n", - "RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", - "\n", - "# Install Holoscan from PyPI only when sdk_type is Holoscan. \n", - "# For MONAI Deploy, the APP SDK will install it unless user specifies the Holoscan SDK file.\n", - "\n", - "# Copy user-specified MONAI Deploy SDK file\n", - "COPY ./monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "\n", - "\n", - "\n", - "\n", - "COPY ./models /opt/holoscan/models\n", - "\n", - "COPY ./map/app.json /etc/holoscan/app.json\n", - "COPY ./app.config /var/holoscan/app.yaml\n", - "COPY ./map/pkg.json /etc/holoscan/pkg.json\n", - "\n", - "COPY ./app /opt/holoscan/app\n", - "\n", - "ENTRYPOINT [\"/var/holoscan/tools\"]\n", - "=========== End Dockerfile ===========\n", - "\n", - "[2024-04-10 16:36:05,050] [INFO] (packager.builder) - \n", - "===============================================================================\n", - "Building image for: x64-workstation\n", - " Architecture: linux/amd64\n", - " Base Image: nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - " Build Image: N/A\n", - " Cache: Enabled\n", - " Configuration: dgpu\n", - " Holoscan SDK Package: pypi.org\n", - " MONAI Deploy App SDK Package: /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - " gRPC Health Probe: N/A\n", - " SDK Version: 1.0.3\n", - " SDK: monai-deploy\n", - " Tag: mednist_app-x64-workstation-dgpu-linux-amd64:1.0\n", - " \n", - "[2024-04-10 16:36:05,416] [INFO] (common) - Using existing Docker BuildKit builder `holoscan_app_builder`\n", - "[2024-04-10 16:36:05,416] [DEBUG] (packager.builder) - Building Holoscan Application Package: tag=mednist_app-x64-workstation-dgpu-linux-amd64:1.0\n", - "#0 building with \"holoscan_app_builder\" instance using docker-container driver\n", - "\n", - "#1 [internal] load build definition from Dockerfile\n", - "#1 transferring dockerfile: 2.81kB done\n", - "#1 DONE 0.1s\n", - "\n", - "#2 [internal] load metadata for nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#2 DONE 0.5s\n", - "\n", - "#3 [internal] load .dockerignore\n", - "#3 transferring context: 1.79kB done\n", - "#3 DONE 0.1s\n", - "\n", - "#4 importing cache manifest from nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#4 ...\n", - "\n", - "#5 [internal] load build context\n", - "#5 DONE 0.0s\n", - "\n", - "#6 importing cache manifest from local:12491137658764693548\n", - "#6 inferred cache manifest type: application/vnd.oci.image.index.v1+json done\n", - "#6 DONE 0.0s\n", - "\n", - "#7 [ 1/21] FROM nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu@sha256:50343c616bf910e2a7651abb59db7833933e82cce64c3c4885f938d7e4af6155\n", - "#7 resolve nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu@sha256:50343c616bf910e2a7651abb59db7833933e82cce64c3c4885f938d7e4af6155 0.0s done\n", - "#7 DONE 0.0s\n", - "\n", - "#4 importing cache manifest from nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#4 inferred cache manifest type: application/vnd.docker.distribution.manifest.list.v2+json done\n", - "#4 DONE 0.5s\n", - "\n", - "#5 [internal] load build context\n", - "#5 transferring context: 28.75MB 0.2s done\n", - "#5 DONE 0.2s\n", - "\n", - "#8 [13/21] RUN pip install --upgrade pip\n", - "#8 CACHED\n", - "\n", - "#9 [10/21] COPY ./tools /var/holoscan/tools\n", - "#9 CACHED\n", - "\n", - "#10 [ 9/21] WORKDIR /var/holoscan\n", - "#10 CACHED\n", - "\n", - "#11 [ 7/21] RUN chown -R holoscan /var/holoscan/input\n", - "#11 CACHED\n", - "\n", - "#12 [ 5/21] RUN useradd -rm -d /home/holoscan -s /bin/bash -g 1000 -G sudo -u 1000 holoscan\n", - "#12 CACHED\n", - "\n", - "#13 [ 8/21] RUN chown -R holoscan /var/holoscan/output\n", - "#13 CACHED\n", - "\n", - "#14 [ 3/21] RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*\n", - "#14 CACHED\n", - "\n", - "#15 [12/21] COPY ./pip/requirements.txt /tmp/requirements.txt\n", - "#15 CACHED\n", - "\n", - "#16 [11/21] RUN chmod +x /var/holoscan/tools\n", - "#16 CACHED\n", - "\n", - "#17 [ 2/21] RUN mkdir -p /etc/holoscan/ && mkdir -p /opt/holoscan/ && mkdir -p /var/holoscan && mkdir -p /opt/holoscan/app && mkdir -p /var/holoscan/input && mkdir -p /var/holoscan/output\n", - "#17 CACHED\n", - "\n", - "#18 [ 4/21] RUN groupadd -f -g 1000 holoscan\n", - "#18 CACHED\n", - "\n", - "#19 [ 6/21] RUN chown -R holoscan /var/holoscan\n", - "#19 CACHED\n", - "\n", - "#20 [14/21] RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", - "#20 CACHED\n", - "\n", - "#21 [15/21] COPY ./monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "#21 DONE 0.3s\n", - "\n", - "#22 [16/21] RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "#22 0.701 Defaulting to user installation because normal site-packages is not writeable\n", - "#22 0.799 Processing /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "#22 0.810 Requirement already satisfied: numpy>=1.21.6 in /usr/local/lib/python3.10/dist-packages (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (1.23.5)\n", - "#22 0.996 Collecting holoscan~=1.0 (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.066 Downloading holoscan-1.0.3-cp310-cp310-manylinux_2_35_x86_64.whl.metadata (4.1 kB)\n", - "#22 1.137 Collecting colorama>=0.4.1 (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.141 Downloading colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)\n", - "#22 1.222 Collecting typeguard>=3.0.0 (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.227 Downloading typeguard-4.2.1-py3-none-any.whl.metadata (3.7 kB)\n", - "#22 1.322 Collecting pip==23.3.2 (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.327 Downloading pip-23.3.2-py3-none-any.whl.metadata (3.5 kB)\n", - "#22 1.343 Requirement already satisfied: cupy-cuda12x==12.2 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (12.2.0)\n", - "#22 1.343 Requirement already satisfied: cloudpickle==2.2.1 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2.2.1)\n", - "#22 1.344 Requirement already satisfied: python-on-whales==0.60.1 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (0.60.1)\n", - "#22 1.346 Requirement already satisfied: Jinja2==3.1.2 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.1.2)\n", - "#22 1.346 Requirement already satisfied: packaging==23.1 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (23.1)\n", - "#22 1.347 Requirement already satisfied: pyyaml==6.0 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (6.0)\n", - "#22 1.348 Requirement already satisfied: requests==2.28.2 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2.28.2)\n", - "#22 1.350 Requirement already satisfied: psutil==5.9.6 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (5.9.6)\n", - "#22 1.461 Collecting wheel-axle-runtime<1.0 (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.467 Downloading wheel_axle_runtime-0.0.5-py3-none-any.whl.metadata (7.7 kB)\n", - "#22 1.504 Requirement already satisfied: fastrlock>=0.5 in /usr/local/lib/python3.10/dist-packages (from cupy-cuda12x==12.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (0.8.2)\n", - "#22 1.508 Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from Jinja2==3.1.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2.1.3)\n", - "#22 1.523 Requirement already satisfied: pydantic<2,>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (1.10.14)\n", - "#22 1.524 Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (4.66.1)\n", - "#22 1.525 Requirement already satisfied: typer>=0.4.1 in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (0.9.0)\n", - "#22 1.526 Requirement already satisfied: typing-extensions in /home/holoscan/.local/lib/python3.10/site-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (4.10.0)\n", - "#22 1.533 Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.3.2)\n", - "#22 1.534 Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.6)\n", - "#22 1.535 Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (1.26.18)\n", - "#22 1.536 Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2023.11.17)\n", - "#22 1.551 Requirement already satisfied: filelock in /home/holoscan/.local/lib/python3.10/site-packages (from wheel-axle-runtime<1.0->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.13.3)\n", - "#22 1.587 Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.10/dist-packages (from typer>=0.4.1->python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (8.1.7)\n", - "#22 1.630 Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)\n", - "#22 1.653 Downloading holoscan-1.0.3-cp310-cp310-manylinux_2_35_x86_64.whl (33.6 MB)\n", - "#22 2.391 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 33.6/33.6 MB 36.3 MB/s eta 0:00:00\n", - "#22 2.399 Downloading pip-23.3.2-py3-none-any.whl (2.1 MB)\n", - "#22 2.452 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 45.3 MB/s eta 0:00:00\n", - "#22 2.459 Downloading typeguard-4.2.1-py3-none-any.whl (34 kB)\n", - "#22 2.484 Downloading wheel_axle_runtime-0.0.5-py3-none-any.whl (12 kB)\n", - "#22 2.841 Installing collected packages: wheel-axle-runtime, typeguard, pip, colorama, holoscan, monai-deploy-app-sdk\n", - "#22 2.915 Attempting uninstall: pip\n", - "#22 2.916 Found existing installation: pip 24.0\n", - "#22 2.967 Uninstalling pip-24.0:\n", - "#22 3.365 Successfully uninstalled pip-24.0\n", - "#22 5.013 Successfully installed colorama-0.4.6 holoscan-1.0.3 monai-deploy-app-sdk-0.5.1+25.g31e4165.dirty pip-23.3.2 typeguard-4.2.1 wheel-axle-runtime-0.0.5\n", - "#22 DONE 5.6s\n", - "\n", - "#23 [17/21] COPY ./models /opt/holoscan/models\n", - "#23 DONE 0.3s\n", - "\n", - "#24 [18/21] COPY ./map/app.json /etc/holoscan/app.json\n", - "#24 DONE 0.1s\n", - "\n", - "#25 [19/21] COPY ./app.config /var/holoscan/app.yaml\n", - "#25 DONE 0.1s\n", - "\n", - "#26 [20/21] COPY ./map/pkg.json /etc/holoscan/pkg.json\n", - "#26 DONE 0.1s\n", - "\n", - "#27 [21/21] COPY ./app /opt/holoscan/app\n", - "#27 DONE 0.1s\n", - "\n", - "#28 exporting to docker image format\n", - "#28 exporting layers\n", - "#28 exporting layers 5.9s done\n", - "#28 exporting manifest sha256:261bfd883479734974f9f01500b63a394537a84df186d0552794645b0152f0f5 0.0s done\n", - "#28 exporting config sha256:47a95542f89e8e3174bba11729dc605a923542cf7c48c180ae2eb42290619826 0.0s done\n", - "#28 sending tarball\n", - "#28 ...\n", - "\n", - "#29 importing to docker\n", - "#29 loading layer 2c6ff491304f 32.77kB / 125.57kB\n", - "#29 loading layer 04072fb0fc22 557.06kB / 73.96MB\n", - "#29 loading layer 04072fb0fc22 71.86MB / 73.96MB 2.1s\n", - "#29 loading layer 1982c4813c35 262.14kB / 26.20MB\n", - "#29 loading layer dc0acf48e445 513B / 513B\n", - "#29 loading layer a50eb25f7721 320B / 320B\n", - "#29 loading layer 838ef774fdf1 298B / 298B\n", - "#29 loading layer 3401c98a4ff8 4.00kB / 4.00kB\n", - "#29 loading layer 838ef774fdf1 298B / 298B 0.8s done\n", - "#29 loading layer 2c6ff491304f 32.77kB / 125.57kB 4.0s done\n", - "#29 loading layer 04072fb0fc22 71.86MB / 73.96MB 3.8s done\n", - "#29 loading layer 1982c4813c35 262.14kB / 26.20MB 1.3s done\n", - "#29 loading layer dc0acf48e445 513B / 513B 0.9s done\n", - "#29 loading layer a50eb25f7721 320B / 320B 0.9s done\n", - "#29 loading layer 3401c98a4ff8 4.00kB / 4.00kB 0.8s done\n", - "#29 DONE 4.0s\n", - "\n", - "#28 exporting to docker image format\n", - "#28 sending tarball 68.3s done\n", - "#28 DONE 74.3s\n", - "\n", - "#30 exporting cache to client directory\n", - "#30 preparing build cache for export\n", - "#30 writing layer sha256:00bb4c1319ba1a33ac3edcb3aa1240d8abcb8d0383c6267ed8028d3b6228a8a4\n", - "#30 writing layer sha256:00bb4c1319ba1a33ac3edcb3aa1240d8abcb8d0383c6267ed8028d3b6228a8a4 done\n", - "#30 writing layer sha256:014cff740c9ec6e9a30d0b859219a700ae880eb385d62095d348f5ea136d6015 done\n", - "#30 writing layer sha256:0a1756432df4a4350712d8ae5c003f1526bd2180800b3ae6301cfc9ccf370254 done\n", - "#30 writing layer sha256:0a77dcbd0e648ddc4f8e5230ade8fdb781d99e24fa4f13ca96a360c7f7e6751f done\n", - "#30 writing layer sha256:0ec682bf99715a9f88631226f3749e2271b8b9f254528ef61f65ed829984821c done\n", - "#30 writing layer sha256:1133dfcee0e851b490d17b3567f50c4b25ba5750da02ba4b3f3630655d0b1a7b done\n", - "#30 writing layer sha256:1294b2835667d633f938174d9fecb18a60bbbebb6fb49788a1f939893a25d1af done\n", - "#30 writing layer sha256:16a03c6e0373b62f9713416da0229bb7ce2585183141081d3ea8427ad2e84408 done\n", - "#30 writing layer sha256:20d331454f5fb557f2692dfbdbe092c718fd2cb55d5db9d661b62228dacca5c2 done\n", - "#30 writing layer sha256:2232aeb26b5b7ea57227e9a5b84da4fb229624d7bc976a5f7ce86d9c8653d277 done\n", - "#30 writing layer sha256:238f69a43816e481f0295995fcf5fe74d59facf0f9f99734c8d0a2fb140630e0 done\n", - "#30 writing layer sha256:2ad84487f9d4d31cd1e0a92697a5447dd241935253d036b272ef16d31620c1e7 done\n", - "#30 writing layer sha256:2bb73464628bd4a136c4937f42d522c847bea86b2215ae734949e24c1caf450e done\n", - "#30 writing layer sha256:2ca59f23482f8bc9a313f15326cc9326efd2553b0480274dc62b6213b864e2ed 0.0s done\n", - "#30 writing layer sha256:32ccfe43297de5eb7d872ac37cb2e4b356a9fdd75b37a1d4e9c0a96f26d3a1eb 0.0s done\n", - "#30 writing layer sha256:3e3e04011ebdba380ab129f0ee390626cb2a600623815ca756340c18bedb9517 done\n", - "#30 writing layer sha256:42619ce4a0c9e54cfd0ee41a8e5f27d58b3f51becabd1ac6de725fbe6c42b14a done\n", - "#30 writing layer sha256:43a21fb6c76bd2b3715cc09d9f8c3865dc61c51dd9e2327b429f5bec8fff85d1 done\n", - "#30 writing layer sha256:49bdc9abf8a437ccff67cc11490ba52c976577992909856a86be872a34d3b950 done\n", - "#30 writing layer sha256:4b691ba9f48b41eaa0c754feba8366f1c030464fcbc55eeffa6c86675990933a done\n", - "#30 writing layer sha256:4d04a8db404f16c2704fa10739cb6745a0187713a21a6ef0deb34b48629b54c1 done\n", - "#30 writing layer sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 done\n", - "#30 writing layer sha256:5275a41be8f6691a490c0a15589e0910c73bf971169ad33a850ef570d37f63dd done\n", - "#30 writing layer sha256:52fbfeaf78318d843054ce2bfb5bfc9f71278939a815f6035ab5b14573ad017b done\n", - "#30 writing layer sha256:5792b18b6f162bae61ff5840cdb9e8567e6847a56ac886f940b47e7271c529a7 done\n", - "#30 writing layer sha256:57f244836ad318f9bbb3b29856ae1a5b31038bfbb9b43d2466d51c199eb55041 done\n", - "#30 writing layer sha256:5b5b131e0f20db4cb8e568b623a95f8fc16ed1c6b322a9366df70b59a881f24f done\n", - "#30 writing layer sha256:5ccb787d371fd3697122101438ddd0f55b537832e9756d2c51ab1d8158710ac5 done\n", - "#30 writing layer sha256:62452179df7c18e292f141d4aec29e6aba9ff8270c893731169fc6f41dc07631 done\n", - "#30 writing layer sha256:6630c387f5f2115bca2e646fd0c2f64e1f3d5431c2e050abe607633883eda230 done\n", - "#30 writing layer sha256:69af4b756272a77f683a8d118fd5ca55c03ad5f1bacc673b463f54d16b833da5 done\n", - "#30 writing layer sha256:6ae1f1fb92c0cb2b6e219f687b08c8e511501a7af696c943ca20d119eba7cd02 done\n", - "#30 writing layer sha256:6deb3d550b15a5e099c0b3d0cbc242e351722ca16c058d3a6c28ba1a02824d0f done\n", - "#30 writing layer sha256:7386814d57100e2c7389fbf4e16f140f5c549d31434c62c3884a85a3ee5cd2a7 done\n", - "#30 writing layer sha256:7852b73ea931e3a8d3287ee7ef3cf4bad068e44f046583bfc2b81336fb299284 done\n", - "#30 writing layer sha256:7e73869c74822e4539e104a3d2aff853f4622cd0bb873576db1db53c9e91f621 done\n", - "#30 writing layer sha256:7eae142b38745fe88962874372374deb672998600264a17e638c010b79e6b535 done\n", - "#30 writing layer sha256:7f2e5ab2c599fa36698918d3e73c991d8616fff9037077cd230529e7cd1c5e0e done\n", - "#30 writing layer sha256:81b2d4e60f6b67ed37f95e3d15237a436e76056fb4babcb9a188fd2b337c897b 0.0s done\n", - "#30 writing layer sha256:82a3436133b2b17bb407c7fe488932aa0ca55411f23ab55c34a6134b287c6a27 done\n", - "#30 writing layer sha256:90eae6faa5cc5ba62f12c25915cdfb1a7a51abfba0d05cb5818c3f908f4e345f\n", - "#30 writing layer sha256:90eae6faa5cc5ba62f12c25915cdfb1a7a51abfba0d05cb5818c3f908f4e345f done\n", - "#30 writing layer sha256:93e2013abbc3bc85f24d4739ac397584f6332aec7d8e80f8d95d9c961978fe90 0.0s done\n", - "#30 writing layer sha256:9723201c31b4e56a2dff5c3769790d4d6a7c069d75bdd3996395600bd0d067cd done\n", - "#30 writing layer sha256:9ac855545fa90ed2bf3b388fdff9ef06ac9427b0c0fca07c9e59161983d8827e done\n", - "#30 writing layer sha256:9d19ee268e0d7bcf6716e6658ee1b0384a71d6f2f9aa1ae2085610cf7c7b316f done\n", - "#30 writing layer sha256:a10c8d7d2714eabf661d1f43a1ccb87a51748cbb9094d5bc0b713e2481b5d329 done\n", - "#30 writing layer sha256:a1748eee9d376f97bd19225ba61dfada9986f063f4fc429e435f157abb629fc6 done\n", - "#30 writing layer sha256:a68f4e0ec09ec3b78cb4cf8e4511d658e34e7b6f676d7806ad9703194ff17604 done\n", - "#30 writing layer sha256:a8e4decc8f7289623b8fd7b9ba1ca555b5a755ebdbf81328d68209f148d9e602 done\n", - "#30 writing layer sha256:a9cc9b4b42ca5455c9da9b048ab2cc36e82bd335f51c23817f4bcf330bbb96f1 done\n", - "#30 writing layer sha256:afde1c269453ce68a0f2b54c1ba8c5ecddeb18a19e5618a4acdef1f0fe3921af done\n", - "#30 writing layer sha256:b48a5fafcaba74eb5d7e7665601509e2889285b50a04b5b639a23f8adc818157 done\n", - "#30 writing layer sha256:ba9f7c75e4dd7942b944679995365aab766d3677da2e69e1d74472f471a484dd done\n", - "#30 writing layer sha256:bdfc73b2a0fa11b4086677e117a2f9feb6b4ffeccb23a3d58a30543339607e31 done\n", - "#30 writing layer sha256:c175bb235295e50de2961fa1e1a2235c57e6eba723a914287dfc26d3be0eac11 done\n", - "#30 writing layer sha256:c98533d2908f36a5e9b52faae83809b3b6865b50e90e2817308acfc64cd3655f done\n", - "#30 writing layer sha256:cb6c95b33bc30dd285c5b3cf99a05281b8f12decae1c932ab64bd58f56354021 done\n", - "#30 writing layer sha256:cc985f61e92a80cbc59a150c5758becb75f8eddbbbaf17d46374ede3cd01a51f\n", - "#30 writing layer sha256:cc985f61e92a80cbc59a150c5758becb75f8eddbbbaf17d46374ede3cd01a51f 0.5s done\n", - "#30 writing layer sha256:d7da5c5e9a40c476c4b3188a845e3276dedfd752e015ea5113df5af64d4d43f7\n", - "#30 writing layer sha256:d7da5c5e9a40c476c4b3188a845e3276dedfd752e015ea5113df5af64d4d43f7 done\n", - "#30 writing layer sha256:df3589199e830d446e82feab6d40fac58781a5bd8b2d206f25b85a317b994f93 0.0s done\n", - "#30 writing layer sha256:e434bbf389a48c6e211eca75d5ca50839cb622b1ba3a36c6b35d600e53e16b21 done\n", - "#30 writing layer sha256:e4aedc686433c0ec5e676e6cc54a164345f7016aa0eb714f00c07e11664a1168 done\n", - "#30 writing layer sha256:e5d1792b50654fc7f0eed206f4c91e95f8e4b107554a7296502020c7029a76b6\n", - "#30 writing layer sha256:e5d1792b50654fc7f0eed206f4c91e95f8e4b107554a7296502020c7029a76b6 1.3s done\n", - "#30 preparing build cache for export 2.2s done\n", - "#30 writing layer sha256:e8acb678f16bc0c369d5cf9c184f2d3a1c773986816526e5e3e9c0354f7e757f done\n", - "#30 writing layer sha256:e9225f7ab6606813ec9acba98a064826ebfd6713a9645a58cd068538af1ecddb done\n", - "#30 writing layer sha256:f33546e75bf1a7d9dc9e21b9a2c54c9d09b24790ad7a4192a8509002ceb14688 done\n", - "#30 writing layer sha256:f608e2fbff86e98627b7e462057e7d2416522096d73fe4664b82fe6ce8a4047d done\n", - "#30 writing layer sha256:f7702077ced42a1ee35e7f5e45f72634328ff3bcfe3f57735ba80baa5ec45daf done\n", - "#30 writing layer sha256:fa66a49172c6e821a1bace57c007c01da10cbc61507c44f8cdfeed8c4e5febab done\n", - "#30 writing config sha256:217441004720a68ddf80261db2a5b316ddba5c5bc611403e7439f6d0f6d2055d 0.0s done\n", - "#30 writing cache manifest sha256:eb0660732980435a67eb754f67f1d7b91fa92f577670a600c7a8a50a85b8f872 0.0s done\n", - "#30 DONE 2.2s\n", - "[2024-04-10 16:37:31,408] [INFO] (packager) - Build Summary:\n", - "\n", - "Platform: x64-workstation/dgpu\n", - " Status: Succeeded\n", - " Docker Tag: mednist_app-x64-workstation-dgpu-linux-amd64:1.0\n", - " Tarball: None\n" - ] - } - ], + "outputs": [], "source": [ "tag_prefix = \"mednist_app\"\n", "\n", - "!monai-deploy package \"mednist_app/mednist_classifier_monaideploy.py\" -m {models_folder} -c \"mednist_app/app.yaml\" -t {tag_prefix}:1.0 --platform x64-workstation -l DEBUG" + "!monai-deploy package \"mednist_app/mednist_classifier_monaideploy.py\" -m {models_folder} -c \"mednist_app/app.yaml\" -t {tag_prefix}:1.0 --platform x64-workstation -l DEBUG --monai-deploy-sdk-file /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz" ] }, { @@ -1697,17 +1038,9 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "mednist_app-x64-workstation-dgpu-linux-amd64 1.0 47a95542f89e About a minute ago 17.5GB\n" - ] - } - ], + "outputs": [], "source": [ "!docker image ls | grep {tag_prefix}" ] @@ -1723,84 +1056,9 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2024-04-10 16:37:33,094] [INFO] (runner) - Checking dependencies...\n", - "[2024-04-10 16:37:33,094] [INFO] (runner) - --> Verifying if \"docker\" is installed...\n", - "\n", - "[2024-04-10 16:37:33,094] [INFO] (runner) - --> Verifying if \"docker-buildx\" is installed...\n", - "\n", - "[2024-04-10 16:37:33,094] [INFO] (runner) - --> Verifying if \"mednist_app-x64-workstation-dgpu-linux-amd64:1.0\" is available...\n", - "\n", - "[2024-04-10 16:37:33,168] [INFO] (runner) - Reading HAP/MAP manifest...\n", - "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.56kB to /tmp/tmp96catisy/app.json\n", - "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.05kB to /tmp/tmp96catisy/pkg.json\n", - "[2024-04-10 16:37:33,777] [INFO] (runner) - --> Verifying if \"nvidia-ctk\" is installed...\n", - "\n", - "[2024-04-10 16:37:33,778] [INFO] (runner) - --> Verifying \"nvidia-ctk\" version...\n", - "\n", - "[2024-04-10 16:37:33,934] [INFO] (common) - Launching container (4b3bba81606f) using image 'mednist_app-x64-workstation-dgpu-linux-amd64:1.0'...\n", - " container name: flamboyant_jepsen\n", - " host name: mingq-dt\n", - " network: host\n", - " user: 1000:1000\n", - " ulimits: memlock=-1:-1, stack=67108864:67108864\n", - " cap_add: CAP_SYS_PTRACE\n", - " ipc mode: host\n", - " shared memory size: 67108864\n", - " devices: \n", - " group_add: 44\n", - "2024-04-10 23:37:34 [INFO] Launching application python3 /opt/holoscan/app/mednist_classifier_monaideploy.py ...\n", - "\n", - "[info] [app_driver.cpp:1161] Launching the driver/health checking service\n", - "\n", - "[info] [gxf_executor.cpp:211] Creating context\n", - "\n", - "[info] [server.cpp:87] Health checking server listening on 0.0.0.0:8777\n", - "\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", - "\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", - "\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", - "\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "\n", - "[info] [greedy_scheduler.cpp:190] Scheduling 3 entities\n", - "\n", - "/home/holoscan/.local/lib/python3.10/site-packages/monai/data/meta_tensor.py:116: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)\n", - "\n", - " return torch.as_tensor(x, *args, **_kwargs).as_subclass(cls)\n", - "\n", - "/home/holoscan/.local/lib/python3.10/site-packages/pydicom/valuerep.py:443: UserWarning: Invalid value for VR UI: 'xyz'. Please see for allowed values for each VR.\n", - "\n", - " warnings.warn(msg)\n", - "\n", - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "\n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "\n", - "[info] [gxf_executor.cpp:230] Destroying context\n", - "\n", - "AbdomenCT\n", - "\n", - "[2024-04-10 16:37:42,228] [INFO] (common) - Container 'flamboyant_jepsen'(4b3bba81606f) exited.\n" - ] - } - ], + "outputs": [], "source": [ "# Clear the output folder and run the MAP. The input is expected to be a folder.\n", "!rm -rf $HOLOSCAN_OUTPUT_PATH\n", @@ -1809,17 +1067,9 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\"AbdomenCT\"" - ] - } - ], + "outputs": [], "source": [ "!cat $HOLOSCAN_OUTPUT_PATH/output.json" ] @@ -1833,7 +1083,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ diff --git a/notebooks/tutorials/03_segmentation_app.ipynb b/notebooks/tutorials/03_segmentation_app.ipynb index 946e2420..1d0f96a7 100644 --- a/notebooks/tutorials/03_segmentation_app.ipynb +++ b/notebooks/tutorials/03_segmentation_app.ipynb @@ -134,23 +134,20 @@ "text": [ "Requirement already satisfied: gdown in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (5.1.0)\n", "Requirement already satisfied: beautifulsoup4 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (4.12.3)\n", - "Requirement already satisfied: filelock in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (3.13.3)\n", - "Requirement already satisfied: requests[socks] in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (2.28.2)\n", + "Requirement already satisfied: filelock in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (3.13.4)\n", + "Requirement already satisfied: requests[socks] in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (2.31.0)\n", "Requirement already satisfied: tqdm in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (4.66.2)\n", "Requirement already satisfied: soupsieve>1.2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from beautifulsoup4->gdown) (2.5)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.3.2)\n", - "Requirement already satisfied: idna<4,>=2.5 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.6)\n", - "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (1.26.18)\n", + "Requirement already satisfied: idna<4,>=2.5 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.7)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (2.2.1)\n", "Requirement already satisfied: certifi>=2017.4.17 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (2024.2.2)\n", "Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (1.7.1)\n", - "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.3.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.0\u001b[0m\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", "Downloading...\n", "From (original): https://drive.google.com/uc?id=1Uds8mEvdGNYUuvFpTtCQ8gNU97bAPCaQ\n", - "From (redirected): https://drive.google.com/uc?id=1Uds8mEvdGNYUuvFpTtCQ8gNU97bAPCaQ&confirm=t&uuid=03efbee4-6b67-4413-8b8e-522d9c7cc472\n", + "From (redirected): https://drive.google.com/uc?id=1Uds8mEvdGNYUuvFpTtCQ8gNU97bAPCaQ&confirm=t&uuid=b36320bd-a960-4f4b-aa1f-4a35f5a559c1\n", "To: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/ai_spleen_seg_bundle_data.zip\n", - "100%|███████████████████████████████████████| 79.4M/79.4M [00:00<00:00, 101MB/s]\n", + "100%|██████████████████████████████████████| 79.4M/79.4M [00:00<00:00, 90.6MB/s]\n", "Archive: ai_spleen_seg_bundle_data.zip\n", " inflating: dcm/1-001.dcm \n", " inflating: dcm/1-002.dcm \n", @@ -747,95 +744,111 @@ "name": "stderr", "output_type": "stream", "text": [ - "[2024-04-10 16:41:09,106] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=[])\n", - "[2024-04-10 16:41:09,114] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=models, workdir=)\n", - "[2024-04-10 16:41:09,116] [INFO] (__main__.AISpleenSegApp) - App input and output path: dcm, output\n", - "[info] [gxf_executor.cpp:211] Creating context\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[info] [greedy_scheduler.cpp:190] Scheduling 6 entities\n", - "[2024-04-10 16:41:09,164] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", - "[2024-04-10 16:41:09,742] [INFO] (root) - Finding series for Selection named: CT Series\n", - "[2024-04-10 16:41:09,743] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", + "[2024-04-22 15:22:16,125] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=[])\n", + "[2024-04-22 15:22:16,135] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=models, workdir=)\n", + "[2024-04-22 15:22:16,137] [INFO] (__main__.AISpleenSegApp) - App input and output path: dcm, output\n", + "[info] [gxf_executor.cpp:247] Creating context\n", + "[info] [gxf_executor.cpp:1672] Loading extensions from configs...\n", + "[info] [gxf_executor.cpp:1842] Activating Graph...\n", + "[info] [gxf_executor.cpp:1874] Running Graph...\n", + "[info] [gxf_executor.cpp:1876] Waiting for completion...\n", + "[2024-04-22 15:22:16,183] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[0m2024-04-22 15:22:16.182 INFO gxf/std/greedy_scheduler.cpp@191: Scheduling 6 entities\u001b[0m\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[2024-04-22 15:22:16,744] [INFO] (root) - Finding series for Selection named: CT Series\n", + "[2024-04-22 15:22:16,745] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", " # of series: 1\n", - "[2024-04-10 16:41:09,744] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 16:41:09,745] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", - "[2024-04-10 16:41:09,746] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", - "[2024-04-10 16:41:09,747] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 16:41:09,748] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", - "[2024-04-10 16:41:09,749] [INFO] (root) - Series attribute Modality value: CT\n", - "[2024-04-10 16:41:09,750] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 16:41:09,751] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", - "[2024-04-10 16:41:09,753] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", - "[2024-04-10 16:41:09,754] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 16:41:09,755] [INFO] (root) - On attribute: 'ImageType' to match value: ['PRIMARY', 'ORIGINAL']\n", - "[2024-04-10 16:41:09,756] [INFO] (root) - Series attribute ImageType value: None\n", - "[2024-04-10 16:41:09,757] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 16:41:10,007] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Converted Image object metadata:\n", - "[2024-04-10 16:41:10,009] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239, type \n", - "[2024-04-10 16:41:10,009] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesDate: 20090831, type \n", - "[2024-04-10 16:41:10,010] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesTime: 101721.452, type \n", - "[2024-04-10 16:41:10,011] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Modality: CT, type \n", - "[2024-04-10 16:41:10,012] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesDescription: ABD/PANC 3.0 B31f, type \n", - "[2024-04-10 16:41:10,012] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - PatientPosition: HFS, type \n", - "[2024-04-10 16:41:10,013] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesNumber: 8, type \n", - "[2024-04-10 16:41:10,014] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - row_pixel_spacing: 0.7890625, type \n", - "[2024-04-10 16:41:10,015] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - col_pixel_spacing: 0.7890625, type \n", - "[2024-04-10 16:41:10,015] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - depth_pixel_spacing: 1.5, type \n", - "[2024-04-10 16:41:10,016] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - row_direction_cosine: [1.0, 0.0, 0.0], type \n", - "[2024-04-10 16:41:10,017] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - col_direction_cosine: [0.0, 1.0, 0.0], type \n", - "[2024-04-10 16:41:10,018] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - depth_direction_cosine: [0.0, 0.0, 1.0], type \n", - "[2024-04-10 16:41:10,019] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - dicom_affine_transform: [[ 0.7890625 0. 0. -197.60547 ]\n", + "[2024-04-22 15:22:16,746] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 15:22:16,747] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", + "[2024-04-22 15:22:16,748] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", + "[2024-04-22 15:22:16,749] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 15:22:16,749] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", + "[2024-04-22 15:22:16,751] [INFO] (root) - Series attribute Modality value: CT\n", + "[2024-04-22 15:22:16,751] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 15:22:16,752] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", + "[2024-04-22 15:22:16,753] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", + "[2024-04-22 15:22:16,754] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 15:22:16,755] [INFO] (root) - On attribute: 'ImageType' to match value: ['PRIMARY', 'ORIGINAL']\n", + "[2024-04-22 15:22:16,756] [INFO] (root) - Series attribute ImageType value: None\n", + "[2024-04-22 15:22:16,757] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 15:22:17,001] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Converted Image object metadata:\n", + "[2024-04-22 15:22:17,003] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239, type \n", + "[2024-04-22 15:22:17,003] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesDate: 20090831, type \n", + "[2024-04-22 15:22:17,004] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesTime: 101721.452, type \n", + "[2024-04-22 15:22:17,005] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Modality: CT, type \n", + "[2024-04-22 15:22:17,006] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesDescription: ABD/PANC 3.0 B31f, type \n", + "[2024-04-22 15:22:17,007] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - PatientPosition: HFS, type \n", + "[2024-04-22 15:22:17,008] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesNumber: 8, type \n", + "[2024-04-22 15:22:17,009] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - row_pixel_spacing: 0.7890625, type \n", + "[2024-04-22 15:22:17,010] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - col_pixel_spacing: 0.7890625, type \n", + "[2024-04-22 15:22:17,011] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - depth_pixel_spacing: 1.5, type \n", + "[2024-04-22 15:22:17,011] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - row_direction_cosine: [1.0, 0.0, 0.0], type \n", + "[2024-04-22 15:22:17,012] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - col_direction_cosine: [0.0, 1.0, 0.0], type \n", + "[2024-04-22 15:22:17,013] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - depth_direction_cosine: [0.0, 0.0, 1.0], type \n", + "[2024-04-22 15:22:17,014] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - dicom_affine_transform: [[ 0.7890625 0. 0. -197.60547 ]\n", " [ 0. 0.7890625 0. -398.60547 ]\n", " [ 0. 0. 1.5 -383. ]\n", " [ 0. 0. 0. 1. ]], type \n", - "[2024-04-10 16:41:10,020] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - nifti_affine_transform: [[ -0.7890625 -0. -0. 197.60547 ]\n", + "[2024-04-22 15:22:17,016] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - nifti_affine_transform: [[ -0.7890625 -0. -0. 197.60547 ]\n", " [ -0. -0.7890625 -0. 398.60547 ]\n", " [ 0. 0. 1.5 -383. ]\n", " [ 0. 0. 0. 1. ]], type \n", - "[2024-04-10 16:41:10,021] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291, type \n", - "[2024-04-10 16:41:10,022] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyID: , type \n", - "[2024-04-10 16:41:10,023] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyDate: 20090831, type \n", - "[2024-04-10 16:41:10,025] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyTime: 095948.599, type \n", - "[2024-04-10 16:41:10,026] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyDescription: CT ABDOMEN W IV CONTRAST, type \n", - "[2024-04-10 16:41:10,027] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - AccessionNumber: 5471978513296937, type \n", - "[2024-04-10 16:41:10,029] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - selection_name: CT Series, type \n" + "[2024-04-22 15:22:17,017] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291, type \n", + "[2024-04-22 15:22:17,017] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyID: , type \n", + "[2024-04-22 15:22:17,018] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyDate: 20090831, type \n", + "[2024-04-22 15:22:17,019] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyTime: 095948.599, type \n", + "[2024-04-22 15:22:17,020] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyDescription: CT ABDOMEN W IV CONTRAST, type \n", + "[2024-04-22 15:22:17,021] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - AccessionNumber: 5471978513296937, type \n", + "[2024-04-22 15:22:17,021] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - selection_name: CT Series, type \n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-04-10 16:41:10,797 INFO image_writer.py:197 - writing: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output/saved_images_folder/1.3.6.1.4.1.14519.5.2.1.7085.2626/1.3.6.1.4.1.14519.5.2.1.7085.2626.nii\n", - "2024-04-10 16:41:17,104 INFO image_writer.py:197 - writing: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output/saved_images_folder/1.3.6.1.4.1.14519.5.2.1.7085.2626/1.3.6.1.4.1.14519.5.2.1.7085.2626_seg.nii\n" + "2024-04-22 15:22:17,827 INFO image_writer.py:197 - writing: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output/saved_images_folder/1.3.6.1.4.1.14519.5.2.1.7085.2626/1.3.6.1.4.1.14519.5.2.1.7085.2626.nii\n", + "2024-04-22 15:22:24,399 INFO image_writer.py:197 - writing: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output/saved_images_folder/1.3.6.1.4.1.14519.5.2.1.7085.2626/1.3.6.1.4.1.14519.5.2.1.7085.2626_seg.nii\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ - "[2024-04-10 16:41:19,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Output Seg image numpy array shaped: (204, 512, 512)\n", - "[2024-04-10 16:41:19,067] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Output Seg image pixel max value: 1\n", + "[2024-04-22 15:22:26,202] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Output Seg image numpy array shaped: (204, 512, 512)\n", + "[2024-04-22 15:22:26,208] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Output Seg image pixel max value: 1\n", "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/highdicom/valuerep.py:54: UserWarning: The string \"C3N-00198\" is unlikely to represent the intended person name since it contains only a single component. Construct a person name according to the format in described in https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html#sect_6.2.1.2, or, in pydicom 2.2.0 or later, use the pydicom.valuerep.PersonName.from_named_components() method to construct the person name correctly. If a single-component name is really intended, add a trailing caret character to disambiguate the name.\n", " warnings.warn(\n", - "[2024-04-10 16:41:20,496] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 16:41:20,497] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", - "[2024-04-10 16:41:20,498] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 16:41:20,499] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", - "[2024-04-10 16:41:20,500] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", - "[2024-04-10 16:41:20,501] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 16:41:20,502] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", - "[2024-04-10 16:41:20,503] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", - "[2024-04-10 16:41:20,503] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[2024-04-10 16:41:20,610] [INFO] (__main__.AISpleenSegApp) - End run\n" + "[2024-04-22 15:22:27,503] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:22:27,504] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", + "[2024-04-22 15:22:27,505] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:22:27,506] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", + "[2024-04-22 15:22:27,508] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", + "[2024-04-22 15:22:27,509] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:22:27,510] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", + "[2024-04-22 15:22:27,511] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", + "[2024-04-22 15:22:27,512] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", + "[info] [gxf_executor.cpp:1879] Deactivating Graph...\n", + "[info] [gxf_executor.cpp:1887] Graph execution finished.\n", + "[2024-04-22 15:22:27,606] [INFO] (__main__.AISpleenSegApp) - End run\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[0m2024-04-22 15:22:27.604 INFO gxf/std/greedy_scheduler.cpp@372: Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\u001b[0m\n", + "\u001b[0m2024-04-22 15:22:27.604 INFO gxf/std/greedy_scheduler.cpp@401: Scheduler finished.\u001b[0m\n" ] } ], @@ -1274,84 +1287,82 @@ "name": "stdout", "output_type": "stream", "text": [ - "[2024-04-10 16:41:25,305] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['my_app'])\n", - "[2024-04-10 16:41:25,472] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=models, workdir=)\n", - "[2024-04-10 16:41:25,472] [INFO] (app.AISpleenSegApp) - App input and output path: dcm, output\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:211] Creating context\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1864] Activating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1894] Running Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:190] Scheduling 6 entities\n", - "[2024-04-10 16:41:25,505] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", - "[2024-04-10 16:41:25,850] [INFO] (root) - Finding series for Selection named: CT Series\n", - "[2024-04-10 16:41:25,850] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", + "[2024-04-22 15:22:32,985] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['my_app'])\n", + "[2024-04-22 15:22:32,987] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=models, workdir=)\n", + "[2024-04-22 15:22:32,987] [INFO] (app.AISpleenSegApp) - App input and output path: dcm, output\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:247] Creating context\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1672] Loading extensions from configs...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1842] Activating Graph...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1874] Running Graph...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1876] Waiting for completion...\n", + "\u001b[0m2024-04-22 15:22:33.018 INFO gxf/std/greedy_scheduler.cpp@191: Scheduling 6 entities\u001b[0m\n", + "[2024-04-22 15:22:33,019] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", + "[2024-04-22 15:22:33,568] [INFO] (root) - Finding series for Selection named: CT Series\n", + "[2024-04-22 15:22:33,568] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", " # of series: 1\n", - "[2024-04-10 16:41:25,850] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 16:41:25,850] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", - "[2024-04-10 16:41:25,850] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", - "[2024-04-10 16:41:25,850] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 16:41:25,851] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", - "[2024-04-10 16:41:25,851] [INFO] (root) - Series attribute Modality value: CT\n", - "[2024-04-10 16:41:25,851] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 16:41:25,851] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", - "[2024-04-10 16:41:25,851] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", - "[2024-04-10 16:41:25,851] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 16:41:25,851] [INFO] (root) - On attribute: 'ImageType' to match value: ['PRIMARY', 'ORIGINAL']\n", - "[2024-04-10 16:41:25,851] [INFO] (root) - Series attribute ImageType value: None\n", - "[2024-04-10 16:41:25,851] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Converted Image object metadata:\n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239, type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesDate: 20090831, type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesTime: 101721.452, type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Modality: CT, type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesDescription: ABD/PANC 3.0 B31f, type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - PatientPosition: HFS, type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesNumber: 8, type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - row_pixel_spacing: 0.7890625, type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - col_pixel_spacing: 0.7890625, type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - depth_pixel_spacing: 1.5, type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - row_direction_cosine: [1.0, 0.0, 0.0], type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - col_direction_cosine: [0.0, 1.0, 0.0], type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - depth_direction_cosine: [0.0, 0.0, 1.0], type \n", - "[2024-04-10 16:41:26,402] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - dicom_affine_transform: [[ 0.7890625 0. 0. -197.60547 ]\n", + "[2024-04-22 15:22:33,568] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 15:22:33,568] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", + "[2024-04-22 15:22:33,568] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", + "[2024-04-22 15:22:33,568] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 15:22:33,568] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", + "[2024-04-22 15:22:33,568] [INFO] (root) - Series attribute Modality value: CT\n", + "[2024-04-22 15:22:33,568] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 15:22:33,569] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", + "[2024-04-22 15:22:33,569] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", + "[2024-04-22 15:22:33,569] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 15:22:33,569] [INFO] (root) - On attribute: 'ImageType' to match value: ['PRIMARY', 'ORIGINAL']\n", + "[2024-04-22 15:22:33,569] [INFO] (root) - Series attribute ImageType value: None\n", + "[2024-04-22 15:22:33,569] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Converted Image object metadata:\n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239, type \n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesDate: 20090831, type \n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesTime: 101721.452, type \n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Modality: CT, type \n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesDescription: ABD/PANC 3.0 B31f, type \n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - PatientPosition: HFS, type \n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesNumber: 8, type \n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - row_pixel_spacing: 0.7890625, type \n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - col_pixel_spacing: 0.7890625, type \n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - depth_pixel_spacing: 1.5, type \n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - row_direction_cosine: [1.0, 0.0, 0.0], type \n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - col_direction_cosine: [0.0, 1.0, 0.0], type \n", + "[2024-04-22 15:22:33,849] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - depth_direction_cosine: [0.0, 0.0, 1.0], type \n", + "[2024-04-22 15:22:33,850] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - dicom_affine_transform: [[ 0.7890625 0. 0. -197.60547 ]\n", " [ 0. 0.7890625 0. -398.60547 ]\n", " [ 0. 0. 1.5 -383. ]\n", " [ 0. 0. 0. 1. ]], type \n", - "[2024-04-10 16:41:26,403] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - nifti_affine_transform: [[ -0.7890625 -0. -0. 197.60547 ]\n", + "[2024-04-22 15:22:33,850] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - nifti_affine_transform: [[ -0.7890625 -0. -0. 197.60547 ]\n", " [ -0. -0.7890625 -0. 398.60547 ]\n", " [ 0. 0. 1.5 -383. ]\n", " [ 0. 0. 0. 1. ]], type \n", - "[2024-04-10 16:41:26,403] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291, type \n", - "[2024-04-10 16:41:26,403] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyID: , type \n", - "[2024-04-10 16:41:26,403] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyDate: 20090831, type \n", - "[2024-04-10 16:41:26,403] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyTime: 095948.599, type \n", - "[2024-04-10 16:41:26,403] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyDescription: CT ABDOMEN W IV CONTRAST, type \n", - "[2024-04-10 16:41:26,403] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - AccessionNumber: 5471978513296937, type \n", - "[2024-04-10 16:41:26,403] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - selection_name: CT Series, type \n", - "2024-04-10 16:41:27,452 INFO image_writer.py:197 - writing: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output/saved_images_folder/1.3.6.1.4.1.14519.5.2.1.7085.2626/1.3.6.1.4.1.14519.5.2.1.7085.2626.nii\n", - "2024-04-10 16:41:34,092 INFO image_writer.py:197 - writing: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output/saved_images_folder/1.3.6.1.4.1.14519.5.2.1.7085.2626/1.3.6.1.4.1.14519.5.2.1.7085.2626_seg.nii\n", - "[2024-04-10 16:41:35,714] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Output Seg image numpy array shaped: (204, 512, 512)\n", - "[2024-04-10 16:41:35,720] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Output Seg image pixel max value: 1\n", + "[2024-04-22 15:22:33,850] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291, type \n", + "[2024-04-22 15:22:33,850] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyID: , type \n", + "[2024-04-22 15:22:33,850] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyDate: 20090831, type \n", + "[2024-04-22 15:22:33,850] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyTime: 095948.599, type \n", + "[2024-04-22 15:22:33,850] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyDescription: CT ABDOMEN W IV CONTRAST, type \n", + "[2024-04-22 15:22:33,850] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - AccessionNumber: 5471978513296937, type \n", + "[2024-04-22 15:22:33,850] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - selection_name: CT Series, type \n", + "2024-04-22 15:22:34,669 INFO image_writer.py:197 - writing: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output/saved_images_folder/1.3.6.1.4.1.14519.5.2.1.7085.2626/1.3.6.1.4.1.14519.5.2.1.7085.2626.nii\n", + "2024-04-22 15:22:40,937 INFO image_writer.py:197 - writing: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output/saved_images_folder/1.3.6.1.4.1.14519.5.2.1.7085.2626/1.3.6.1.4.1.14519.5.2.1.7085.2626_seg.nii\n", + "[2024-04-22 15:22:42,734] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Output Seg image numpy array shaped: (204, 512, 512)\n", + "[2024-04-22 15:22:42,740] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Output Seg image pixel max value: 1\n", "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/highdicom/valuerep.py:54: UserWarning: The string \"C3N-00198\" is unlikely to represent the intended person name since it contains only a single component. Construct a person name according to the format in described in https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html#sect_6.2.1.2, or, in pydicom 2.2.0 or later, use the pydicom.valuerep.PersonName.from_named_components() method to construct the person name correctly. If a single-component name is really intended, add a trailing caret character to disambiguate the name.\n", " warnings.warn(\n", - "[2024-04-10 16:41:37,387] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 16:41:37,387] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", - "[2024-04-10 16:41:37,387] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 16:41:37,387] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", - "[2024-04-10 16:41:37,387] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", - "[2024-04-10 16:41:37,388] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 16:41:37,388] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", - "[2024-04-10 16:41:37,388] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", - "[2024-04-10 16:41:37,388] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[2024-04-10 16:41:37,477] [INFO] (app.AISpleenSegApp) - End run\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:230] Destroying context\n" + "[2024-04-22 15:22:43,984] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:22:43,984] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", + "[2024-04-22 15:22:43,985] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:22:43,985] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", + "[2024-04-22 15:22:43,985] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", + "[2024-04-22 15:22:43,986] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:22:43,986] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", + "[2024-04-22 15:22:43,986] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", + "[2024-04-22 15:22:43,986] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", + "\u001b[0m2024-04-22 15:22:44.089 INFO gxf/std/greedy_scheduler.cpp@372: Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\u001b[0m\n", + "\u001b[0m2024-04-22 15:22:44.090 INFO gxf/std/greedy_scheduler.cpp@401: Scheduler finished.\u001b[0m\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1879] Deactivating Graph...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1887] Graph execution finished.\n", + "[2024-04-22 15:22:44,091] [INFO] (app.AISpleenSegApp) - End run\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:275] Destroying context\n" ] } ], @@ -1370,7 +1381,7 @@ "output_type": "stream", "text": [ "output:\n", - "1.2.826.0.1.3680043.10.511.3.12733408477402210746640758069824301.dcm\n", + "1.2.826.0.1.3680043.10.511.3.63733460941149225858587872952895380.dcm\n", "saved_images_folder\n", "\n", "output/saved_images_folder:\n", @@ -1477,14 +1488,16 @@ "name": "stdout", "output_type": "stream", "text": [ - "[2024-04-10 16:41:40,386] [INFO] (packager.parameters) - Application: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/my_app\n", - "[2024-04-10 16:41:40,386] [INFO] (packager.parameters) - Detected application type: Python Module\n", - "[2024-04-10 16:41:40,386] [INFO] (packager) - Scanning for models in /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models...\n", - "[2024-04-10 16:41:40,386] [DEBUG] (packager) - Model model=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models/model added.\n", - "[2024-04-10 16:41:40,386] [INFO] (packager) - Reading application configuration from /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/my_app/app.yaml...\n", - "[2024-04-10 16:41:40,387] [INFO] (packager) - Generating app.json...\n", - "[2024-04-10 16:41:40,387] [INFO] (packager) - Generating pkg.json...\n", - "[2024-04-10 16:41:40,394] [DEBUG] (common) - \n", + "[2024-04-22 15:22:46,307] [INFO] (common) - Downloading CLI manifest file...\n", + "[2024-04-22 15:22:46,744] [DEBUG] (common) - Validating CLI manifest file...\n", + "[2024-04-22 15:22:46,747] [INFO] (packager.parameters) - Application: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/my_app\n", + "[2024-04-22 15:22:46,747] [INFO] (packager.parameters) - Detected application type: Python Module\n", + "[2024-04-22 15:22:46,748] [INFO] (packager) - Scanning for models in /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models...\n", + "[2024-04-22 15:22:46,748] [DEBUG] (packager) - Model model=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models/model added.\n", + "[2024-04-22 15:22:46,748] [INFO] (packager) - Reading application configuration from /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/my_app/app.yaml...\n", + "[2024-04-22 15:22:46,752] [INFO] (packager) - Generating app.json...\n", + "[2024-04-22 15:22:46,752] [INFO] (packager) - Generating pkg.json...\n", + "[2024-04-22 15:22:46,765] [DEBUG] (common) - \n", "=============== Begin app.json ===============\n", "{\n", " \"apiVersion\": \"1.0.0\",\n", @@ -1519,7 +1532,7 @@ "}\n", "================ End app.json ================\n", " \n", - "[2024-04-10 16:41:40,394] [DEBUG] (common) - \n", + "[2024-04-22 15:22:46,765] [DEBUG] (common) - \n", "=============== Begin pkg.json ===============\n", "{\n", " \"apiVersion\": \"1.0.0\",\n", @@ -1539,11 +1552,11 @@ "}\n", "================ End pkg.json ================\n", " \n", - "[2024-04-10 16:41:40,461] [DEBUG] (packager.builder) - \n", + "[2024-04-22 15:22:46,803] [DEBUG] (packager.builder) - \n", "========== Begin Dockerfile ==========\n", "\n", "\n", - "FROM nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", + "FROM nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", "\n", "ENV DEBIAN_FRONTEND=noninteractive\n", "ENV TERM=xterm-256color\n", @@ -1559,11 +1572,11 @@ " && mkdir -p /var/holoscan/input \\\n", " && mkdir -p /var/holoscan/output\n", "\n", - "LABEL base=\"nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\"\n", + "LABEL base=\"nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\"\n", "LABEL tag=\"my_app:1.0\"\n", "LABEL org.opencontainers.image.title=\"MONAI Deploy App Package - MONAI Bundle AI App\"\n", "LABEL org.opencontainers.image.version=\"1.0\"\n", - "LABEL org.nvidia.holoscan=\"1.0.3\"\n", + "LABEL org.nvidia.holoscan=\"2.0.0\"\n", "LABEL org.monai.deploy.app-sdk=\"0.5.1\"\n", "\n", "\n", @@ -1589,7 +1602,6 @@ "ENV PYTHONPATH=\"/opt/holoscan/app:$PYTHONPATH\"\n", "\n", "\n", - "\n", "RUN groupadd -f -g $GID $UNAME\n", "RUN useradd -rm -d /home/$UNAME -s /bin/bash -g $GID -G sudo -u $UID $UNAME\n", "RUN chown -R holoscan /var/holoscan \n", @@ -1615,14 +1627,12 @@ "RUN pip install --upgrade pip\n", "RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", "\n", - "# Install Holoscan from PyPI only when sdk_type is Holoscan. \n", - "# For MONAI Deploy, the APP SDK will install it unless user specifies the Holoscan SDK file.\n", + " \n", + "# MONAI Deploy\n", "\n", "# Copy user-specified MONAI Deploy SDK file\n", - "COPY ./monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "\n", - "\n", + "COPY ./monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz /tmp/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", + "RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", "\n", "\n", "COPY ./models /opt/holoscan/models\n", @@ -1636,31 +1646,31 @@ "ENTRYPOINT [\"/var/holoscan/tools\"]\n", "=========== End Dockerfile ===========\n", "\n", - "[2024-04-10 16:41:40,461] [INFO] (packager.builder) - \n", + "[2024-04-22 15:22:46,803] [INFO] (packager.builder) - \n", "===============================================================================\n", "Building image for: x64-workstation\n", " Architecture: linux/amd64\n", - " Base Image: nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", + " Base Image: nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", " Build Image: N/A\n", " Cache: Enabled\n", " Configuration: dgpu\n", " Holoscan SDK Package: pypi.org\n", - " MONAI Deploy App SDK Package: /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", + " MONAI Deploy App SDK Package: /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", " gRPC Health Probe: N/A\n", - " SDK Version: 1.0.3\n", + " SDK Version: 2.0.0\n", " SDK: monai-deploy\n", " Tag: my_app-x64-workstation-dgpu-linux-amd64:1.0\n", " \n", - "[2024-04-10 16:41:41,020] [INFO] (common) - Using existing Docker BuildKit builder `holoscan_app_builder`\n", - "[2024-04-10 16:41:41,021] [DEBUG] (packager.builder) - Building Holoscan Application Package: tag=my_app-x64-workstation-dgpu-linux-amd64:1.0\n", + "[2024-04-22 15:22:47,122] [INFO] (common) - Using existing Docker BuildKit builder `holoscan_app_builder`\n", + "[2024-04-22 15:22:47,122] [DEBUG] (packager.builder) - Building Holoscan Application Package: tag=my_app-x64-workstation-dgpu-linux-amd64:1.0\n", "#0 building with \"holoscan_app_builder\" instance using docker-container driver\n", "\n", "#1 [internal] load build definition from Dockerfile\n", - "#1 transferring dockerfile: 2.80kB done\n", + "#1 transferring dockerfile: 2.63kB done\n", "#1 DONE 0.1s\n", "\n", - "#2 [internal] load metadata for nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#2 DONE 0.1s\n", + "#2 [internal] load metadata for nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", + "#2 DONE 0.4s\n", "\n", "#3 [internal] load .dockerignore\n", "#3 transferring context: 1.79kB done\n", @@ -1669,177 +1679,214 @@ "#4 [internal] load build context\n", "#4 DONE 0.0s\n", "\n", - "#5 importing cache manifest from local:6394528277147153176\n", + "#5 importing cache manifest from local:533907015160790994\n", "#5 inferred cache manifest type: application/vnd.oci.image.index.v1+json done\n", "#5 DONE 0.0s\n", "\n", - "#6 [ 1/21] FROM nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu@sha256:50343c616bf910e2a7651abb59db7833933e82cce64c3c4885f938d7e4af6155\n", - "#6 resolve nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu@sha256:50343c616bf910e2a7651abb59db7833933e82cce64c3c4885f938d7e4af6155 0.0s done\n", + "#6 [ 1/21] FROM nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu@sha256:20adbccd2c7b12dfb1798f6953f071631c3b85cd337858a7506f8e420add6d4a\n", + "#6 resolve nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu@sha256:20adbccd2c7b12dfb1798f6953f071631c3b85cd337858a7506f8e420add6d4a 0.1s done\n", "#6 DONE 0.1s\n", "\n", - "#7 importing cache manifest from nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", + "#7 importing cache manifest from nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", "#7 inferred cache manifest type: application/vnd.docker.distribution.manifest.list.v2+json done\n", - "#7 DONE 0.9s\n", + "#7 DONE 0.6s\n", "\n", "#4 [internal] load build context\n", - "#4 transferring context: 19.56MB 0.1s done\n", + "#4 transferring context: 19.54MB 0.1s done\n", "#4 DONE 0.2s\n", "\n", - "#8 [ 3/21] RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*\n", + "#8 [ 6/21] RUN chown -R holoscan /var/holoscan\n", "#8 CACHED\n", "\n", - "#9 [14/21] RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", + "#9 [10/21] COPY ./tools /var/holoscan/tools\n", "#9 CACHED\n", "\n", - "#10 [ 4/21] RUN groupadd -f -g 1000 holoscan\n", + "#10 [19/21] COPY ./app.config /var/holoscan/app.yaml\n", "#10 CACHED\n", "\n", "#11 [11/21] RUN chmod +x /var/holoscan/tools\n", "#11 CACHED\n", "\n", - "#12 [ 2/21] RUN mkdir -p /etc/holoscan/ && mkdir -p /opt/holoscan/ && mkdir -p /var/holoscan && mkdir -p /opt/holoscan/app && mkdir -p /var/holoscan/input && mkdir -p /var/holoscan/output\n", + "#12 [14/21] RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", "#12 CACHED\n", "\n", - "#13 [ 9/21] WORKDIR /var/holoscan\n", + "#13 [ 7/21] RUN chown -R holoscan /var/holoscan/input\n", "#13 CACHED\n", "\n", - "#14 [ 6/21] RUN chown -R holoscan /var/holoscan\n", + "#14 [13/21] RUN pip install --upgrade pip\n", "#14 CACHED\n", "\n", - "#15 [16/21] RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", + "#15 [ 5/21] RUN useradd -rm -d /home/holoscan -s /bin/bash -g 1000 -G sudo -u 1000 holoscan\n", "#15 CACHED\n", "\n", - "#16 [ 8/21] RUN chown -R holoscan /var/holoscan/output\n", + "#16 [ 2/21] RUN mkdir -p /etc/holoscan/ && mkdir -p /opt/holoscan/ && mkdir -p /var/holoscan && mkdir -p /opt/holoscan/app && mkdir -p /var/holoscan/input && mkdir -p /var/holoscan/output\n", "#16 CACHED\n", "\n", - "#17 [18/21] COPY ./map/app.json /etc/holoscan/app.json\n", + "#17 [ 4/21] RUN groupadd -f -g 1000 holoscan\n", "#17 CACHED\n", "\n", - "#18 [ 5/21] RUN useradd -rm -d /home/holoscan -s /bin/bash -g 1000 -G sudo -u 1000 holoscan\n", + "#18 [17/21] COPY ./models /opt/holoscan/models\n", "#18 CACHED\n", "\n", - "#19 [ 7/21] RUN chown -R holoscan /var/holoscan/input\n", + "#19 [15/21] COPY ./monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz /tmp/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", "#19 CACHED\n", "\n", - "#20 [12/21] COPY ./pip/requirements.txt /tmp/requirements.txt\n", + "#20 [ 8/21] RUN chown -R holoscan /var/holoscan/output\n", "#20 CACHED\n", "\n", - "#21 [17/21] COPY ./models /opt/holoscan/models\n", + "#21 [12/21] COPY ./pip/requirements.txt /tmp/requirements.txt\n", "#21 CACHED\n", "\n", - "#22 [10/21] COPY ./tools /var/holoscan/tools\n", + "#22 [16/21] RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", "#22 CACHED\n", "\n", - "#23 [15/21] COPY ./monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", + "#23 [ 9/21] WORKDIR /var/holoscan\n", "#23 CACHED\n", "\n", - "#24 [19/21] COPY ./app.config /var/holoscan/app.yaml\n", + "#24 [18/21] COPY ./map/app.json /etc/holoscan/app.json\n", "#24 CACHED\n", "\n", - "#25 [13/21] RUN pip install --upgrade pip\n", + "#25 [ 3/21] RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*\n", "#25 CACHED\n", "\n", "#26 [20/21] COPY ./map/pkg.json /etc/holoscan/pkg.json\n", "#26 CACHED\n", "\n", "#27 [21/21] COPY ./app /opt/holoscan/app\n", - "#27 DONE 0.3s\n", + "#27 DONE 1.3s\n", "\n", "#28 exporting to docker image format\n", "#28 exporting layers\n", "#28 exporting layers 0.2s done\n", - "#28 exporting manifest sha256:814514f05787bbad414758721a0e6e6c3bc4c8e15be135868bd5d22125ba1323 0.0s done\n", - "#28 exporting config sha256:5effa5125f3b256ed2e1063cc763040b2eac0f3a49c281b3fecbe3ebbddedce9 0.0s done\n", + "#28 exporting manifest sha256:8e5dacf620de6846852d933385a5f14eb74ee0853a7198bcf756c2de9f612269 0.0s done\n", + "#28 exporting config sha256:09b95822d8b1217919d5261d5e599a91ee638c047cd1c62f760d09094b7bc856 0.0s done\n", "#28 sending tarball\n", "#28 ...\n", "\n", "#29 importing to docker\n", - "#29 loading layer bc0556e272e1 3.91kB / 3.91kB\n", - "#29 loading layer bc0556e272e1 3.91kB / 3.91kB 0.7s done\n", - "#29 DONE 0.7s\n", + "#29 loading layer 57a12d7f8667 253B / 253B\n", + "#29 loading layer 8dcccdc64d65 65.54kB / 5.86MB\n", + "#29 loading layer f06c13e07c07 557.06kB / 2.91GB\n", + "#29 loading layer f06c13e07c07 99.71MB / 2.91GB 6.3s\n", + "#29 loading layer f06c13e07c07 300.25MB / 2.91GB 10.3s\n", + "#29 loading layer f06c13e07c07 484.08MB / 2.91GB 14.4s\n", + "#29 loading layer f06c13e07c07 700.78MB / 2.91GB 20.6s\n", + "#29 loading layer f06c13e07c07 875.69MB / 2.91GB 24.8s\n", + "#29 loading layer f06c13e07c07 1.08GB / 2.91GB 28.9s\n", + "#29 loading layer f06c13e07c07 1.28GB / 2.91GB 32.9s\n", + "#29 loading layer f06c13e07c07 1.53GB / 2.91GB 39.1s\n", + "#29 loading layer f06c13e07c07 1.76GB / 2.91GB 43.2s\n", + "#29 loading layer f06c13e07c07 1.95GB / 2.91GB 47.3s\n", + "#29 loading layer f06c13e07c07 1.98GB / 2.91GB 54.2s\n", + "#29 loading layer f06c13e07c07 2.13GB / 2.91GB 60.4s\n", + "#29 loading layer f06c13e07c07 2.29GB / 2.91GB 64.4s\n", + "#29 loading layer f06c13e07c07 2.49GB / 2.91GB 68.6s\n", + "#29 loading layer f06c13e07c07 2.67GB / 2.91GB 74.7s\n", + "#29 loading layer f06c13e07c07 2.84GB / 2.91GB 81.0s\n", + "#29 loading layer d054c47a2401 32.77kB / 108.43kB\n", + "#29 loading layer 50075853a0dc 557.06kB / 68.61MB\n", + "#29 loading layer 598ebb84f98b 196.61kB / 17.81MB\n", + "#29 loading layer 2ed8ffec0799 489B / 489B\n", + "#29 loading layer 6f3fbbddd45f 313B / 313B\n", + "#29 loading layer bf63a07728f5 298B / 298B\n", + "#29 loading layer d421ed85e1f1 3.91kB / 3.91kB\n", + "#29 loading layer f06c13e07c07 2.84GB / 2.91GB 85.8s done\n", + "#29 loading layer 57a12d7f8667 253B / 253B 86.6s done\n", + "#29 loading layer 8dcccdc64d65 65.54kB / 5.86MB 86.6s done\n", + "#29 loading layer d054c47a2401 32.77kB / 108.43kB 2.9s done\n", + "#29 loading layer 50075853a0dc 557.06kB / 68.61MB 2.8s done\n", + "#29 loading layer 598ebb84f98b 196.61kB / 17.81MB 0.9s done\n", + "#29 loading layer 2ed8ffec0799 489B / 489B 0.6s done\n", + "#29 loading layer 6f3fbbddd45f 313B / 313B 0.6s done\n", + "#29 loading layer bf63a07728f5 298B / 298B 0.5s done\n", + "#29 loading layer d421ed85e1f1 3.91kB / 3.91kB 0.5s done\n", + "#29 DONE 86.6s\n", "\n", "#28 exporting to docker image format\n", - "#28 sending tarball 74.9s done\n", - "#28 DONE 75.2s\n", + "#28 sending tarball 155.9s done\n", + "#28 DONE 156.2s\n", "\n", "#30 exporting cache to client directory\n", "#30 preparing build cache for export\n", - "#30 writing layer sha256:00bb4c1319ba1a33ac3edcb3aa1240d8abcb8d0383c6267ed8028d3b6228a8a4\n", - "#30 writing layer sha256:00bb4c1319ba1a33ac3edcb3aa1240d8abcb8d0383c6267ed8028d3b6228a8a4 done\n", + "#30 writing layer sha256:014cff740c9ec6e9a30d0b859219a700ae880eb385d62095d348f5ea136d6015\n", "#30 writing layer sha256:014cff740c9ec6e9a30d0b859219a700ae880eb385d62095d348f5ea136d6015 done\n", + "#30 writing layer sha256:0487800842442c7a031a39e1e1857bc6dae4b4f7e5daf3d625f7a8a4833fb364 done\n", + "#30 writing layer sha256:06c6aee94862daf0603783db4e1de6f8524b30ac9fbe0374ab3f1d85b2f76f7f done\n", "#30 writing layer sha256:0a1756432df4a4350712d8ae5c003f1526bd2180800b3ae6301cfc9ccf370254 done\n", "#30 writing layer sha256:0a77dcbd0e648ddc4f8e5230ade8fdb781d99e24fa4f13ca96a360c7f7e6751f done\n", - "#30 writing layer sha256:0bf3a16e4f3f9ec99796b99e331a5c62472bc9377925e1fdc05f64709ed09895 done\n", "#30 writing layer sha256:0ec682bf99715a9f88631226f3749e2271b8b9f254528ef61f65ed829984821c done\n", - "#30 writing layer sha256:1133dfcee0e851b490d17b3567f50c4b25ba5750da02ba4b3f3630655d0b1a7b done\n", - "#30 writing layer sha256:1294b2835667d633f938174d9fecb18a60bbbebb6fb49788a1f939893a25d1af done\n", - "#30 writing layer sha256:16a03c6e0373b62f9713416da0229bb7ce2585183141081d3ea8427ad2e84408 done\n", - "#30 writing layer sha256:183aa7032b52e859f5de3dac98da7c8398ed5f8a984d74865561f126c0eecef2 done\n", + "#30 writing layer sha256:1c5c3aa9c2c8bfd1b9eb36248f5b6d67b3db73ef43440f9dd897615771974b39 done\n", + "#30 writing layer sha256:1f4a978bb76db2d138cfe7c7c9e76db4096247b06e34d349a2ed504bcd6a7ead done\n", + "#30 writing layer sha256:1f73278b7f17492ce1a8b28b139d54596961596d6790dc20046fa6d5909f3e9c done\n", "#30 writing layer sha256:20d331454f5fb557f2692dfbdbe092c718fd2cb55d5db9d661b62228dacca5c2 done\n", - "#30 writing layer sha256:2232aeb26b5b7ea57227e9a5b84da4fb229624d7bc976a5f7ce86d9c8653d277 done\n", "#30 writing layer sha256:238f69a43816e481f0295995fcf5fe74d59facf0f9f99734c8d0a2fb140630e0 done\n", + "#30 writing layer sha256:255cc51d2e47738a5db3059cbe9f403785cf9496c7df8a28a3c9f0c46a0b3b58 done\n", + "#30 writing layer sha256:289e320aad07867dc10b7e9ef7c094dd65483c41fb8c9ed81d2c1b4a9ca6404c 0.0s done\n", "#30 writing layer sha256:2ad84487f9d4d31cd1e0a92697a5447dd241935253d036b272ef16d31620c1e7 done\n", - "#30 writing layer sha256:2bb73464628bd4a136c4937f42d522c847bea86b2215ae734949e24c1caf450e done\n", + "#30 writing layer sha256:2f65750928993b5b31fe572d9e085b53853c5a344feeb0e8615898e285a8c256 done\n", + "#30 writing layer sha256:3777c6498f08c0400339c243e827d465075b7296eb2526e38d9b01c84f8764d8 done\n", "#30 writing layer sha256:3e3e04011ebdba380ab129f0ee390626cb2a600623815ca756340c18bedb9517 done\n", - "#30 writing layer sha256:3f0770bfaa7c2f6e0a801dbbdeb644aedfdfeccb547611d3bf9faef04222aeba 0.0s done\n", "#30 writing layer sha256:42619ce4a0c9e54cfd0ee41a8e5f27d58b3f51becabd1ac6de725fbe6c42b14a done\n", - "#30 writing layer sha256:43a21fb6c76bd2b3715cc09d9f8c3865dc61c51dd9e2327b429f5bec8fff85d1 done\n", - "#30 writing layer sha256:4482079b5d33963eb55191bf404b70095535d4a8e2b64dab7373500515f896b4 done\n", "#30 writing layer sha256:49bdc9abf8a437ccff67cc11490ba52c976577992909856a86be872a34d3b950 done\n", "#30 writing layer sha256:4b691ba9f48b41eaa0c754feba8366f1c030464fcbc55eeffa6c86675990933a done\n", "#30 writing layer sha256:4d04a8db404f16c2704fa10739cb6745a0187713a21a6ef0deb34b48629b54c1 done\n", + "#30 writing layer sha256:4f2cfb4282d3953c8f0168eac71e05fc792230ec78dd5716cff67595f67eddd2 done\n", "#30 writing layer sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 done\n", - "#30 writing layer sha256:5275a41be8f6691a490c0a15589e0910c73bf971169ad33a850ef570d37f63dd done\n", - "#30 writing layer sha256:52fbfeaf78318d843054ce2bfb5bfc9f71278939a815f6035ab5b14573ad017b done\n", - "#30 writing layer sha256:5792b18b6f162bae61ff5840cdb9e8567e6847a56ac886f940b47e7271c529a7 done\n", + "#30 writing layer sha256:542bc8c8d18fbc95e6794122c3593a4a693f8ab6dda4460406f4d7b1ae64a2bc done\n", "#30 writing layer sha256:57f244836ad318f9bbb3b29856ae1a5b31038bfbb9b43d2466d51c199eb55041 done\n", "#30 writing layer sha256:5b5b131e0f20db4cb8e568b623a95f8fc16ed1c6b322a9366df70b59a881f24f done\n", - "#30 writing layer sha256:5ccb787d371fd3697122101438ddd0f55b537832e9756d2c51ab1d8158710ac5 done\n", - "#30 writing layer sha256:5ea668ffc2fc267d241dbf17ca283bc879643a189be4f7e3d9034a82fc64a1ea done\n", + "#30 writing layer sha256:5b90d17b5048adcadefd0b1e4dba9a99247a8827a887e1ca042df375c85b518d done\n", "#30 writing layer sha256:62452179df7c18e292f141d4aec29e6aba9ff8270c893731169fc6f41dc07631 done\n", "#30 writing layer sha256:6630c387f5f2115bca2e646fd0c2f64e1f3d5431c2e050abe607633883eda230 done\n", - "#30 writing layer sha256:69af4b756272a77f683a8d118fd5ca55c03ad5f1bacc673b463f54d16b833da5 done\n", - "#30 writing layer sha256:6ae1f1fb92c0cb2b6e219f687b08c8e511501a7af696c943ca20d119eba7cd02 done\n", - "#30 writing layer sha256:6deb3d550b15a5e099c0b3d0cbc242e351722ca16c058d3a6c28ba1a02824d0f done\n", - "#30 writing layer sha256:6e80a527af94a864094c4f9116c2d29d3d7548ec8388579d9cf3f8a39a4b8178 done\n", - "#30 writing layer sha256:7386814d57100e2c7389fbf4e16f140f5c549d31434c62c3884a85a3ee5cd2a7 done\n", + "#30 writing layer sha256:6661e0146e77a8bcb03edbfda95bf7780c8bb4c4f98bc03a398c88f4b2403d12 done\n", + "#30 writing layer sha256:717ebf8c9c66ae393ad01e50dbac4413d7b026b9c97d4d348b22ad17052a1a35 done\n", + "#30 writing layer sha256:736212c90bde19af0e2c99890e2de47b829643f4d02b70481f9c7a4e94648bea done\n", + "#30 writing layer sha256:773c6815e5e7d6855a62f8c5e2fabce3d939ded36c5420f15b54dd7908cdbcfa done\n", "#30 writing layer sha256:7852b73ea931e3a8d3287ee7ef3cf4bad068e44f046583bfc2b81336fb299284 done\n", - "#30 writing layer sha256:7e73869c74822e4539e104a3d2aff853f4622cd0bb873576db1db53c9e91f621 done\n", - "#30 writing layer sha256:7eae142b38745fe88962874372374deb672998600264a17e638c010b79e6b535 done\n", - "#30 writing layer sha256:7f2e5ab2c599fa36698918d3e73c991d8616fff9037077cd230529e7cd1c5e0e done\n", + "#30 writing layer sha256:7f8ec130348bcdac81c295e37fe82b4a6e5e9a3ca980a6343809c561020d82d7 done\n", + "#30 writing layer sha256:80885adcad6b5d021bb9f68b6c952018085bb4ce72011bdc0cf7fe8178b5960b done\n", "#30 writing layer sha256:82a3436133b2b17bb407c7fe488932aa0ca55411f23ab55c34a6134b287c6a27 done\n", - "#30 writing layer sha256:90eae6faa5cc5ba62f12c25915cdfb1a7a51abfba0d05cb5818c3f908f4e345f\n", - "#30 preparing build cache for export 0.7s done\n", + "#30 writing layer sha256:8371d15eb4d69b1d98174dd098b8ddd5c4f19ec6f8d8b67e72dfa9891dc454b4 done\n", + "#30 writing layer sha256:85713f9b166b5add777c524ee807f6265d88b967cbeb9f961d6b09bf220c9a65 done\n", + "#30 writing layer sha256:8fe00505006a09966e763918147ef6ed55bb6695b26e4940c780ee430dc5da8e done\n", "#30 writing layer sha256:90eae6faa5cc5ba62f12c25915cdfb1a7a51abfba0d05cb5818c3f908f4e345f done\n", + "#30 writing layer sha256:9205d97d9d3e906698bcc6c42d45727c2fa6ec2622abf953d46778c3b8c78edc done\n", + "#30 writing layer sha256:993369dbcc13162a6654d2a3e990b8d8b5f37963564d25710e12764337261ae3 done\n", + "#30 writing layer sha256:99e42a4adebadb39bf55bf94bbd9fb8034230ee19b6b0a42e6ff96f2e7794f30 done\n", "#30 writing layer sha256:9ac855545fa90ed2bf3b388fdff9ef06ac9427b0c0fca07c9e59161983d8827e done\n", "#30 writing layer sha256:9d19ee268e0d7bcf6716e6658ee1b0384a71d6f2f9aa1ae2085610cf7c7b316f done\n", - "#30 writing layer sha256:a10c8d7d2714eabf661d1f43a1ccb87a51748cbb9094d5bc0b713e2481b5d329 done\n", + "#30 writing layer sha256:9d730bb76639093e18ba3214193d45c1ec00529e04e61185df901de270ec4cae done\n", + "#30 writing layer sha256:9fafbd4203c4fefe007a462e0d2cd4c1c7c41db2cfdc58d212279e1b9b4b230c done\n", + "#30 writing layer sha256:a1748eee9d376f97bd19225ba61dfada9986f063f4fc429e435f157abb629fc6\n", + "#30 preparing build cache for export 0.7s done\n", "#30 writing layer sha256:a1748eee9d376f97bd19225ba61dfada9986f063f4fc429e435f157abb629fc6 done\n", + "#30 writing layer sha256:a251fe5ae6c6d2d5034e4ca88b5dfe5d4827ff90b18e9b143a073232a32bb18d done\n", "#30 writing layer sha256:a68f4e0ec09ec3b78cb4cf8e4511d658e34e7b6f676d7806ad9703194ff17604 done\n", "#30 writing layer sha256:a8e4decc8f7289623b8fd7b9ba1ca555b5a755ebdbf81328d68209f148d9e602 done\n", "#30 writing layer sha256:afde1c269453ce68a0f2b54c1ba8c5ecddeb18a19e5618a4acdef1f0fe3921af done\n", + "#30 writing layer sha256:b406feb20a37b8c87ef4f5ef814039e3adc90473d50c366b7d9bb6ded4e94a2e done\n", "#30 writing layer sha256:b48a5fafcaba74eb5d7e7665601509e2889285b50a04b5b639a23f8adc818157 done\n", + "#30 writing layer sha256:ba6934334fdc7d0dbd60d7c66b145810eaf926b8a9fce464006dba78cd0d0894 done\n", "#30 writing layer sha256:ba9f7c75e4dd7942b944679995365aab766d3677da2e69e1d74472f471a484dd done\n", - "#30 writing layer sha256:bc42865e1c27a9b1bee751f3c99ad2c12a906d32aca396ace7a07231c9cafbd1 done\n", - "#30 writing layer sha256:bdfc73b2a0fa11b4086677e117a2f9feb6b4ffeccb23a3d58a30543339607e31 done\n", - "#30 writing layer sha256:c175bb235295e50de2961fa1e1a2235c57e6eba723a914287dfc26d3be0eac11 done\n", + "#30 writing layer sha256:bc2d533b8f32b8e5e96a78bd827ddc230d6c7d97e96eb98964c7c0cb45d3ebb4 done\n", + "#30 writing layer sha256:bdc13166216ae226fa6976f9ce91f4f259d43972f1e0a9b723e436919534b2f4 done\n", + "#30 writing layer sha256:c059e43d183e1717fd727434536efdaec04d400beb2431355ae202b2cb63def5 done\n", + "#30 writing layer sha256:c815f0be64eded102822d81e029bd23b0d8d9a0fbfeb492ec0b4b0bc4ee777bf done\n", + "#30 writing layer sha256:c97f7fb19e2e0b8ee3e1065f4dee369e35029cc620cafb7fe3dec2e9e06a3ae0 done\n", "#30 writing layer sha256:c98533d2908f36a5e9b52faae83809b3b6865b50e90e2817308acfc64cd3655f done\n", - "#30 writing layer sha256:cb6c95b33bc30dd285c5b3cf99a05281b8f12decae1c932ab64bd58f56354021 done\n", - "#30 writing layer sha256:d6b5d6e098aacb316146a428c6b5aef9692011c6dce0932e3bbfbf27a514b7ed done\n", "#30 writing layer sha256:d7da5c5e9a40c476c4b3188a845e3276dedfd752e015ea5113df5af64d4d43f7 done\n", - "#30 writing layer sha256:e4297ff4df6f7a8f25cb109e5b24483c314c2e72b8e824f9669173919fc159c9 done\n", - "#30 writing layer sha256:e4aedc686433c0ec5e676e6cc54a164345f7016aa0eb714f00c07e11664a1168 done\n", - "#30 writing layer sha256:e8640a108802cd7519cc53dceb74f7a5c94b562662f1c3c040c2aa6571acf0f3 done\n", + "#30 writing layer sha256:db20521a869adda8244cb64b783c65e1a911efaae0e73ae00e4a34ea6213d6ce done\n", + "#30 writing layer sha256:df4fd0ac710d7af949afbc6d25b5b4daf3f0596dabf3dec36fa7ca8fa6e1d049 done\n", + "#30 writing layer sha256:e291ddecfbe16b95ee9e90b5e90b1a3d0cfd53dc5e720d6b0f3d28e4a47cf5ac done\n", "#30 writing layer sha256:e8acb678f16bc0c369d5cf9c184f2d3a1c773986816526e5e3e9c0354f7e757f done\n", "#30 writing layer sha256:e9225f7ab6606813ec9acba98a064826ebfd6713a9645a58cd068538af1ecddb done\n", - "#30 writing layer sha256:f33546e75bf1a7d9dc9e21b9a2c54c9d09b24790ad7a4192a8509002ceb14688 done\n", + "#30 writing layer sha256:f249faf9663a96b0911a903f8803b11a553c59b698013fb8343492fefdaaea90 done\n", "#30 writing layer sha256:f608e2fbff86e98627b7e462057e7d2416522096d73fe4664b82fe6ce8a4047d done\n", - "#30 writing layer sha256:f7702077ced42a1ee35e7f5e45f72634328ff3bcfe3f57735ba80baa5ec45daf done\n", - "#30 writing layer sha256:fa66a49172c6e821a1bace57c007c01da10cbc61507c44f8cdfeed8c4e5febab done\n", - "#30 writing config sha256:374c8d5f4f72f0b0a709492f153a59ebd070e903971483f2cefb3e9e45bda48a 0.0s done\n", - "#30 writing cache manifest sha256:00a618573e1678dbe93ffce1675eee120201710fa121207b43875632f6799a58 0.0s done\n", + "#30 writing layer sha256:f65d191416580d6c38e3d95eee12377b75a4df548be1492618ce2a8c3c41b99e done\n", + "#30 writing config sha256:b7e4c820e9f3303e65738432cf4f61701081f527d302a72dc8b19f026f8a3a1a 0.0s done\n", + "#30 writing cache manifest sha256:679f174cda8e96e93c44ecb6ce555f2c4cfed8ff152f5c825d1707a838b19d40 0.0s done\n", "#30 DONE 0.7s\n", - "[2024-04-10 16:43:00,358] [INFO] (packager) - Build Summary:\n", + "[2024-04-22 15:25:28,489] [INFO] (packager) - Build Summary:\n", "\n", "Platform: x64-workstation/dgpu\n", " Status: Succeeded\n", @@ -1851,7 +1898,7 @@ "source": [ "tag_prefix = \"my_app\"\n", "\n", - "!monai-deploy package my_app -m {models_folder} -c my_app/app.yaml -t {tag_prefix}:1.0 --platform x64-workstation -l DEBUG" + "!monai-deploy package my_app -m {models_folder} -c my_app/app.yaml -t {tag_prefix}:1.0 --platform x64-workstation -l DEBUG --monai-deploy-sdk-file /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz" ] }, { @@ -1872,7 +1919,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "my_app-x64-workstation-dgpu-linux-amd64 1.0 5effa5125f3b About a minute ago 17.5GB\n" + "my_app-x64-workstation-dgpu-linux-amd64 1.0 09b95822d8b1 2 minutes ago 17.7GB\n" ] } ], @@ -1900,22 +1947,22 @@ "text": [ "output\n", "dcm\n", - "[2024-04-10 16:43:03,135] [INFO] (runner) - Checking dependencies...\n", - "[2024-04-10 16:43:03,135] [INFO] (runner) - --> Verifying if \"docker\" is installed...\n", + "[2024-04-22 15:25:30,271] [INFO] (runner) - Checking dependencies...\n", + "[2024-04-22 15:25:30,271] [INFO] (runner) - --> Verifying if \"docker\" is installed...\n", "\n", - "[2024-04-10 16:43:03,135] [INFO] (runner) - --> Verifying if \"docker-buildx\" is installed...\n", + "[2024-04-22 15:25:30,271] [INFO] (runner) - --> Verifying if \"docker-buildx\" is installed...\n", "\n", - "[2024-04-10 16:43:03,135] [INFO] (runner) - --> Verifying if \"my_app-x64-workstation-dgpu-linux-amd64:1.0\" is available...\n", + "[2024-04-22 15:25:30,271] [INFO] (runner) - --> Verifying if \"my_app-x64-workstation-dgpu-linux-amd64:1.0\" is available...\n", "\n", - "[2024-04-10 16:43:03,211] [INFO] (runner) - Reading HAP/MAP manifest...\n", - "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.56kB to /tmp/tmpbbeybrjp/app.json\n", - "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.05kB to /tmp/tmpbbeybrjp/pkg.json\n", - "[2024-04-10 16:43:03,567] [INFO] (runner) - --> Verifying if \"nvidia-ctk\" is installed...\n", + "[2024-04-22 15:25:30,337] [INFO] (runner) - Reading HAP/MAP manifest...\n", + "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.56kB to /tmp/tmpqjelbpxf/app.json\n", + "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.05kB to /tmp/tmpqjelbpxf/pkg.json\n", + "[2024-04-22 15:25:33,131] [INFO] (runner) - --> Verifying if \"nvidia-ctk\" is installed...\n", "\n", - "[2024-04-10 16:43:03,568] [INFO] (runner) - --> Verifying \"nvidia-ctk\" version...\n", + "[2024-04-22 15:25:33,131] [INFO] (runner) - --> Verifying \"nvidia-ctk\" version...\n", "\n", - "[2024-04-10 16:43:03,864] [INFO] (common) - Launching container (5135fc45ca94) using image 'my_app-x64-workstation-dgpu-linux-amd64:1.0'...\n", - " container name: optimistic_jang\n", + "[2024-04-22 15:25:33,453] [INFO] (common) - Launching container (48b13acf2bd6) using image 'my_app-x64-workstation-dgpu-linux-amd64:1.0'...\n", + " container name: bold_nobel\n", " host name: mingq-dt\n", " network: host\n", " user: 1000:1000\n", @@ -1925,95 +1972,93 @@ " shared memory size: 67108864\n", " devices: \n", " group_add: 44\n", - "2024-04-10 23:43:05 [INFO] Launching application python3 /opt/holoscan/app ...\n", + "2024-04-22 22:25:34 [INFO] Launching application python3 /opt/holoscan/app ...\n", "\n", - "[2024-04-10 23:43:09,781] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['/opt/holoscan/app'])\n", + "[2024-04-22 22:25:37,253] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['/opt/holoscan/app'])\n", "\n", - "[2024-04-10 23:43:09,784] [INFO] (root) - AppContext object: AppContext(input_path=/var/holoscan/input, output_path=/var/holoscan/output, model_path=/opt/holoscan/models, workdir=/var/holoscan)\n", + "[2024-04-22 22:25:37,256] [INFO] (root) - AppContext object: AppContext(input_path=/var/holoscan/input, output_path=/var/holoscan/output, model_path=/opt/holoscan/models, workdir=/var/holoscan)\n", "\n", - "[2024-04-10 23:43:09,784] [INFO] (app.AISpleenSegApp) - App input and output path: /var/holoscan/input, /var/holoscan/output\n", + "[2024-04-22 22:25:37,256] [INFO] (app.AISpleenSegApp) - App input and output path: /var/holoscan/input, /var/holoscan/output\n", "\n", "[info] [app_driver.cpp:1161] Launching the driver/health checking service\n", "\n", - "[info] [gxf_executor.cpp:211] Creating context\n", + "[info] [gxf_executor.cpp:247] Creating context\n", "\n", "[info] [server.cpp:87] Health checking server listening on 0.0.0.0:8777\n", "\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", + "[info] [gxf_executor.cpp:1672] Loading extensions from configs...\n", "\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", + "[info] [gxf_executor.cpp:1842] Activating Graph...\n", "\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", + "[info] [gxf_executor.cpp:1874] Running Graph...\n", "\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", + "[info] [gxf_executor.cpp:1876] Waiting for completion...\n", "\n", - "[info] [greedy_scheduler.cpp:190] Scheduling 6 entities\n", + "\u001b[0m2024-04-22 22:25:37.285 INFO gxf/std/greedy_scheduler.cpp@191: Scheduling 6 entities\u001b[0m\n", "\n", - "[2024-04-10 23:43:09,895] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", + "[2024-04-22 22:25:37,287] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", "\n", - "[2024-04-10 23:43:10,851] [INFO] (root) - Finding series for Selection named: CT Series\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - Finding series for Selection named: CT Series\n", "\n", - "[2024-04-10 23:43:10,851] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", "\n", " # of series: 1\n", "\n", - "[2024-04-10 23:43:10,851] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", "\n", - "[2024-04-10 23:43:10,851] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", "\n", - "[2024-04-10 23:43:10,852] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", "\n", - "[2024-04-10 23:43:10,852] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", "\n", - "[2024-04-10 23:43:10,852] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", "\n", - "[2024-04-10 23:43:10,852] [INFO] (root) - Series attribute Modality value: CT\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - Series attribute Modality value: CT\n", "\n", - "[2024-04-10 23:43:10,852] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", "\n", - "[2024-04-10 23:43:10,852] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", "\n", - "[2024-04-10 23:43:10,852] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", "\n", - "[2024-04-10 23:43:10,852] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", "\n", - "[2024-04-10 23:43:10,852] [INFO] (root) - On attribute: 'ImageType' to match value: ['PRIMARY', 'ORIGINAL']\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - On attribute: 'ImageType' to match value: ['PRIMARY', 'ORIGINAL']\n", "\n", - "[2024-04-10 23:43:10,852] [INFO] (root) - Series attribute ImageType value: None\n", + "[2024-04-22 22:25:37,751] [INFO] (root) - Series attribute ImageType value: None\n", "\n", - "[2024-04-10 23:43:10,852] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 22:25:37,752] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", "\n", - "[2024-04-10 23:43:11,263] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Converted Image object metadata:\n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Converted Image object metadata:\n", "\n", - "[2024-04-10 23:43:11,263] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239, type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239, type \n", "\n", - "[2024-04-10 23:43:11,263] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesDate: 20090831, type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesDate: 20090831, type \n", "\n", - "[2024-04-10 23:43:11,263] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesTime: 101721.452, type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesTime: 101721.452, type \n", "\n", - "[2024-04-10 23:43:11,263] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Modality: CT, type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Modality: CT, type \n", "\n", - "[2024-04-10 23:43:11,263] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesDescription: ABD/PANC 3.0 B31f, type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesDescription: ABD/PANC 3.0 B31f, type \n", "\n", - "[2024-04-10 23:43:11,263] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - PatientPosition: HFS, type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - PatientPosition: HFS, type \n", "\n", - "[2024-04-10 23:43:11,263] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesNumber: 8, type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - SeriesNumber: 8, type \n", "\n", - "[2024-04-10 23:43:11,263] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - row_pixel_spacing: 0.7890625, type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - row_pixel_spacing: 0.7890625, type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - col_pixel_spacing: 0.7890625, type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - col_pixel_spacing: 0.7890625, type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - depth_pixel_spacing: 1.5, type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - depth_pixel_spacing: 1.5, type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - row_direction_cosine: [1.0, 0.0, 0.0], type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - row_direction_cosine: [1.0, 0.0, 0.0], type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - col_direction_cosine: [0.0, 1.0, 0.0], type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - col_direction_cosine: [0.0, 1.0, 0.0], type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - depth_direction_cosine: [0.0, 0.0, 1.0], type \n", + "[2024-04-22 22:25:38,060] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - depth_direction_cosine: [0.0, 0.0, 1.0], type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - dicom_affine_transform: [[ 0.7890625 0. 0. -197.60547 ]\n", + "[2024-04-22 22:25:38,061] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - dicom_affine_transform: [[ 0.7890625 0. 0. -197.60547 ]\n", "\n", " [ 0. 0.7890625 0. -398.60547 ]\n", "\n", @@ -2021,7 +2066,7 @@ "\n", " [ 0. 0. 0. 1. ]], type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - nifti_affine_transform: [[ -0.7890625 -0. -0. 197.60547 ]\n", + "[2024-04-22 22:25:38,061] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - nifti_affine_transform: [[ -0.7890625 -0. -0. 197.60547 ]\n", "\n", " [ -0. -0.7890625 -0. 398.60547 ]\n", "\n", @@ -2029,65 +2074,63 @@ "\n", " [ 0. 0. 0. 1. ]], type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291, type \n", + "[2024-04-22 22:25:38,061] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyInstanceUID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291, type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyID: , type \n", + "[2024-04-22 22:25:38,061] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyID: , type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyDate: 20090831, type \n", + "[2024-04-22 22:25:38,061] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyDate: 20090831, type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyTime: 095948.599, type \n", + "[2024-04-22 22:25:38,061] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyTime: 095948.599, type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyDescription: CT ABDOMEN W IV CONTRAST, type \n", + "[2024-04-22 22:25:38,061] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - StudyDescription: CT ABDOMEN W IV CONTRAST, type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - AccessionNumber: 5471978513296937, type \n", + "[2024-04-22 22:25:38,061] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - AccessionNumber: 5471978513296937, type \n", "\n", - "[2024-04-10 23:43:11,264] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - selection_name: CT Series, type \n", + "[2024-04-22 22:25:38,061] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - selection_name: CT Series, type \n", "\n", - "2024-04-10 23:43:12,277 INFO image_writer.py:197 - writing: /var/holoscan/output/saved_images_folder/1.3.6.1.4.1.14519.5.2.1.7085.2626/1.3.6.1.4.1.14519.5.2.1.7085.2626.nii\n", + "2024-04-22 22:25:38,908 INFO image_writer.py:197 - writing: /var/holoscan/output/saved_images_folder/1.3.6.1.4.1.14519.5.2.1.7085.2626/1.3.6.1.4.1.14519.5.2.1.7085.2626.nii\n", "\n", - "2024-04-10 23:43:16,177 INFO image_writer.py:197 - writing: /var/holoscan/output/saved_images_folder/1.3.6.1.4.1.14519.5.2.1.7085.2626/1.3.6.1.4.1.14519.5.2.1.7085.2626_seg.nii\n", + "2024-04-22 22:25:42,457 INFO image_writer.py:197 - writing: /var/holoscan/output/saved_images_folder/1.3.6.1.4.1.14519.5.2.1.7085.2626/1.3.6.1.4.1.14519.5.2.1.7085.2626_seg.nii\n", "\n", - "[2024-04-10 23:43:17,870] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Output Seg image numpy array shaped: (204, 512, 512)\n", + "[2024-04-22 22:25:44,320] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Output Seg image numpy array shaped: (204, 512, 512)\n", "\n", - "[2024-04-10 23:43:17,876] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Output Seg image pixel max value: 1\n", + "[2024-04-22 22:25:44,325] [INFO] (monai.deploy.operators.monai_seg_inference_operator.MonaiSegInferenceOperator) - Output Seg image pixel max value: 1\n", "\n", "/home/holoscan/.local/lib/python3.10/site-packages/highdicom/valuerep.py:54: UserWarning: The string \"C3N-00198\" is unlikely to represent the intended person name since it contains only a single component. Construct a person name according to the format in described in https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html#sect_6.2.1.2, or, in pydicom 2.2.0 or later, use the pydicom.valuerep.PersonName.from_named_components() method to construct the person name correctly. If a single-component name is really intended, add a trailing caret character to disambiguate the name.\n", "\n", " warnings.warn(\n", "\n", - "[2024-04-10 23:43:19,386] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "\n", - "[2024-04-10 23:43:19,386] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", + "[2024-04-22 22:25:45,587] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", "\n", - "[2024-04-10 23:43:19,386] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 22:25:45,587] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", "\n", - "[2024-04-10 23:43:19,386] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", + "[2024-04-22 22:25:45,587] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", "\n", - "[2024-04-10 23:43:19,387] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", + "[2024-04-22 22:25:45,587] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", "\n", - "[2024-04-10 23:43:19,387] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 22:25:45,587] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", "\n", - "[2024-04-10 23:43:19,387] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", + "[2024-04-22 22:25:45,588] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", "\n", - "[2024-04-10 23:43:19,387] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", + "[2024-04-22 22:25:45,588] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", "\n", - "[2024-04-10 23:43:19,388] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", + "[2024-04-22 22:25:45,588] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", "\n", - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", + "[2024-04-22 22:25:45,588] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", "\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", + "\u001b[0m2024-04-22 22:25:45.674 INFO gxf/std/greedy_scheduler.cpp@372: Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\u001b[0m\n", "\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", + "\u001b[0m2024-04-22 22:25:45.675 INFO gxf/std/greedy_scheduler.cpp@401: Scheduler finished.\u001b[0m\n", "\n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", + "[info] [gxf_executor.cpp:1879] Deactivating Graph...\n", "\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", + "[info] [gxf_executor.cpp:1887] Graph execution finished.\n", "\n", - "[2024-04-10 23:43:19,487] [INFO] (app.AISpleenSegApp) - End run\n", + "[2024-04-22 22:25:45,680] [INFO] (app.AISpleenSegApp) - End run\n", "\n", - "[info] [gxf_executor.cpp:230] Destroying context\n", + "[info] [gxf_executor.cpp:275] Destroying context\n", "\n", - "[2024-04-10 16:43:21,271] [INFO] (common) - Container 'optimistic_jang'(5135fc45ca94) exited.\n" + "[2024-04-22 15:25:47,166] [INFO] (common) - Container 'bold_nobel'(48b13acf2bd6) exited.\n" ] } ], @@ -2109,7 +2152,7 @@ "output_type": "stream", "text": [ "output:\n", - "1.2.826.0.1.3680043.10.511.3.10550615266418892085330010762562517.dcm\n", + "1.2.826.0.1.3680043.10.511.3.51064269916840740931614885593223193.dcm\n", "saved_images_folder\n", "\n", "output/saved_images_folder:\n", diff --git a/notebooks/tutorials/03_segmentation_viz_app.ipynb b/notebooks/tutorials/03_segmentation_viz_app.ipynb index fbaab63e..9367651a 100644 --- a/notebooks/tutorials/03_segmentation_viz_app.ipynb +++ b/notebooks/tutorials/03_segmentation_viz_app.ipynb @@ -85,7 +85,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -123,7 +123,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -132,23 +132,20 @@ "text": [ "Requirement already satisfied: gdown in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (5.1.0)\n", "Requirement already satisfied: beautifulsoup4 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (4.12.3)\n", - "Requirement already satisfied: filelock in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (3.13.3)\n", + "Requirement already satisfied: filelock in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (3.13.4)\n", "Requirement already satisfied: requests[socks] in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (2.31.0)\n", "Requirement already satisfied: tqdm in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (4.66.2)\n", "Requirement already satisfied: soupsieve>1.2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from beautifulsoup4->gdown) (2.5)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.3.2)\n", - "Requirement already satisfied: idna<4,>=2.5 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.6)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (1.26.18)\n", + "Requirement already satisfied: idna<4,>=2.5 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.7)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (2.2.1)\n", "Requirement already satisfied: certifi>=2017.4.17 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (2024.2.2)\n", "Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (1.7.1)\n", - "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.3.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.0\u001b[0m\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", "Downloading...\n", "From (original): https://drive.google.com/uc?id=1Uds8mEvdGNYUuvFpTtCQ8gNU97bAPCaQ\n", - "From (redirected): https://drive.google.com/uc?id=1Uds8mEvdGNYUuvFpTtCQ8gNU97bAPCaQ&confirm=t&uuid=dcd169d3-fd74-406b-84df-e849918958a1\n", + "From (redirected): https://drive.google.com/uc?id=1Uds8mEvdGNYUuvFpTtCQ8gNU97bAPCaQ&confirm=t&uuid=4023f198-c29c-4b05-87d9-ab40569c07c6\n", "To: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/ai_spleen_seg_bundle_data.zip\n", - "100%|██████████████████████████████████████| 79.4M/79.4M [00:00<00:00, 81.5MB/s]\n", + "100%|██████████████████████████████████████| 79.4M/79.4M [00:01<00:00, 64.2MB/s]\n", "Archive: ai_spleen_seg_bundle_data.zip\n", " inflating: dcm/1-001.dcm \n", " inflating: dcm/1-002.dcm \n", @@ -385,7 +382,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -418,7 +415,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -478,7 +475,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -628,45 +625,58 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "[2024-04-10 10:46:21,853] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=[])\n", - "[2024-04-10 10:46:21,859] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=models, workdir=)\n", - "[2024-04-10 10:46:21,866] [INFO] (root) - End compose\n", - "[info] [gxf_executor.cpp:211] Creating context\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[info] [greedy_scheduler.cpp:190] Scheduling 10 entities\n", - "[2024-04-10 10:46:21,911] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", - "[2024-04-10 10:46:22,254] [INFO] (root) - Finding series for Selection named: CT Series\n", - "[2024-04-10 10:46:22,256] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", + "[2024-04-22 14:00:46,142] [INFO] (__main__.AISpleenSegApp) - Begin run\n", + "[2024-04-22 14:00:46,143] [INFO] (root) - Begin compose\n", + "[2024-04-22 14:00:46,147] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=[])\n", + "[2024-04-22 14:00:46,151] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=models, workdir=)\n", + "[2024-04-22 14:00:46,154] [INFO] (root) - End compose\n", + "[info] [gxf_executor.cpp:247] Creating context\n", + "[info] [gxf_executor.cpp:1672] Loading extensions from configs...\n", + "[info] [gxf_executor.cpp:1842] Activating Graph...\n", + "[info] [gxf_executor.cpp:1874] Running Graph...\n", + "[info] [gxf_executor.cpp:1876] Waiting for completion...\n", + "[2024-04-22 14:00:46,177] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[0m2024-04-22 14:00:46.176 INFO gxf/std/greedy_scheduler.cpp@191: Scheduling 10 entities\u001b[0m\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[2024-04-22 14:00:46,778] [INFO] (root) - Finding series for Selection named: CT Series\n", + "[2024-04-22 14:00:46,779] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", " # of series: 1\n", - "[2024-04-10 10:46:22,257] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 10:46:22,257] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", - "[2024-04-10 10:46:22,258] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", - "[2024-04-10 10:46:22,259] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 10:46:22,261] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", - "[2024-04-10 10:46:22,262] [INFO] (root) - Series attribute Modality value: CT\n", - "[2024-04-10 10:46:22,262] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 10:46:22,263] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", - "[2024-04-10 10:46:22,264] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", - "[2024-04-10 10:46:22,265] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 10:46:22,265] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 10:46:22,497] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models/model/model.ts\n" + "[2024-04-22 14:00:46,780] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 14:00:46,781] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", + "[2024-04-22 14:00:46,782] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", + "[2024-04-22 14:00:46,783] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 14:00:46,784] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", + "[2024-04-22 14:00:46,786] [INFO] (root) - Series attribute Modality value: CT\n", + "[2024-04-22 14:00:46,787] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 14:00:46,789] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", + "[2024-04-22 14:00:46,790] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", + "[2024-04-22 14:00:46,791] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 14:00:46,792] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 14:00:47,047] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models/model/model.ts\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "76b80cc0d2af48c58237d1f8d5d1ec88", + "model_id": "11dc2c7c956341b8a56e2c2699080caa", "version_major": 2, "version_minor": 0 }, @@ -681,26 +691,29 @@ "name": "stderr", "output_type": "stream", "text": [ - "[2024-04-10 10:46:35,947] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConversionOperator) - Output will be saved in file output/stl/spleen.stl.\n", - "[2024-04-10 10:46:37,415] [INFO] (monai.deploy.operators.stl_conversion_operator.SpatialImage) - 3D image\n", - "[2024-04-10 10:46:37,416] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConverter) - Image ndarray shape:(204, 512, 512)\n", - "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/highdicom/valuerep.py:54: UserWarning: The string \"C3N-00198\" is unlikely to represent the intended person name since it contains only a single component. Construct a person name according to the format in described in https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html#sect_6.2.1.2, or, in pydicom 2.2.0 or later, use the pydicom.valuerep.PersonName.from_named_components() method to construct the person name correctly. If a single-component name is really intended, add a trailing caret character to disambiguate the name.\n", - " warnings.warn(\n", - "[2024-04-10 10:46:47,813] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 10:46:47,814] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", - "[2024-04-10 10:46:47,815] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 10:46:47,816] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", - "[2024-04-10 10:46:47,817] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", - "[2024-04-10 10:46:47,818] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 10:46:47,819] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", - "[2024-04-10 10:46:47,821] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", - "[2024-04-10 10:46:47,822] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[2024-04-10 10:46:47,929] [INFO] (__main__.AISpleenSegApp) - End run\n" + "[2024-04-22 14:00:56,526] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConversionOperator) - Output will be saved in file output/stl/spleen.stl.\n", + "[2024-04-22 14:00:58,138] [INFO] (monai.deploy.operators.stl_conversion_operator.SpatialImage) - 3D image\n", + "[2024-04-22 14:00:58,139] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConverter) - Image ndarray shape:(204, 512, 512)\n", + "[2024-04-22 14:01:08,141] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 14:01:08,143] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", + "[2024-04-22 14:01:08,144] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 14:01:08,144] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", + "[2024-04-22 14:01:08,145] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", + "[2024-04-22 14:01:08,146] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 14:01:08,147] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", + "[2024-04-22 14:01:08,147] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", + "[2024-04-22 14:01:08,148] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", + "[info] [gxf_executor.cpp:1879] Deactivating Graph...\n", + "[info] [gxf_executor.cpp:1887] Graph execution finished.\n", + "[2024-04-22 14:01:08,243] [INFO] (__main__.AISpleenSegApp) - End run\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[0m2024-04-22 14:01:08.241 INFO gxf/std/greedy_scheduler.cpp@372: Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\u001b[0m\n", + "\u001b[0m2024-04-22 14:01:08.241 INFO gxf/std/greedy_scheduler.cpp@401: Scheduler finished.\u001b[0m\n" ] } ], @@ -727,7 +740,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -745,7 +758,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -948,7 +961,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -969,7 +982,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 22, "metadata": {}, "outputs": [ { @@ -998,60 +1011,58 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[2024-04-10 10:46:52,705] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['my_app'])\n", - "[2024-04-10 10:46:52,707] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=models, workdir=)\n", - "[2024-04-10 10:46:52,709] [INFO] (root) - End compose\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:211] Creating context\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1864] Activating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1894] Running Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:190] Scheduling 10 entities\n", - "[2024-04-10 10:46:52,747] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - Finding series for Selection named: CT Series\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", + "[2024-04-22 14:01:14,328] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['my_app'])\n", + "[2024-04-22 14:01:14,331] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=models, workdir=)\n", + "[2024-04-22 14:01:14,333] [INFO] (root) - End compose\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:247] Creating context\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1672] Loading extensions from configs...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1842] Activating Graph...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1874] Running Graph...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1876] Waiting for completion...\n", + "\u001b[0m2024-04-22 14:01:14.368 INFO gxf/std/greedy_scheduler.cpp@191: Scheduling 10 entities\u001b[0m\n", + "[2024-04-22 14:01:14,370] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", + "[2024-04-22 14:01:14,823] [INFO] (root) - Finding series for Selection named: CT Series\n", + "[2024-04-22 14:01:14,824] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", " # of series: 1\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - Series attribute Modality value: CT\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 10:46:53,083] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 10:46:53,297] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models/model/model.ts\n", + "[2024-04-22 14:01:14,824] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 14:01:14,824] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", + "[2024-04-22 14:01:14,824] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", + "[2024-04-22 14:01:14,824] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 14:01:14,824] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", + "[2024-04-22 14:01:14,824] [INFO] (root) - Series attribute Modality value: CT\n", + "[2024-04-22 14:01:14,824] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 14:01:14,824] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", + "[2024-04-22 14:01:14,824] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", + "[2024-04-22 14:01:14,824] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 14:01:14,824] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 14:01:15,062] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models/model/model.ts\n", + "[2024-04-22 14:01:21,178] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConversionOperator) - Output will be saved in file output/stl/spleen.stl.\n", + "[2024-04-22 14:01:22,769] [INFO] (monai.deploy.operators.stl_conversion_operator.SpatialImage) - 3D image\n", + "[2024-04-22 14:01:22,769] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConverter) - Image ndarray shape:(204, 512, 512)\n", "Box(children=(Widget(), VBox(children=(interactive(children=(Dropdown(description='View mode', index=2, options=(('Cinematic', 'CINEMATIC'), ('Slice', 'SLICE'), ('Slice Segmentation', 'SLICE_SEGMENTATION')), value='SLICE_SEGMENTATION'), Output()), _dom_classes=('widget-interact',)), interactive(children=(Dropdown(description='Camera', options=('Top', 'Right', 'Front'), value='Top'), Output()), _dom_classes=('widget-interact',))))))\n", - "[2024-04-10 10:47:05,685] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConversionOperator) - Output will be saved in file output/stl/spleen.stl.\n", - "[2024-04-10 10:47:07,271] [INFO] (monai.deploy.operators.stl_conversion_operator.SpatialImage) - 3D image\n", - "[2024-04-10 10:47:07,271] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConverter) - Image ndarray shape:(204, 512, 512)\n", "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/highdicom/valuerep.py:54: UserWarning: The string \"C3N-00198\" is unlikely to represent the intended person name since it contains only a single component. Construct a person name according to the format in described in https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html#sect_6.2.1.2, or, in pydicom 2.2.0 or later, use the pydicom.valuerep.PersonName.from_named_components() method to construct the person name correctly. If a single-component name is really intended, add a trailing caret character to disambiguate the name.\n", " warnings.warn(\n", - "[2024-04-10 10:47:18,769] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 10:47:18,769] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", - "[2024-04-10 10:47:18,769] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 10:47:18,769] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", - "[2024-04-10 10:47:18,769] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", - "[2024-04-10 10:47:18,769] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 10:47:18,769] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", - "[2024-04-10 10:47:18,769] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", - "[2024-04-10 10:47:18,769] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[2024-04-10 10:47:18,856] [INFO] (app.AISpleenSegApp) - End run\n" + "[2024-04-22 14:01:40,594] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 14:01:40,595] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", + "[2024-04-22 14:01:40,595] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 14:01:40,595] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", + "[2024-04-22 14:01:40,595] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", + "[2024-04-22 14:01:40,595] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 14:01:40,595] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", + "[2024-04-22 14:01:40,595] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", + "[2024-04-22 14:01:40,596] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", + "\u001b[0m2024-04-22 14:01:40.683 INFO gxf/std/greedy_scheduler.cpp@372: Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\u001b[0m\n", + "\u001b[0m2024-04-22 14:01:40.684 INFO gxf/std/greedy_scheduler.cpp@401: Scheduler finished.\u001b[0m\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1879] Deactivating Graph...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1887] Graph execution finished.\n", + "[2024-04-22 14:01:40,684] [INFO] (app.AISpleenSegApp) - End run\n" ] } ], @@ -1062,14 +1073,25 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 24, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "1.2.826.0.1.3680043.10.511.3.65335369220270763710273609202620247.dcm stl\n" + "1.2.826.0.1.3680043.10.511.3.26614005343573303329085948402193260.dcm stl\n" + ] + }, + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mThe Kernel crashed while executing code in the current cell or a previous cell. \n", + "\u001b[1;31mPlease review the code in the cell(s) to identify a possible cause of the failure. \n", + "\u001b[1;31mClick here for more info. \n", + "\u001b[1;31mView Jupyter log for further details." ] } ], diff --git a/notebooks/tutorials/04_monai_bundle_app.ipynb b/notebooks/tutorials/04_monai_bundle_app.ipynb index b546487b..e69de29b 100644 --- a/notebooks/tutorials/04_monai_bundle_app.ipynb +++ b/notebooks/tutorials/04_monai_bundle_app.ipynb @@ -1,1925 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Creating a Deploy App with MONAI Deploy App SDK and MONAI Bundle\n", - "\n", - "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](https://docs.monai.io/en/latest/bundle_intro.html) format.\n", - "\n", - "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.\n", - "\n", - "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.\n", - "\n", - "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.\n", - "\n", - "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.\n", - "\n", - ":::{note}\n", - "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.\n", - "\n", - "To make running this example simpler, the DICOM files and the [Spleen CT Segmentation MONAI Bundle](https://github.com/Project-MONAI/model-zoo/tree/dev/models/spleen_ct_segmentation), published in [MONAI Model Zoo](https://github.com/Project-MONAI/model-zoo), have been packaged and shared on Google Drive.\n", - "\n", - ":::\n", - "\n", - "## Creating Operators and connecting them in Application class\n", - "\n", - "We will implement an application that consists of five Operators:\n", - "\n", - "- **DICOMDataLoaderOperator**:\n", - " - **Input(dicom_files)**: a folder path (`Path`)\n", - " - **Output(dicom_study_list)**: a list of DICOM studies in memory (List[[`DICOMStudy`](/modules/_autosummary/monai.deploy.core.domain.DICOMStudy)])\n", - "- **DICOMSeriesSelectorOperator**:\n", - " - **Input(dicom_study_list)**: a list of DICOM studies in memory (List[[`DICOMStudy`](/modules/_autosummary/monai.deploy.core.domain.DICOMStudy)])\n", - " - **Input(selection_rules)**: a selection rule (Dict)\n", - " - **Output(study_selected_series_list)**: a DICOM series object in memory ([`StudySelectedSeries`](/modules/_autosummary/monai.deploy.core.domain.StudySelectedSeries))\n", - "- **DICOMSeriesToVolumeOperator**:\n", - " - **Input(study_selected_series_list)**: a DICOM series object in memory ([`StudySelectedSeries`](/modules/_autosummary/monai.deploy.core.domain.StudySelectedSeries))\n", - " - **Output(image)**: an image object in memory ([`Image`](/modules/_autosummary/monai.deploy.core.domain.Image))\n", - "- **MonaiBundleInferenceOperator**:\n", - " - **Input(image)**: an image object in memory ([`Image`](/modules/_autosummary/monai.deploy.core.domain.Image))\n", - " - **Output(pred)**: an image object in memory ([`Image`](/modules/_autosummary/monai.deploy.core.domain.Image))\n", - "- **DICOMSegmentationWriterOperator**:\n", - " - **Input(seg_image)**: a segmentation image object in memory ([`Image`](/modules/_autosummary/monai.deploy.core.domain.Image))\n", - " - **Input(study_selected_series_list)**: a DICOM series object in memory ([`StudySelectedSeries`](/modules/_autosummary/monai.deploy.core.domain.StudySelectedSeries))\n", - " - **Output(dicom_seg_instance)**: a file path (`Path`)\n", - "\n", - "\n", - ":::{note}\n", - "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.\n", - ":::\n", - "\n", - "The workflow of the application is illustrated below.\n", - "\n", - "```{mermaid}\n", - "%%{init: {\"theme\": \"base\", \"themeVariables\": { \"fontSize\": \"16px\"}} }%%\n", - "\n", - "classDiagram\n", - " direction TB\n", - "\n", - " DICOMDataLoaderOperator --|> DICOMSeriesSelectorOperator : dicom_study_list...dicom_study_list\n", - " DICOMSeriesSelectorOperator --|> DICOMSeriesToVolumeOperator : study_selected_series_list...study_selected_series_list\n", - " DICOMSeriesToVolumeOperator --|> MonaiBundleInferenceOperator : image...image\n", - " DICOMSeriesSelectorOperator --|> DICOMSegmentationWriterOperator : study_selected_series_list...study_selected_series_list\n", - " MonaiBundleInferenceOperator --|> DICOMSegmentationWriterOperator : pred...seg_image\n", - "\n", - "\n", - " class DICOMDataLoaderOperator {\n", - " dicom_files : DISK\n", - " dicom_study_list(out) IN_MEMORY\n", - " }\n", - " class DICOMSeriesSelectorOperator {\n", - " dicom_study_list : IN_MEMORY\n", - " selection_rules : IN_MEMORY\n", - " study_selected_series_list(out) IN_MEMORY\n", - " }\n", - " class DICOMSeriesToVolumeOperator {\n", - " study_selected_series_list : IN_MEMORY\n", - " image(out) IN_MEMORY\n", - " }\n", - " class MonaiBundleInferenceOperator {\n", - " image : IN_MEMORY\n", - " pred(out) IN_MEMORY\n", - " }\n", - " class DICOMSegmentationWriterOperator {\n", - " seg_image : IN_MEMORY\n", - " study_selected_series_list : IN_MEMORY\n", - " dicom_seg_instance(out) DISK\n", - " }\n", - "```\n", - "\n", - "### Setup environment\n" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "# Install MONAI and other necessary image processing packages for the application\n", - "!python -c \"import monai\" || pip install --upgrade -q \"monai\"\n", - "!python -c \"import torch\" || pip install -q \"torch>=1.12.0\"\n", - "!python -c \"import numpy\" || pip install -q \"numpy>=1.21.6\"\n", - "!python -c \"import nibabel\" || pip install -q \"nibabel>=3.2.1\"\n", - "!python -c \"import pydicom\" || pip install -q \"pydicom>=2.3.0\"\n", - "!python -c \"import highdicom\" || pip install -q \"highdicom>=0.18.2\"\n", - "!python -c \"import SimpleITK\" || pip install -q \"SimpleITK>=2.0.0\"\n", - "\n", - "# Install MONAI Deploy App SDK package\n", - "!python -c \"import holoscan\" || pip install --upgrade -q \"holoscan>=0.6.0\"\n", - "!python -c \"import monai.deploy\" || pip install -q \"monai-deploy-app-sdk\"" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Note: you may need to restart the Jupyter kernel to use the updated packages." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Download/Extract input and model/bundle files from Google Drive" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: gdown in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (5.1.0)\n", - "Requirement already satisfied: beautifulsoup4 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (4.12.3)\n", - "Requirement already satisfied: filelock in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (3.13.3)\n", - "Requirement already satisfied: requests[socks] in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (2.28.2)\n", - "Requirement already satisfied: tqdm in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (4.66.2)\n", - "Requirement already satisfied: soupsieve>1.2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from beautifulsoup4->gdown) (2.5)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.3.2)\n", - "Requirement already satisfied: idna<4,>=2.5 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.6)\n", - "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (1.26.18)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (2024.2.2)\n", - "Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (1.7.1)\n", - "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.3.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.0\u001b[0m\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", - "Downloading...\n", - "From (original): https://drive.google.com/uc?id=1Uds8mEvdGNYUuvFpTtCQ8gNU97bAPCaQ\n", - "From (redirected): https://drive.google.com/uc?id=1Uds8mEvdGNYUuvFpTtCQ8gNU97bAPCaQ&confirm=t&uuid=e406b570-c957-4c12-9dc1-df625c4fb575\n", - "To: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/ai_spleen_seg_bundle_data.zip\n", - "100%|███████████████████████████████████████| 79.4M/79.4M [00:00<00:00, 115MB/s]\n", - "Archive: ai_spleen_seg_bundle_data.zip\n", - " inflating: dcm/1-001.dcm \n", - " inflating: dcm/1-002.dcm \n", - " inflating: dcm/1-003.dcm \n", - " inflating: dcm/1-004.dcm \n", - " inflating: dcm/1-005.dcm \n", - " inflating: dcm/1-006.dcm \n", - " inflating: dcm/1-007.dcm \n", - " inflating: dcm/1-008.dcm \n", - " inflating: dcm/1-009.dcm \n", - " inflating: dcm/1-010.dcm \n", - " inflating: dcm/1-011.dcm \n", - " inflating: dcm/1-012.dcm \n", - " inflating: dcm/1-013.dcm \n", - " inflating: dcm/1-014.dcm \n", - " inflating: dcm/1-015.dcm \n", - " inflating: dcm/1-016.dcm \n", - " inflating: dcm/1-017.dcm \n", - " inflating: dcm/1-018.dcm \n", - " inflating: dcm/1-019.dcm \n", - " inflating: dcm/1-020.dcm \n", - " inflating: dcm/1-021.dcm \n", - " inflating: dcm/1-022.dcm \n", - " inflating: dcm/1-023.dcm \n", - " inflating: dcm/1-024.dcm \n", - " inflating: dcm/1-025.dcm \n", - " inflating: dcm/1-026.dcm \n", - " inflating: dcm/1-027.dcm \n", - " inflating: dcm/1-028.dcm \n", - " inflating: dcm/1-029.dcm \n", - " inflating: dcm/1-030.dcm \n", - " inflating: dcm/1-031.dcm \n", - " inflating: dcm/1-032.dcm \n", - " inflating: dcm/1-033.dcm \n", - " inflating: dcm/1-034.dcm \n", - " inflating: dcm/1-035.dcm \n", - " inflating: dcm/1-036.dcm \n", - " inflating: dcm/1-037.dcm \n", - " inflating: dcm/1-038.dcm \n", - " inflating: dcm/1-039.dcm \n", - " inflating: dcm/1-040.dcm \n", - " inflating: dcm/1-041.dcm \n", - " inflating: dcm/1-042.dcm \n", - " inflating: dcm/1-043.dcm \n", - " inflating: dcm/1-044.dcm \n", - " inflating: dcm/1-045.dcm \n", - " inflating: dcm/1-046.dcm \n", - " inflating: dcm/1-047.dcm \n", - " inflating: dcm/1-048.dcm \n", - " inflating: dcm/1-049.dcm \n", - " inflating: dcm/1-050.dcm \n", - " inflating: dcm/1-051.dcm \n", - " inflating: dcm/1-052.dcm \n", - " inflating: dcm/1-053.dcm \n", - " inflating: dcm/1-054.dcm \n", - " inflating: dcm/1-055.dcm \n", - " inflating: dcm/1-056.dcm \n", - " inflating: dcm/1-057.dcm \n", - " inflating: dcm/1-058.dcm \n", - " inflating: dcm/1-059.dcm \n", - " inflating: dcm/1-060.dcm \n", - " inflating: dcm/1-061.dcm \n", - " inflating: dcm/1-062.dcm \n", - " inflating: dcm/1-063.dcm \n", - " inflating: dcm/1-064.dcm \n", - " inflating: dcm/1-065.dcm \n", - " inflating: dcm/1-066.dcm \n", - " inflating: dcm/1-067.dcm \n", - " inflating: dcm/1-068.dcm \n", - " inflating: dcm/1-069.dcm \n", - " inflating: dcm/1-070.dcm \n", - " inflating: dcm/1-071.dcm \n", - " inflating: dcm/1-072.dcm \n", - " inflating: dcm/1-073.dcm \n", - " inflating: dcm/1-074.dcm \n", - " inflating: dcm/1-075.dcm \n", - " inflating: dcm/1-076.dcm \n", - " inflating: dcm/1-077.dcm \n", - " inflating: dcm/1-078.dcm \n", - " inflating: dcm/1-079.dcm \n", - " inflating: dcm/1-080.dcm \n", - " inflating: dcm/1-081.dcm \n", - " inflating: dcm/1-082.dcm \n", - " inflating: dcm/1-083.dcm \n", - " inflating: dcm/1-084.dcm \n", - " inflating: dcm/1-085.dcm \n", - " inflating: dcm/1-086.dcm \n", - " inflating: dcm/1-087.dcm \n", - " inflating: dcm/1-088.dcm \n", - " inflating: dcm/1-089.dcm \n", - " inflating: dcm/1-090.dcm \n", - " inflating: dcm/1-091.dcm \n", - " inflating: dcm/1-092.dcm \n", - " inflating: dcm/1-093.dcm \n", - " inflating: dcm/1-094.dcm \n", - " inflating: dcm/1-095.dcm \n", - " inflating: dcm/1-096.dcm \n", - " inflating: dcm/1-097.dcm \n", - " inflating: dcm/1-098.dcm \n", - " inflating: dcm/1-099.dcm \n", - " inflating: dcm/1-100.dcm \n", - " inflating: dcm/1-101.dcm \n", - " inflating: dcm/1-102.dcm \n", - " inflating: dcm/1-103.dcm \n", - " inflating: dcm/1-104.dcm \n", - " inflating: dcm/1-105.dcm \n", - " inflating: dcm/1-106.dcm \n", - " inflating: dcm/1-107.dcm \n", - " inflating: dcm/1-108.dcm \n", - " inflating: dcm/1-109.dcm \n", - " inflating: dcm/1-110.dcm \n", - " inflating: dcm/1-111.dcm \n", - " inflating: dcm/1-112.dcm \n", - " inflating: dcm/1-113.dcm \n", - " inflating: dcm/1-114.dcm \n", - " inflating: dcm/1-115.dcm \n", - " inflating: dcm/1-116.dcm \n", - " inflating: dcm/1-117.dcm \n", - " inflating: dcm/1-118.dcm \n", - " inflating: dcm/1-119.dcm \n", - " inflating: dcm/1-120.dcm \n", - " inflating: dcm/1-121.dcm \n", - " inflating: dcm/1-122.dcm \n", - " inflating: dcm/1-123.dcm \n", - " inflating: dcm/1-124.dcm \n", - " inflating: dcm/1-125.dcm \n", - " inflating: dcm/1-126.dcm \n", - " inflating: dcm/1-127.dcm \n", - " inflating: dcm/1-128.dcm \n", - " inflating: dcm/1-129.dcm \n", - " inflating: dcm/1-130.dcm \n", - " inflating: dcm/1-131.dcm \n", - " inflating: dcm/1-132.dcm \n", - " inflating: dcm/1-133.dcm \n", - " inflating: dcm/1-134.dcm \n", - " inflating: dcm/1-135.dcm \n", - " inflating: dcm/1-136.dcm \n", - " inflating: dcm/1-137.dcm \n", - " inflating: dcm/1-138.dcm \n", - " inflating: dcm/1-139.dcm \n", - " inflating: dcm/1-140.dcm \n", - " inflating: dcm/1-141.dcm \n", - " inflating: dcm/1-142.dcm \n", - " inflating: dcm/1-143.dcm \n", - " inflating: dcm/1-144.dcm \n", - " inflating: dcm/1-145.dcm \n", - " inflating: dcm/1-146.dcm \n", - " inflating: dcm/1-147.dcm \n", - " inflating: dcm/1-148.dcm \n", - " inflating: dcm/1-149.dcm \n", - " inflating: dcm/1-150.dcm \n", - " inflating: dcm/1-151.dcm \n", - " inflating: dcm/1-152.dcm \n", - " inflating: dcm/1-153.dcm \n", - " inflating: dcm/1-154.dcm \n", - " inflating: dcm/1-155.dcm \n", - " inflating: dcm/1-156.dcm \n", - " inflating: dcm/1-157.dcm \n", - " inflating: dcm/1-158.dcm \n", - " inflating: dcm/1-159.dcm \n", - " inflating: dcm/1-160.dcm \n", - " inflating: dcm/1-161.dcm \n", - " inflating: dcm/1-162.dcm \n", - " inflating: dcm/1-163.dcm \n", - " inflating: dcm/1-164.dcm \n", - " inflating: dcm/1-165.dcm \n", - " inflating: dcm/1-166.dcm \n", - " inflating: dcm/1-167.dcm \n", - " inflating: dcm/1-168.dcm \n", - " inflating: dcm/1-169.dcm \n", - " inflating: dcm/1-170.dcm \n", - " inflating: dcm/1-171.dcm \n", - " inflating: dcm/1-172.dcm \n", - " inflating: dcm/1-173.dcm \n", - " inflating: dcm/1-174.dcm \n", - " inflating: dcm/1-175.dcm \n", - " inflating: dcm/1-176.dcm \n", - " inflating: dcm/1-177.dcm \n", - " inflating: dcm/1-178.dcm \n", - " inflating: dcm/1-179.dcm \n", - " inflating: dcm/1-180.dcm \n", - " inflating: dcm/1-181.dcm \n", - " inflating: dcm/1-182.dcm \n", - " inflating: dcm/1-183.dcm \n", - " inflating: dcm/1-184.dcm \n", - " inflating: dcm/1-185.dcm \n", - " inflating: dcm/1-186.dcm \n", - " inflating: dcm/1-187.dcm \n", - " inflating: dcm/1-188.dcm \n", - " inflating: dcm/1-189.dcm \n", - " inflating: dcm/1-190.dcm \n", - " inflating: dcm/1-191.dcm \n", - " inflating: dcm/1-192.dcm \n", - " inflating: dcm/1-193.dcm \n", - " inflating: dcm/1-194.dcm \n", - " inflating: dcm/1-195.dcm \n", - " inflating: dcm/1-196.dcm \n", - " inflating: dcm/1-197.dcm \n", - " inflating: dcm/1-198.dcm \n", - " inflating: dcm/1-199.dcm \n", - " inflating: dcm/1-200.dcm \n", - " inflating: dcm/1-201.dcm \n", - " inflating: dcm/1-202.dcm \n", - " inflating: dcm/1-203.dcm \n", - " inflating: dcm/1-204.dcm \n", - " inflating: model.ts \n", - "model.ts\n" - ] - } - ], - "source": [ - "# Download the test data and MONAI bundle zip file\n", - "!pip install gdown\n", - "!gdown \"https://drive.google.com/uc?id=1Uds8mEvdGNYUuvFpTtCQ8gNU97bAPCaQ\"\n", - "\n", - "# After downloading ai_spleen_bundle_data zip file from the web browser or using gdown,\n", - "!unzip -o \"ai_spleen_seg_bundle_data.zip\"\n", - "\n", - "# Need to copy the model.ts file to its own clean subfolder for pacakging, to workaround an issue in the Packager\n", - "models_folder = \"models\"\n", - "!rm -rf {models_folder} && mkdir -p {models_folder}/model && cp model.ts {models_folder}/model && ls {models_folder}/model" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Set up environment variables" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "env: HOLOSCAN_INPUT_PATH=dcm\n", - "env: HOLOSCAN_MODEL_PATH=models\n", - "env: HOLOSCAN_OUTPUT_PATH=output\n" - ] - } - ], - "source": [ - "%env HOLOSCAN_INPUT_PATH dcm\n", - "%env HOLOSCAN_MODEL_PATH {models_folder}\n", - "%env HOLOSCAN_OUTPUT_PATH output" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Set up imports\n", - "\n", - "Let's import necessary classes/decorators to define Application and Operator." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [], - "source": [ - "\n", - "import logging\n", - "from pathlib import Path\n", - "\n", - "# Required for setting SegmentDescription attributes. Direct import as this is not part of App SDK package.\n", - "from pydicom.sr.codedict import codes\n", - "\n", - "from monai.deploy.conditions import CountCondition\n", - "from monai.deploy.core import AppContext, Application\n", - "from monai.deploy.core.domain import Image\n", - "from monai.deploy.core.io_type import IOType\n", - "from monai.deploy.operators.dicom_data_loader_operator import DICOMDataLoaderOperator\n", - "from monai.deploy.operators.dicom_seg_writer_operator import DICOMSegmentationWriterOperator, SegmentDescription\n", - "from monai.deploy.operators.dicom_series_selector_operator import DICOMSeriesSelectorOperator\n", - "from monai.deploy.operators.dicom_series_to_volume_operator import DICOMSeriesToVolumeOperator\n", - "from monai.deploy.operators.monai_bundle_inference_operator import (\n", - " BundleConfigNames,\n", - " IOMapping,\n", - " MonaiBundleInferenceOperator,\n", - ")\n", - "from monai.deploy.operators.stl_conversion_operator import STLConversionOperator\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Determining the Input and Output for the Model Bundle Inference Operator\n", - "\n", - "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.\n", - "\n", - "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 `@input`and `@output` in Version 0.5 and below).\n", - "\n", - "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.\n", - "\n", - "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](/modules/_autosummary/monai.deploy.core.domain.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)." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Creating Application class\n", - "\n", - "Our application class would look like below.\n", - "\n", - "It defines `App` class, inheriting the base `Application` class.\n", - "\n", - "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()`." - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [], - "source": [ - "class AISpleenSegApp(Application):\n", - " \"\"\"Demonstrates inference with built-in MONAI Bundle inference operator with DICOM files as input/output\n", - "\n", - " This application loads a set of DICOM instances, select the appropriate series, converts the series to\n", - " 3D volume image, performs inference with the built-in MONAI Bundle inference operator, including pre-processing\n", - " and post-processing, save the segmentation image in a DICOM Seg OID in an instance file, and optionally the\n", - " surface mesh in STL format.\n", - "\n", - " Pertinent MONAI Bundle:\n", - " https://github.com/Project-MONAI/model-zoo/tree/dev/models/spleen_ct_segmentation\n", - "\n", - " Execution Time Estimate:\n", - " With a Nvidia GV100 32GB GPU, for an input DICOM Series of 515 instances, the execution time is around\n", - " 25 seconds with saving both DICOM Seg and surface mesh STL file, and 15 seconds with DICOM Seg only.\n", - " \"\"\"\n", - "\n", - " def __init__(self, *args, **kwargs):\n", - " \"\"\"Creates an application instance.\"\"\"\n", - " self._logger = logging.getLogger(\"{}.{}\".format(__name__, type(self).__name__))\n", - " super().__init__(*args, **kwargs)\n", - "\n", - " def run(self, *args, **kwargs):\n", - " # This method calls the base class to run. Can be omitted if simply calling through.\n", - " self._logger.info(f\"Begin {self.run.__name__}\")\n", - " super().run(*args, **kwargs)\n", - " self._logger.info(f\"End {self.run.__name__}\")\n", - "\n", - " def compose(self):\n", - " \"\"\"Creates the app specific operators and chain them up in the processing DAG.\"\"\"\n", - "\n", - " logging.info(f\"Begin {self.compose.__name__}\")\n", - "\n", - " app_context = Application.init_app_context({}) # Do not pass argv in Jupyter Notebook\n", - " app_input_path = Path(app_context.input_path)\n", - " app_output_path = Path(app_context.output_path)\n", - " model_path = Path(app_context.model_path)\n", - "\n", - " # Create the custom operator(s) as well as SDK built-in operator(s).\n", - " study_loader_op = DICOMDataLoaderOperator(\n", - " self, CountCondition(self, 1), input_folder=app_input_path, name=\"study_loader_op\"\n", - " )\n", - " series_selector_op = DICOMSeriesSelectorOperator(self, rules=Sample_Rules_Text, name=\"series_selector_op\")\n", - " series_to_vol_op = DICOMSeriesToVolumeOperator(self, name=\"series_to_vol_op\")\n", - "\n", - " # Create the inference operator that supports MONAI Bundle and automates the inference.\n", - " # The IOMapping labels match the input and prediction keys in the pre and post processing.\n", - " # The model_name is optional when the app has only one model.\n", - " # The bundle_path argument optionally can be set to an accessible bundle file path in the dev\n", - " # environment, so when the app is packaged into a MAP, the operator can complete the bundle parsing\n", - " # during init.\n", - "\n", - " config_names = BundleConfigNames(config_names=[\"inference\"]) # Same as the default\n", - "\n", - " bundle_spleen_seg_op = MonaiBundleInferenceOperator(\n", - " self,\n", - " input_mapping=[IOMapping(\"image\", Image, IOType.IN_MEMORY)],\n", - " output_mapping=[IOMapping(\"pred\", Image, IOType.IN_MEMORY)],\n", - " app_context=app_context,\n", - " bundle_config_names=config_names,\n", - " bundle_path=model_path,\n", - " name=\"bundle_spleen_seg_op\",\n", - " )\n", - "\n", - " # Create DICOM Seg writer providing the required segment description for each segment with\n", - " # the actual algorithm and the pertinent organ/tissue. The segment_label, algorithm_name,\n", - " # and algorithm_version are of DICOM VR LO type, limited to 64 chars.\n", - " # https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html\n", - " segment_descriptions = [\n", - " SegmentDescription(\n", - " segment_label=\"Spleen\",\n", - " segmented_property_category=codes.SCT.Organ,\n", - " segmented_property_type=codes.SCT.Spleen,\n", - " algorithm_name=\"volumetric (3D) segmentation of the spleen from CT image\",\n", - " algorithm_family=codes.DCM.ArtificialIntelligence,\n", - " algorithm_version=\"0.3.2\",\n", - " )\n", - " ]\n", - "\n", - " custom_tags = {\"SeriesDescription\": \"AI generated Seg, not for clinical use.\"}\n", - "\n", - " dicom_seg_writer = DICOMSegmentationWriterOperator(\n", - " self,\n", - " segment_descriptions=segment_descriptions,\n", - " custom_tags=custom_tags,\n", - " output_folder=app_output_path,\n", - " name=\"dicom_seg_writer\",\n", - " )\n", - "\n", - " # Create the processing pipeline, by specifying the source and destination operators, and\n", - " # ensuring the output from the former matches the input of the latter, in both name and type.\n", - " self.add_flow(study_loader_op, series_selector_op, {(\"dicom_study_list\", \"dicom_study_list\")})\n", - " self.add_flow(\n", - " series_selector_op, series_to_vol_op, {(\"study_selected_series_list\", \"study_selected_series_list\")}\n", - " )\n", - " self.add_flow(series_to_vol_op, bundle_spleen_seg_op, {(\"image\", \"image\")})\n", - " # Note below the dicom_seg_writer requires two inputs, each coming from a source operator.\n", - " self.add_flow(\n", - " series_selector_op, dicom_seg_writer, {(\"study_selected_series_list\", \"study_selected_series_list\")}\n", - " )\n", - " self.add_flow(bundle_spleen_seg_op, dicom_seg_writer, {(\"pred\", \"seg_image\")})\n", - " # Create the surface mesh STL conversion operator and add it to the app execution flow, if needed, by\n", - " # uncommenting the following couple lines.\n", - " stl_conversion_op = STLConversionOperator(\n", - " self, output_file=app_output_path.joinpath(\"stl/spleen.stl\"), name=\"stl_conversion_op\"\n", - " )\n", - " self.add_flow(bundle_spleen_seg_op, stl_conversion_op, {(\"pred\", \"image\")})\n", - "\n", - " logging.info(f\"End {self.compose.__name__}\")\n", - "\n", - "\n", - "# This is a sample series selection rule in JSON, simply selecting CT series.\n", - "# If the study has more than 1 CT series, then all of them will be selected.\n", - "# Please see more detail in DICOMSeriesSelectorOperator.\n", - "Sample_Rules_Text = \"\"\"\n", - "{\n", - " \"selections\": [\n", - " {\n", - " \"name\": \"CT Series\",\n", - " \"conditions\": {\n", - " \"StudyDescription\": \"(.*?)\",\n", - " \"Modality\": \"(?i)CT\",\n", - " \"SeriesDescription\": \"(.*?)\"\n", - " }\n", - " }\n", - " ]\n", - "}\n", - "\"\"\"" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Executing app locally\n", - "\n", - "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." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[2024-04-10 15:03:17,151] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=[])\n", - "[2024-04-10 15:03:17,160] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=models, workdir=)\n", - "[2024-04-10 15:03:17,167] [INFO] (root) - End compose\n", - "[info] [gxf_executor.cpp:211] Creating context\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[info] [greedy_scheduler.cpp:190] Scheduling 8 entities\n", - "[2024-04-10 15:03:17,216] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", - "[2024-04-10 15:03:17,807] [INFO] (root) - Finding series for Selection named: CT Series\n", - "[2024-04-10 15:03:17,809] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", - " # of series: 1\n", - "[2024-04-10 15:03:17,809] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 15:03:17,810] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", - "[2024-04-10 15:03:17,811] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", - "[2024-04-10 15:03:17,812] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 15:03:17,813] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", - "[2024-04-10 15:03:17,813] [INFO] (root) - Series attribute Modality value: CT\n", - "[2024-04-10 15:03:17,814] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 15:03:17,815] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", - "[2024-04-10 15:03:17,815] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", - "[2024-04-10 15:03:17,816] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 15:03:17,817] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 15:03:18,040] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models/model/model.ts\n", - "[2024-04-10 15:03:24,142] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConversionOperator) - Output will be saved in file output/stl/spleen.stl.\n", - "[2024-04-10 15:03:25,752] [INFO] (monai.deploy.operators.stl_conversion_operator.SpatialImage) - 3D image\n", - "[2024-04-10 15:03:25,753] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConverter) - Image ndarray shape:(204, 512, 512)\n", - "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/highdicom/valuerep.py:54: UserWarning: The string \"C3N-00198\" is unlikely to represent the intended person name since it contains only a single component. Construct a person name according to the format in described in https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html#sect_6.2.1.2, or, in pydicom 2.2.0 or later, use the pydicom.valuerep.PersonName.from_named_components() method to construct the person name correctly. If a single-component name is really intended, add a trailing caret character to disambiguate the name.\n", - " warnings.warn(\n", - "[2024-04-10 15:03:36,659] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:03:36,660] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", - "[2024-04-10 15:03:36,661] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:03:36,663] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", - "[2024-04-10 15:03:36,664] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", - "[2024-04-10 15:03:36,665] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:03:36,666] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", - "[2024-04-10 15:03:36,667] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", - "[2024-04-10 15:03:36,668] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[2024-04-10 15:03:36,762] [INFO] (__main__.AISpleenSegApp) - End run\n", - "[2024-04-10 15:03:36,763] [INFO] (root) - End __main__\n" - ] - } - ], - "source": [ - "!rm -rf $HOLOSCAN_OUTPUT_PATH\n", - "logging.info(f\"Begin {__name__}\")\n", - "AISpleenSegApp().run()\n", - "logging.info(f\"End {__name__}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Once the application is verified inside Jupyter notebook, we can write the above Python code into Python files in an application folder.\n", - "\n", - "The application folder structure would look like below:\n", - "\n", - "```bash\n", - "my_app\n", - "├── __main__.py\n", - "└── app.py\n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [], - "source": [ - "# Create an application folder\n", - "!mkdir -p my_app && rm -rf my_app/*" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### app.py" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing my_app/app.py\n" - ] - } - ], - "source": [ - "%%writefile my_app/app.py\n", - "\n", - "# Copyright 2021-2023 MONAI Consortium\n", - "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", - "# you may not use this file except in compliance with the License.\n", - "# You may obtain a copy of the License at\n", - "# http://www.apache.org/licenses/LICENSE-2.0\n", - "# Unless required by applicable law or agreed to in writing, software\n", - "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", - "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", - "# See the License for the specific language governing permissions and\n", - "# limitations under the License.\n", - "\n", - "import logging\n", - "from pathlib import Path\n", - "\n", - "# Required for setting SegmentDescription attributes. Direct import as this is not part of App SDK package.\n", - "from pydicom.sr.codedict import codes\n", - "\n", - "from monai.deploy.conditions import CountCondition\n", - "from monai.deploy.core import AppContext, Application\n", - "from monai.deploy.core.domain import Image\n", - "from monai.deploy.core.io_type import IOType\n", - "from monai.deploy.operators.dicom_data_loader_operator import DICOMDataLoaderOperator\n", - "from monai.deploy.operators.dicom_seg_writer_operator import DICOMSegmentationWriterOperator, SegmentDescription\n", - "from monai.deploy.operators.dicom_series_selector_operator import DICOMSeriesSelectorOperator\n", - "from monai.deploy.operators.dicom_series_to_volume_operator import DICOMSeriesToVolumeOperator\n", - "from monai.deploy.operators.monai_bundle_inference_operator import (\n", - " BundleConfigNames,\n", - " IOMapping,\n", - " MonaiBundleInferenceOperator,\n", - ")\n", - "from monai.deploy.operators.stl_conversion_operator import STLConversionOperator\n", - "\n", - "\n", - "class AISpleenSegApp(Application):\n", - " \"\"\"Demonstrates inference with built-in MONAI Bundle inference operator with DICOM files as input/output\n", - "\n", - " This application loads a set of DICOM instances, select the appropriate series, converts the series to\n", - " 3D volume image, performs inference with the built-in MONAI Bundle inference operator, including pre-processing\n", - " and post-processing, save the segmentation image in a DICOM Seg OID in an instance file, and optionally the\n", - " surface mesh in STL format.\n", - "\n", - " Pertinent MONAI Bundle:\n", - " https://github.com/Project-MONAI/model-zoo/tree/dev/models/spleen_ct_segmentation\n", - "\n", - " Execution Time Estimate:\n", - " With a Nvidia GV100 32GB GPU, for an input DICOM Series of 515 instances, the execution time is around\n", - " 25 seconds with saving both DICOM Seg and surface mesh STL file, and 15 seconds with DICOM Seg only.\n", - " \"\"\"\n", - "\n", - " def __init__(self, *args, **kwargs):\n", - " \"\"\"Creates an application instance.\"\"\"\n", - " self._logger = logging.getLogger(\"{}.{}\".format(__name__, type(self).__name__))\n", - " super().__init__(*args, **kwargs)\n", - "\n", - " def run(self, *args, **kwargs):\n", - " # This method calls the base class to run. Can be omitted if simply calling through.\n", - " self._logger.info(f\"Begin {self.run.__name__}\")\n", - " super().run(*args, **kwargs)\n", - " self._logger.info(f\"End {self.run.__name__}\")\n", - "\n", - " def compose(self):\n", - " \"\"\"Creates the app specific operators and chain them up in the processing DAG.\"\"\"\n", - "\n", - " logging.info(f\"Begin {self.compose.__name__}\")\n", - "\n", - " # Use Commandline options over environment variables to init context.\n", - " app_context = Application.init_app_context(self.argv)\n", - " app_input_path = Path(app_context.input_path)\n", - " app_output_path = Path(app_context.output_path)\n", - " model_path = Path(app_context.model_path)\n", - "\n", - " # Create the custom operator(s) as well as SDK built-in operator(s).\n", - " study_loader_op = DICOMDataLoaderOperator(\n", - " self, CountCondition(self, 1), input_folder=app_input_path, name=\"study_loader_op\"\n", - " )\n", - " series_selector_op = DICOMSeriesSelectorOperator(self, rules=Sample_Rules_Text, name=\"series_selector_op\")\n", - " series_to_vol_op = DICOMSeriesToVolumeOperator(self, name=\"series_to_vol_op\")\n", - "\n", - " # Create the inference operator that supports MONAI Bundle and automates the inference.\n", - " # The IOMapping labels match the input and prediction keys in the pre and post processing.\n", - " # The model_name is optional when the app has only one model.\n", - " # The bundle_path argument optionally can be set to an accessible bundle file path in the dev\n", - " # environment, so when the app is packaged into a MAP, the operator can complete the bundle parsing\n", - " # during init.\n", - "\n", - " config_names = BundleConfigNames(config_names=[\"inference\"]) # Same as the default\n", - "\n", - " bundle_spleen_seg_op = MonaiBundleInferenceOperator(\n", - " self,\n", - " input_mapping=[IOMapping(\"image\", Image, IOType.IN_MEMORY)],\n", - " output_mapping=[IOMapping(\"pred\", Image, IOType.IN_MEMORY)],\n", - " app_context=app_context,\n", - " bundle_config_names=config_names,\n", - " bundle_path=model_path,\n", - " name=\"bundle_spleen_seg_op\",\n", - " )\n", - "\n", - " # Create DICOM Seg writer providing the required segment description for each segment with\n", - " # the actual algorithm and the pertinent organ/tissue. The segment_label, algorithm_name,\n", - " # and algorithm_version are of DICOM VR LO type, limited to 64 chars.\n", - " # https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html\n", - " segment_descriptions = [\n", - " SegmentDescription(\n", - " segment_label=\"Spleen\",\n", - " segmented_property_category=codes.SCT.Organ,\n", - " segmented_property_type=codes.SCT.Spleen,\n", - " algorithm_name=\"volumetric (3D) segmentation of the spleen from CT image\",\n", - " algorithm_family=codes.DCM.ArtificialIntelligence,\n", - " algorithm_version=\"0.3.2\",\n", - " )\n", - " ]\n", - "\n", - " custom_tags = {\"SeriesDescription\": \"AI generated Seg, not for clinical use.\"}\n", - "\n", - " dicom_seg_writer = DICOMSegmentationWriterOperator(\n", - " self,\n", - " segment_descriptions=segment_descriptions,\n", - " custom_tags=custom_tags,\n", - " output_folder=app_output_path,\n", - " name=\"dicom_seg_writer\",\n", - " )\n", - "\n", - " # Create the processing pipeline, by specifying the source and destination operators, and\n", - " # ensuring the output from the former matches the input of the latter, in both name and type.\n", - " self.add_flow(study_loader_op, series_selector_op, {(\"dicom_study_list\", \"dicom_study_list\")})\n", - " self.add_flow(\n", - " series_selector_op, series_to_vol_op, {(\"study_selected_series_list\", \"study_selected_series_list\")}\n", - " )\n", - " self.add_flow(series_to_vol_op, bundle_spleen_seg_op, {(\"image\", \"image\")})\n", - " # Note below the dicom_seg_writer requires two inputs, each coming from a source operator.\n", - " self.add_flow(\n", - " series_selector_op, dicom_seg_writer, {(\"study_selected_series_list\", \"study_selected_series_list\")}\n", - " )\n", - " self.add_flow(bundle_spleen_seg_op, dicom_seg_writer, {(\"pred\", \"seg_image\")})\n", - " # Create the surface mesh STL conversion operator and add it to the app execution flow, if needed, by\n", - " # uncommenting the following couple lines.\n", - " stl_conversion_op = STLConversionOperator(\n", - " self, output_file=app_output_path.joinpath(\"stl/spleen.stl\"), name=\"stl_conversion_op\"\n", - " )\n", - " self.add_flow(bundle_spleen_seg_op, stl_conversion_op, {(\"pred\", \"image\")})\n", - "\n", - " logging.info(f\"End {self.compose.__name__}\")\n", - "\n", - "\n", - "# This is a sample series selection rule in JSON, simply selecting CT series.\n", - "# If the study has more than 1 CT series, then all of them will be selected.\n", - "# Please see more detail in DICOMSeriesSelectorOperator.\n", - "Sample_Rules_Text = \"\"\"\n", - "{\n", - " \"selections\": [\n", - " {\n", - " \"name\": \"CT Series\",\n", - " \"conditions\": {\n", - " \"StudyDescription\": \"(.*?)\",\n", - " \"Modality\": \"(?i)CT\",\n", - " \"SeriesDescription\": \"(.*?)\"\n", - " }\n", - " }\n", - " ]\n", - "}\n", - "\"\"\"\n", - "\n", - "if __name__ == \"__main__\":\n", - " AISpleenSegApp().run()\n" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "```python\n", - "if __name__ == \"__main__\":\n", - " AISpleenSegApp().run()\n", - "```\n", - "\n", - "The above lines are needed to execute the application code by using `python` interpreter.\n", - "\n", - "### \\_\\_main\\_\\_.py\n", - "\n", - "\\_\\_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`)." - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing my_app/__main__.py\n" - ] - } - ], - "source": [ - "%%writefile my_app/__main__.py\n", - "from app import AISpleenSegApp\n", - "\n", - "if __name__ == \"__main__\":\n", - " AISpleenSegApp().run()" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "app.py\t__main__.py\n" - ] - } - ], - "source": [ - "!ls my_app" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This time, let's execute the app in the command line.\n", - "\n", - ":::{note}\n", - "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.\n", - ":::" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2024-04-10 15:03:41,411] [INFO] (root) - Parsed args: Namespace(log_level=None, input=PosixPath('/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/dcm'), output=PosixPath('/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output'), model=PosixPath('/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models'), workdir=None, argv=['my_app', '-i', 'dcm', '-o', 'output', '-m', 'models'])\n", - "[2024-04-10 15:03:41,413] [INFO] (root) - AppContext object: AppContext(input_path=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/dcm, output_path=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output, model_path=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models, workdir=)\n", - "[2024-04-10 15:03:41,414] [INFO] (root) - End compose\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:211] Creating context\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1864] Activating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1894] Running Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:190] Scheduling 8 entities\n", - "[2024-04-10 15:03:41,449] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", - "[2024-04-10 15:03:41,784] [INFO] (root) - Finding series for Selection named: CT Series\n", - "[2024-04-10 15:03:41,784] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", - " # of series: 1\n", - "[2024-04-10 15:03:41,784] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 15:03:41,784] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", - "[2024-04-10 15:03:41,784] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", - "[2024-04-10 15:03:41,784] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 15:03:41,785] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", - "[2024-04-10 15:03:41,785] [INFO] (root) - Series attribute Modality value: CT\n", - "[2024-04-10 15:03:41,785] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 15:03:41,785] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", - "[2024-04-10 15:03:41,785] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", - "[2024-04-10 15:03:41,785] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 15:03:41,785] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 15:03:42,204] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models/model/model.ts\n", - "[2024-04-10 15:03:48,123] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConversionOperator) - Output will be saved in file /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/output/stl/spleen.stl.\n", - "[2024-04-10 15:03:49,607] [INFO] (monai.deploy.operators.stl_conversion_operator.SpatialImage) - 3D image\n", - "[2024-04-10 15:03:49,607] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConverter) - Image ndarray shape:(204, 512, 512)\n", - "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/highdicom/valuerep.py:54: UserWarning: The string \"C3N-00198\" is unlikely to represent the intended person name since it contains only a single component. Construct a person name according to the format in described in https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html#sect_6.2.1.2, or, in pydicom 2.2.0 or later, use the pydicom.valuerep.PersonName.from_named_components() method to construct the person name correctly. If a single-component name is really intended, add a trailing caret character to disambiguate the name.\n", - " warnings.warn(\n", - "[2024-04-10 15:03:59,411] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:03:59,412] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", - "[2024-04-10 15:03:59,412] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:03:59,412] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", - "[2024-04-10 15:03:59,412] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", - "[2024-04-10 15:03:59,412] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:03:59,412] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", - "[2024-04-10 15:03:59,412] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", - "[2024-04-10 15:03:59,412] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[2024-04-10 15:03:59,498] [INFO] (app.AISpleenSegApp) - End run\n" - ] - } - ], - "source": [ - "!rm -rf $HOLOSCAN_OUTPUT_PATH\n", - "!python my_app -i dcm -o output -m models" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "1.2.826.0.1.3680043.10.511.3.39077956786032602526223766812104927.dcm stl\n" - ] - } - ], - "source": [ - "!ls output" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Packaging app\n", - "\n", - "Let's package the app with [MONAI Application Packager](/developing_with_sdk/packaging_app).\n", - "\n", - "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." - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing my_app/app.yaml\n" - ] - } - ], - "source": [ - "%%writefile my_app/app.yaml\n", - "%YAML 1.2\n", - "---\n", - "application:\n", - " title: MONAI Deploy App Package - MONAI Bundle AI App\n", - " version: 1.0\n", - " inputFormats: [\"file\"]\n", - " outputFormats: [\"file\"]\n", - "\n", - "resources:\n", - " cpu: 1\n", - " gpu: 1\n", - " memory: 1Gi\n", - " gpuMemory: 6Gi" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing my_app/requirements.txt\n" - ] - } - ], - "source": [ - "%%writefile my_app/requirements.txt\n", - "highdicom>=0.18.2\n", - "monai>=1.0\n", - "nibabel>=3.2.1\n", - "numpy>=1.21.6\n", - "pydicom>=2.3.0\n", - "setuptools>=59.5.0 # for pkg_resources\n", - "SimpleITK>=2.0.0\n", - "torch>=1.12.0" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now we can use the CLI package command to build the MONAI Application Package (MAP) container image based on a supported base image.\n", - "\n", - ":::{note}\n", - "Building a MONAI Application Package (Docker image) can take time. Use `-l DEBUG` option to see the progress.\n", - ":::" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2024-04-10 15:04:01,696] [INFO] (packager.parameters) - Application: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/my_app\n", - "[2024-04-10 15:04:01,697] [INFO] (packager.parameters) - Detected application type: Python Module\n", - "[2024-04-10 15:04:01,697] [INFO] (packager) - Scanning for models in /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models...\n", - "[2024-04-10 15:04:01,697] [DEBUG] (packager) - Model model=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/models/model added.\n", - "[2024-04-10 15:04:01,697] [INFO] (packager) - Reading application configuration from /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/my_app/app.yaml...\n", - "[2024-04-10 15:04:01,701] [INFO] (packager) - Generating app.json...\n", - "[2024-04-10 15:04:01,701] [INFO] (packager) - Generating pkg.json...\n", - "[2024-04-10 15:04:01,714] [DEBUG] (common) - \n", - "=============== Begin app.json ===============\n", - "{\n", - " \"apiVersion\": \"1.0.0\",\n", - " \"command\": \"[\\\"python3\\\", \\\"/opt/holoscan/app\\\"]\",\n", - " \"environment\": {\n", - " \"HOLOSCAN_APPLICATION\": \"/opt/holoscan/app\",\n", - " \"HOLOSCAN_INPUT_PATH\": \"input/\",\n", - " \"HOLOSCAN_OUTPUT_PATH\": \"output/\",\n", - " \"HOLOSCAN_WORKDIR\": \"/var/holoscan\",\n", - " \"HOLOSCAN_MODEL_PATH\": \"/opt/holoscan/models\",\n", - " \"HOLOSCAN_CONFIG_PATH\": \"/var/holoscan/app.yaml\",\n", - " \"HOLOSCAN_APP_MANIFEST_PATH\": \"/etc/holoscan/app.json\",\n", - " \"HOLOSCAN_PKG_MANIFEST_PATH\": \"/etc/holoscan/pkg.json\",\n", - " \"HOLOSCAN_DOCS_PATH\": \"/opt/holoscan/docs\",\n", - " \"HOLOSCAN_LOGS_PATH\": \"/var/holoscan/logs\"\n", - " },\n", - " \"input\": {\n", - " \"path\": \"input/\",\n", - " \"formats\": null\n", - " },\n", - " \"liveness\": null,\n", - " \"output\": {\n", - " \"path\": \"output/\",\n", - " \"formats\": null\n", - " },\n", - " \"readiness\": null,\n", - " \"sdk\": \"monai-deploy\",\n", - " \"sdkVersion\": \"0.5.1\",\n", - " \"timeout\": 0,\n", - " \"version\": 1.0,\n", - " \"workingDirectory\": \"/var/holoscan\"\n", - "}\n", - "================ End app.json ================\n", - " \n", - "[2024-04-10 15:04:01,715] [DEBUG] (common) - \n", - "=============== Begin pkg.json ===============\n", - "{\n", - " \"apiVersion\": \"1.0.0\",\n", - " \"applicationRoot\": \"/opt/holoscan/app\",\n", - " \"modelRoot\": \"/opt/holoscan/models\",\n", - " \"models\": {\n", - " \"model\": \"/opt/holoscan/models/model\"\n", - " },\n", - " \"resources\": {\n", - " \"cpu\": 1,\n", - " \"gpu\": 1,\n", - " \"memory\": \"1Gi\",\n", - " \"gpuMemory\": \"6Gi\"\n", - " },\n", - " \"version\": 1.0,\n", - " \"platformConfig\": \"dgpu\"\n", - "}\n", - "================ End pkg.json ================\n", - " \n", - "[2024-04-10 15:04:01,749] [DEBUG] (packager.builder) - \n", - "========== Begin Dockerfile ==========\n", - "\n", - "\n", - "FROM nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "\n", - "ENV DEBIAN_FRONTEND=noninteractive\n", - "ENV TERM=xterm-256color\n", - "\n", - "ARG UNAME\n", - "ARG UID\n", - "ARG GID\n", - "\n", - "RUN mkdir -p /etc/holoscan/ \\\n", - " && mkdir -p /opt/holoscan/ \\\n", - " && mkdir -p /var/holoscan \\\n", - " && mkdir -p /opt/holoscan/app \\\n", - " && mkdir -p /var/holoscan/input \\\n", - " && mkdir -p /var/holoscan/output\n", - "\n", - "LABEL base=\"nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\"\n", - "LABEL tag=\"my_app:1.0\"\n", - "LABEL org.opencontainers.image.title=\"MONAI Deploy App Package - MONAI Bundle AI App\"\n", - "LABEL org.opencontainers.image.version=\"1.0\"\n", - "LABEL org.nvidia.holoscan=\"1.0.3\"\n", - "LABEL org.monai.deploy.app-sdk=\"0.5.1\"\n", - "\n", - "\n", - "ENV HOLOSCAN_ENABLE_HEALTH_CHECK=true\n", - "ENV HOLOSCAN_INPUT_PATH=/var/holoscan/input\n", - "ENV HOLOSCAN_OUTPUT_PATH=/var/holoscan/output\n", - "ENV HOLOSCAN_WORKDIR=/var/holoscan\n", - "ENV HOLOSCAN_APPLICATION=/opt/holoscan/app\n", - "ENV HOLOSCAN_TIMEOUT=0\n", - "ENV HOLOSCAN_MODEL_PATH=/opt/holoscan/models\n", - "ENV HOLOSCAN_DOCS_PATH=/opt/holoscan/docs\n", - "ENV HOLOSCAN_CONFIG_PATH=/var/holoscan/app.yaml\n", - "ENV HOLOSCAN_APP_MANIFEST_PATH=/etc/holoscan/app.json\n", - "ENV HOLOSCAN_PKG_MANIFEST_PATH=/etc/holoscan/pkg.json\n", - "ENV HOLOSCAN_LOGS_PATH=/var/holoscan/logs\n", - "ENV PATH=/root/.local/bin:/opt/nvidia/holoscan:$PATH\n", - "ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/libtorch/1.13.1/lib/:/opt/nvidia/holoscan/lib\n", - "\n", - "RUN apt-get update \\\n", - " && apt-get install -y curl jq \\\n", - " && rm -rf /var/lib/apt/lists/*\n", - "\n", - "ENV PYTHONPATH=\"/opt/holoscan/app:$PYTHONPATH\"\n", - "\n", - "\n", - "\n", - "RUN groupadd -f -g $GID $UNAME\n", - "RUN useradd -rm -d /home/$UNAME -s /bin/bash -g $GID -G sudo -u $UID $UNAME\n", - "RUN chown -R holoscan /var/holoscan \n", - "RUN chown -R holoscan /var/holoscan/input \n", - "RUN chown -R holoscan /var/holoscan/output \n", - "\n", - "# Set the working directory\n", - "WORKDIR /var/holoscan\n", - "\n", - "# Copy HAP/MAP tool script\n", - "COPY ./tools /var/holoscan/tools\n", - "RUN chmod +x /var/holoscan/tools\n", - "\n", - "\n", - "# Copy gRPC health probe\n", - "\n", - "USER $UNAME\n", - "\n", - "ENV PATH=/root/.local/bin:/home/holoscan/.local/bin:/opt/nvidia/holoscan:$PATH\n", - "\n", - "COPY ./pip/requirements.txt /tmp/requirements.txt\n", - "\n", - "RUN pip install --upgrade pip\n", - "RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", - "\n", - "# Install Holoscan from PyPI only when sdk_type is Holoscan. \n", - "# For MONAI Deploy, the APP SDK will install it unless user specifies the Holoscan SDK file.\n", - "\n", - "# Copy user-specified MONAI Deploy SDK file\n", - "COPY ./monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "\n", - "\n", - "\n", - "\n", - "COPY ./models /opt/holoscan/models\n", - "\n", - "COPY ./map/app.json /etc/holoscan/app.json\n", - "COPY ./app.config /var/holoscan/app.yaml\n", - "COPY ./map/pkg.json /etc/holoscan/pkg.json\n", - "\n", - "COPY ./app /opt/holoscan/app\n", - "\n", - "ENTRYPOINT [\"/var/holoscan/tools\"]\n", - "=========== End Dockerfile ===========\n", - "\n", - "[2024-04-10 15:04:01,749] [INFO] (packager.builder) - \n", - "===============================================================================\n", - "Building image for: x64-workstation\n", - " Architecture: linux/amd64\n", - " Base Image: nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - " Build Image: N/A\n", - " Cache: Enabled\n", - " Configuration: dgpu\n", - " Holoscan SDK Package: pypi.org\n", - " MONAI Deploy App SDK Package: /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - " gRPC Health Probe: N/A\n", - " SDK Version: 1.0.3\n", - " SDK: monai-deploy\n", - " Tag: my_app-x64-workstation-dgpu-linux-amd64:1.0\n", - " \n", - "[2024-04-10 15:04:02,349] [INFO] (common) - Using existing Docker BuildKit builder `holoscan_app_builder`\n", - "[2024-04-10 15:04:02,349] [DEBUG] (packager.builder) - Building Holoscan Application Package: tag=my_app-x64-workstation-dgpu-linux-amd64:1.0\n", - "#0 building with \"holoscan_app_builder\" instance using docker-container driver\n", - "\n", - "#1 [internal] load build definition from Dockerfile\n", - "#1 transferring dockerfile: 2.80kB done\n", - "#1 DONE 0.1s\n", - "\n", - "#2 [internal] load metadata for nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#2 DONE 0.4s\n", - "\n", - "#3 [internal] load .dockerignore\n", - "#3 transferring context: 1.79kB done\n", - "#3 DONE 0.1s\n", - "\n", - "#4 [internal] load build context\n", - "#4 DONE 0.0s\n", - "\n", - "#5 importing cache manifest from local:18341943591062161743\n", - "#5 inferred cache manifest type: application/vnd.oci.image.index.v1+json done\n", - "#5 DONE 0.0s\n", - "\n", - "#6 [ 1/21] FROM nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu@sha256:50343c616bf910e2a7651abb59db7833933e82cce64c3c4885f938d7e4af6155\n", - "#6 resolve nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu@sha256:50343c616bf910e2a7651abb59db7833933e82cce64c3c4885f938d7e4af6155 0.0s done\n", - "#6 DONE 0.1s\n", - "\n", - "#7 importing cache manifest from nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#7 inferred cache manifest type: application/vnd.docker.distribution.manifest.list.v2+json done\n", - "#7 DONE 0.7s\n", - "\n", - "#4 [internal] load build context\n", - "#4 transferring context: 19.56MB 0.1s done\n", - "#4 DONE 0.2s\n", - "\n", - "#8 [ 8/21] RUN chown -R holoscan /var/holoscan/output\n", - "#8 CACHED\n", - "\n", - "#9 [13/21] RUN pip install --upgrade pip\n", - "#9 CACHED\n", - "\n", - "#10 [ 4/21] RUN groupadd -f -g 1000 holoscan\n", - "#10 CACHED\n", - "\n", - "#11 [ 5/21] RUN useradd -rm -d /home/holoscan -s /bin/bash -g 1000 -G sudo -u 1000 holoscan\n", - "#11 CACHED\n", - "\n", - "#12 [10/21] COPY ./tools /var/holoscan/tools\n", - "#12 CACHED\n", - "\n", - "#13 [ 6/21] RUN chown -R holoscan /var/holoscan\n", - "#13 CACHED\n", - "\n", - "#14 [ 2/21] RUN mkdir -p /etc/holoscan/ && mkdir -p /opt/holoscan/ && mkdir -p /var/holoscan && mkdir -p /opt/holoscan/app && mkdir -p /var/holoscan/input && mkdir -p /var/holoscan/output\n", - "#14 CACHED\n", - "\n", - "#15 [12/21] COPY ./pip/requirements.txt /tmp/requirements.txt\n", - "#15 CACHED\n", - "\n", - "#16 [ 9/21] WORKDIR /var/holoscan\n", - "#16 CACHED\n", - "\n", - "#17 [ 7/21] RUN chown -R holoscan /var/holoscan/input\n", - "#17 CACHED\n", - "\n", - "#18 [11/21] RUN chmod +x /var/holoscan/tools\n", - "#18 CACHED\n", - "\n", - "#19 [ 3/21] RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*\n", - "#19 CACHED\n", - "\n", - "#20 [14/21] RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", - "#20 CACHED\n", - "\n", - "#21 [15/21] COPY ./monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "#21 DONE 0.2s\n", - "\n", - "#22 [16/21] RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "#22 0.845 Defaulting to user installation because normal site-packages is not writeable\n", - "#22 0.979 Processing /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "#22 0.993 Requirement already satisfied: numpy>=1.21.6 in /usr/local/lib/python3.10/dist-packages (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (1.23.5)\n", - "#22 1.183 Collecting holoscan~=1.0 (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.336 Downloading holoscan-1.0.3-cp310-cp310-manylinux_2_35_x86_64.whl.metadata (4.1 kB)\n", - "#22 1.412 Collecting colorama>=0.4.1 (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.416 Downloading colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)\n", - "#22 1.507 Collecting typeguard>=3.0.0 (from monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.512 Downloading typeguard-4.2.1-py3-none-any.whl.metadata (3.7 kB)\n", - "#22 1.611 Collecting pip==23.3.2 (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.615 Downloading pip-23.3.2-py3-none-any.whl.metadata (3.5 kB)\n", - "#22 1.632 Requirement already satisfied: cupy-cuda12x==12.2 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (12.2.0)\n", - "#22 1.635 Requirement already satisfied: cloudpickle==2.2.1 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2.2.1)\n", - "#22 1.638 Requirement already satisfied: python-on-whales==0.60.1 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (0.60.1)\n", - "#22 1.641 Requirement already satisfied: Jinja2==3.1.2 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.1.2)\n", - "#22 1.643 Requirement already satisfied: packaging==23.1 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (23.1)\n", - "#22 1.644 Requirement already satisfied: pyyaml==6.0 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (6.0)\n", - "#22 1.645 Requirement already satisfied: requests==2.28.2 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2.28.2)\n", - "#22 1.646 Requirement already satisfied: psutil==5.9.6 in /usr/local/lib/python3.10/dist-packages (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (5.9.6)\n", - "#22 1.757 Collecting wheel-axle-runtime<1.0 (from holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty)\n", - "#22 1.763 Downloading wheel_axle_runtime-0.0.5-py3-none-any.whl.metadata (7.7 kB)\n", - "#22 1.806 Requirement already satisfied: fastrlock>=0.5 in /usr/local/lib/python3.10/dist-packages (from cupy-cuda12x==12.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (0.8.2)\n", - "#22 1.813 Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from Jinja2==3.1.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2.1.3)\n", - "#22 1.829 Requirement already satisfied: pydantic<2,>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (1.10.14)\n", - "#22 1.829 Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (4.66.1)\n", - "#22 1.830 Requirement already satisfied: typer>=0.4.1 in /usr/local/lib/python3.10/dist-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (0.9.0)\n", - "#22 1.831 Requirement already satisfied: typing-extensions in /home/holoscan/.local/lib/python3.10/site-packages (from python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (4.10.0)\n", - "#22 1.839 Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.3.2)\n", - "#22 1.840 Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.6)\n", - "#22 1.841 Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (1.26.18)\n", - "#22 1.842 Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests==2.28.2->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (2023.11.17)\n", - "#22 1.860 Requirement already satisfied: filelock in /home/holoscan/.local/lib/python3.10/site-packages (from wheel-axle-runtime<1.0->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (3.13.3)\n", - "#22 1.895 Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.10/dist-packages (from typer>=0.4.1->python-on-whales==0.60.1->holoscan~=1.0->monai-deploy-app-sdk==0.5.1+25.g31e4165.dirty) (8.1.7)\n", - "#22 1.939 Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)\n", - "#22 3.052 Downloading holoscan-1.0.3-cp310-cp310-manylinux_2_35_x86_64.whl (33.6 MB)\n", - "#22 7.685 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 33.6/33.6 MB 7.3 MB/s eta 0:00:00\n", - "#22 7.692 Downloading pip-23.3.2-py3-none-any.whl (2.1 MB)\n", - "#22 7.738 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 52.2 MB/s eta 0:00:00\n", - "#22 7.745 Downloading typeguard-4.2.1-py3-none-any.whl (34 kB)\n", - "#22 7.771 Downloading wheel_axle_runtime-0.0.5-py3-none-any.whl (12 kB)\n", - "#22 8.166 Installing collected packages: wheel-axle-runtime, typeguard, pip, colorama, holoscan, monai-deploy-app-sdk\n", - "#22 8.245 Attempting uninstall: pip\n", - "#22 8.248 Found existing installation: pip 24.0\n", - "#22 8.310 Uninstalling pip-24.0:\n", - "#22 8.744 Successfully uninstalled pip-24.0\n", - "#22 10.41 Successfully installed colorama-0.4.6 holoscan-1.0.3 monai-deploy-app-sdk-0.5.1+25.g31e4165.dirty pip-23.3.2 typeguard-4.2.1 wheel-axle-runtime-0.0.5\n", - "#22 DONE 11.1s\n", - "\n", - "#23 [17/21] COPY ./models /opt/holoscan/models\n", - "#23 DONE 0.2s\n", - "\n", - "#24 [18/21] COPY ./map/app.json /etc/holoscan/app.json\n", - "#24 DONE 0.1s\n", - "\n", - "#25 [19/21] COPY ./app.config /var/holoscan/app.yaml\n", - "#25 DONE 0.1s\n", - "\n", - "#26 [20/21] COPY ./map/pkg.json /etc/holoscan/pkg.json\n", - "#26 DONE 0.1s\n", - "\n", - "#27 [21/21] COPY ./app /opt/holoscan/app\n", - "#27 DONE 0.1s\n", - "\n", - "#28 exporting to docker image format\n", - "#28 exporting layers\n", - "#28 exporting layers 6.0s done\n", - "#28 exporting manifest sha256:3b3b2102892c64900945ca4d84a328af1fb7350c84cb4d85ecee3b94f48ed85c 0.0s done\n", - "#28 exporting config sha256:d6463325d6640490c117da76b90d02687331b2ee1e486047f7c4c968023c3d89 0.0s done\n", - "#28 sending tarball\n", - "#28 ...\n", - "\n", - "#29 importing to docker\n", - "#29 loading layer a292666cef7b 32.77kB / 125.57kB\n", - "#29 loading layer 23d575e38e71 557.06kB / 73.97MB\n", - "#29 loading layer 23d575e38e71 71.86MB / 73.97MB 2.2s\n", - "#29 loading layer 601aae96dba4 196.61kB / 17.81MB\n", - "#29 loading layer 8973e59624ba 492B / 492B\n", - "#29 loading layer 2c4cefc4de42 313B / 313B\n", - "#29 loading layer 450f1c5db7b9 301B / 301B\n", - "#29 loading layer e08583daa6d7 3.30kB / 3.30kB\n", - "#29 loading layer 2c4cefc4de42 313B / 313B 1.4s done\n", - "#29 loading layer a292666cef7b 32.77kB / 125.57kB 4.5s done\n", - "#29 loading layer 23d575e38e71 71.86MB / 73.97MB 4.4s done\n", - "#29 loading layer 601aae96dba4 196.61kB / 17.81MB 1.8s done\n", - "#29 loading layer 8973e59624ba 492B / 492B 1.5s done\n", - "#29 loading layer 450f1c5db7b9 301B / 301B 1.4s done\n", - "#29 loading layer e08583daa6d7 3.30kB / 3.30kB 1.3s done\n", - "#29 DONE 4.5s\n", - "\n", - "#28 exporting to docker image format\n", - "#28 sending tarball 67.2s done\n", - "#28 DONE 73.2s\n", - "\n", - "#30 exporting cache to client directory\n", - "#30 preparing build cache for export\n", - "#30 writing layer sha256:00bb4c1319ba1a33ac3edcb3aa1240d8abcb8d0383c6267ed8028d3b6228a8a4\n", - "#30 writing layer sha256:00bb4c1319ba1a33ac3edcb3aa1240d8abcb8d0383c6267ed8028d3b6228a8a4 done\n", - "#30 writing layer sha256:014cff740c9ec6e9a30d0b859219a700ae880eb385d62095d348f5ea136d6015 done\n", - "#30 writing layer sha256:0a1756432df4a4350712d8ae5c003f1526bd2180800b3ae6301cfc9ccf370254 done\n", - "#30 writing layer sha256:0a77dcbd0e648ddc4f8e5230ade8fdb781d99e24fa4f13ca96a360c7f7e6751f done\n", - "#30 writing layer sha256:0bf3a16e4f3f9ec99796b99e331a5c62472bc9377925e1fdc05f64709ed09895 0.0s done\n", - "#30 writing layer sha256:0ec682bf99715a9f88631226f3749e2271b8b9f254528ef61f65ed829984821c done\n", - "#30 writing layer sha256:1133dfcee0e851b490d17b3567f50c4b25ba5750da02ba4b3f3630655d0b1a7b done\n", - "#30 writing layer sha256:1294b2835667d633f938174d9fecb18a60bbbebb6fb49788a1f939893a25d1af done\n", - "#30 writing layer sha256:16a03c6e0373b62f9713416da0229bb7ce2585183141081d3ea8427ad2e84408 done\n", - "#30 writing layer sha256:183aa7032b52e859f5de3dac98da7c8398ed5f8a984d74865561f126c0eecef2 0.0s done\n", - "#30 writing layer sha256:20d331454f5fb557f2692dfbdbe092c718fd2cb55d5db9d661b62228dacca5c2 done\n", - "#30 writing layer sha256:2232aeb26b5b7ea57227e9a5b84da4fb229624d7bc976a5f7ce86d9c8653d277 done\n", - "#30 writing layer sha256:238f69a43816e481f0295995fcf5fe74d59facf0f9f99734c8d0a2fb140630e0 done\n", - "#30 writing layer sha256:2ad84487f9d4d31cd1e0a92697a5447dd241935253d036b272ef16d31620c1e7 done\n", - "#30 writing layer sha256:2bb73464628bd4a136c4937f42d522c847bea86b2215ae734949e24c1caf450e done\n", - "#30 writing layer sha256:3e3e04011ebdba380ab129f0ee390626cb2a600623815ca756340c18bedb9517 done\n", - "#30 writing layer sha256:42619ce4a0c9e54cfd0ee41a8e5f27d58b3f51becabd1ac6de725fbe6c42b14a done\n", - "#30 writing layer sha256:43a21fb6c76bd2b3715cc09d9f8c3865dc61c51dd9e2327b429f5bec8fff85d1 done\n", - "#30 writing layer sha256:4482079b5d33963eb55191bf404b70095535d4a8e2b64dab7373500515f896b4\n", - "#30 writing layer sha256:4482079b5d33963eb55191bf404b70095535d4a8e2b64dab7373500515f896b4 0.4s done\n", - "#30 writing layer sha256:49bdc9abf8a437ccff67cc11490ba52c976577992909856a86be872a34d3b950\n", - "#30 writing layer sha256:49bdc9abf8a437ccff67cc11490ba52c976577992909856a86be872a34d3b950 done\n", - "#30 writing layer sha256:4b691ba9f48b41eaa0c754feba8366f1c030464fcbc55eeffa6c86675990933a done\n", - "#30 writing layer sha256:4d04a8db404f16c2704fa10739cb6745a0187713a21a6ef0deb34b48629b54c1 done\n", - "#30 writing layer sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 done\n", - "#30 writing layer sha256:5275a41be8f6691a490c0a15589e0910c73bf971169ad33a850ef570d37f63dd done\n", - "#30 writing layer sha256:52fbfeaf78318d843054ce2bfb5bfc9f71278939a815f6035ab5b14573ad017b done\n", - "#30 writing layer sha256:5792b18b6f162bae61ff5840cdb9e8567e6847a56ac886f940b47e7271c529a7 done\n", - "#30 writing layer sha256:57f244836ad318f9bbb3b29856ae1a5b31038bfbb9b43d2466d51c199eb55041 done\n", - "#30 writing layer sha256:5b5b131e0f20db4cb8e568b623a95f8fc16ed1c6b322a9366df70b59a881f24f done\n", - "#30 writing layer sha256:5ccb787d371fd3697122101438ddd0f55b537832e9756d2c51ab1d8158710ac5 done\n", - "#30 writing layer sha256:5ea668ffc2fc267d241dbf17ca283bc879643a189be4f7e3d9034a82fc64a1ea done\n", - "#30 writing layer sha256:62452179df7c18e292f141d4aec29e6aba9ff8270c893731169fc6f41dc07631 done\n", - "#30 writing layer sha256:6630c387f5f2115bca2e646fd0c2f64e1f3d5431c2e050abe607633883eda230 done\n", - "#30 writing layer sha256:69af4b756272a77f683a8d118fd5ca55c03ad5f1bacc673b463f54d16b833da5 done\n", - "#30 writing layer sha256:6ae1f1fb92c0cb2b6e219f687b08c8e511501a7af696c943ca20d119eba7cd02 done\n", - "#30 writing layer sha256:6deb3d550b15a5e099c0b3d0cbc242e351722ca16c058d3a6c28ba1a02824d0f done\n", - "#30 writing layer sha256:6e80a527af94a864094c4f9116c2d29d3d7548ec8388579d9cf3f8a39a4b8178\n", - "#30 writing layer sha256:6e80a527af94a864094c4f9116c2d29d3d7548ec8388579d9cf3f8a39a4b8178 1.3s done\n", - "#30 writing layer sha256:7386814d57100e2c7389fbf4e16f140f5c549d31434c62c3884a85a3ee5cd2a7\n", - "#30 writing layer sha256:7386814d57100e2c7389fbf4e16f140f5c549d31434c62c3884a85a3ee5cd2a7 done\n", - "#30 writing layer sha256:7852b73ea931e3a8d3287ee7ef3cf4bad068e44f046583bfc2b81336fb299284 done\n", - "#30 writing layer sha256:7e73869c74822e4539e104a3d2aff853f4622cd0bb873576db1db53c9e91f621 done\n", - "#30 writing layer sha256:7eae142b38745fe88962874372374deb672998600264a17e638c010b79e6b535 done\n", - "#30 writing layer sha256:7f2e5ab2c599fa36698918d3e73c991d8616fff9037077cd230529e7cd1c5e0e done\n", - "#30 writing layer sha256:82a3436133b2b17bb407c7fe488932aa0ca55411f23ab55c34a6134b287c6a27 done\n", - "#30 writing layer sha256:90eae6faa5cc5ba62f12c25915cdfb1a7a51abfba0d05cb5818c3f908f4e345f done\n", - "#30 writing layer sha256:9ac855545fa90ed2bf3b388fdff9ef06ac9427b0c0fca07c9e59161983d8827e done\n", - "#30 writing layer sha256:9d19ee268e0d7bcf6716e6658ee1b0384a71d6f2f9aa1ae2085610cf7c7b316f done\n", - "#30 writing layer sha256:a10c8d7d2714eabf661d1f43a1ccb87a51748cbb9094d5bc0b713e2481b5d329 done\n", - "#30 writing layer sha256:a1748eee9d376f97bd19225ba61dfada9986f063f4fc429e435f157abb629fc6 done\n", - "#30 writing layer sha256:a68f4e0ec09ec3b78cb4cf8e4511d658e34e7b6f676d7806ad9703194ff17604 done\n", - "#30 writing layer sha256:a8e4decc8f7289623b8fd7b9ba1ca555b5a755ebdbf81328d68209f148d9e602 done\n", - "#30 writing layer sha256:afde1c269453ce68a0f2b54c1ba8c5ecddeb18a19e5618a4acdef1f0fe3921af done\n", - "#30 writing layer sha256:b48a5fafcaba74eb5d7e7665601509e2889285b50a04b5b639a23f8adc818157 done\n", - "#30 writing layer sha256:ba9f7c75e4dd7942b944679995365aab766d3677da2e69e1d74472f471a484dd done\n", - "#30 writing layer sha256:bc42865e1c27a9b1bee751f3c99ad2c12a906d32aca396ace7a07231c9cafbd1 done\n", - "#30 writing layer sha256:bdfc73b2a0fa11b4086677e117a2f9feb6b4ffeccb23a3d58a30543339607e31 done\n", - "#30 writing layer sha256:c175bb235295e50de2961fa1e1a2235c57e6eba723a914287dfc26d3be0eac11 done\n", - "#30 writing layer sha256:c98533d2908f36a5e9b52faae83809b3b6865b50e90e2817308acfc64cd3655f done\n", - "#30 writing layer sha256:cb6c95b33bc30dd285c5b3cf99a05281b8f12decae1c932ab64bd58f56354021 done\n", - "#30 writing layer sha256:d6b5d6e098aacb316146a428c6b5aef9692011c6dce0932e3bbfbf27a514b7ed done\n", - "#30 writing layer sha256:d7da5c5e9a40c476c4b3188a845e3276dedfd752e015ea5113df5af64d4d43f7 done\n", - "#30 writing layer sha256:e4297ff4df6f7a8f25cb109e5b24483c314c2e72b8e824f9669173919fc159c9 0.0s done\n", - "#30 writing layer sha256:e4aedc686433c0ec5e676e6cc54a164345f7016aa0eb714f00c07e11664a1168 done\n", - "#30 writing layer sha256:e5d9fee7e7dacd6052fe7c78ac5738f1fb693aa068f7c6064c70e98941288a52 0.0s done\n", - "#30 writing layer sha256:e8640a108802cd7519cc53dceb74f7a5c94b562662f1c3c040c2aa6571acf0f3 0.0s done\n", - "#30 writing layer sha256:e8acb678f16bc0c369d5cf9c184f2d3a1c773986816526e5e3e9c0354f7e757f\n", - "#30 preparing build cache for export 2.5s done\n", - "#30 writing layer sha256:e8acb678f16bc0c369d5cf9c184f2d3a1c773986816526e5e3e9c0354f7e757f done\n", - "#30 writing layer sha256:e9225f7ab6606813ec9acba98a064826ebfd6713a9645a58cd068538af1ecddb done\n", - "#30 writing layer sha256:f33546e75bf1a7d9dc9e21b9a2c54c9d09b24790ad7a4192a8509002ceb14688 done\n", - "#30 writing layer sha256:f608e2fbff86e98627b7e462057e7d2416522096d73fe4664b82fe6ce8a4047d done\n", - "#30 writing layer sha256:f7702077ced42a1ee35e7f5e45f72634328ff3bcfe3f57735ba80baa5ec45daf done\n", - "#30 writing layer sha256:fa66a49172c6e821a1bace57c007c01da10cbc61507c44f8cdfeed8c4e5febab done\n", - "#30 writing config sha256:386c66fca187580548b7c0d95c25fecfb72f326f30df509c9860b977d7e32763 0.0s done\n", - "#30 writing cache manifest sha256:ebd62b21fd87e8654814f8093dffbbf555dced752810b2798c59b2b1a08ce0fd 0.0s done\n", - "#30 DONE 2.5s\n", - "[2024-04-10 15:05:33,378] [INFO] (packager) - Build Summary:\n", - "\n", - "Platform: x64-workstation/dgpu\n", - " Status: Succeeded\n", - " Docker Tag: my_app-x64-workstation-dgpu-linux-amd64:1.0\n", - " Tarball: None\n" - ] - } - ], - "source": [ - "tag_prefix = \"my_app\"\n", - "\n", - "!monai-deploy package my_app -m {models_folder} -c my_app/app.yaml -t {tag_prefix}:1.0 --platform x64-workstation -l DEBUG" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We can see that the MAP Docker image is created" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "my_app-x64-workstation-dgpu-linux-amd64 1.0 d6463325d664 About a minute ago 17.5GB\n" - ] - } - ], - "source": [ - "!docker image ls | grep {tag_prefix}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We can choose to display and inspect the MAP manifests by running the container with the `show` command.\n", - "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).\n", - "\n", - ":::{note}\n", - "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.\n", - ":::" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Display manifests and extract MAP contents to the host folder, ./export\n", - "\n", - "============================== app.json ==============================\n", - "{\n", - " \"apiVersion\": \"1.0.0\",\n", - " \"command\": \"[\\\"python3\\\", \\\"/opt/holoscan/app\\\"]\",\n", - " \"environment\": {\n", - " \"HOLOSCAN_APPLICATION\": \"/opt/holoscan/app\",\n", - " \"HOLOSCAN_INPUT_PATH\": \"input/\",\n", - " \"HOLOSCAN_OUTPUT_PATH\": \"output/\",\n", - " \"HOLOSCAN_WORKDIR\": \"/var/holoscan\",\n", - " \"HOLOSCAN_MODEL_PATH\": \"/opt/holoscan/models\",\n", - " \"HOLOSCAN_CONFIG_PATH\": \"/var/holoscan/app.yaml\",\n", - " \"HOLOSCAN_APP_MANIFEST_PATH\": \"/etc/holoscan/app.json\",\n", - " \"HOLOSCAN_PKG_MANIFEST_PATH\": \"/etc/holoscan/pkg.json\",\n", - " \"HOLOSCAN_DOCS_PATH\": \"/opt/holoscan/docs\",\n", - " \"HOLOSCAN_LOGS_PATH\": \"/var/holoscan/logs\"\n", - " },\n", - " \"input\": {\n", - " \"path\": \"input/\",\n", - " \"formats\": null\n", - " },\n", - " \"liveness\": null,\n", - " \"output\": {\n", - " \"path\": \"output/\",\n", - " \"formats\": null\n", - " },\n", - " \"readiness\": null,\n", - " \"sdk\": \"monai-deploy\",\n", - " \"sdkVersion\": \"0.5.1\",\n", - " \"timeout\": 0,\n", - " \"version\": 1,\n", - " \"workingDirectory\": \"/var/holoscan\"\n", - "}\n", - "\n", - "============================== pkg.json ==============================\n", - "{\n", - " \"apiVersion\": \"1.0.0\",\n", - " \"applicationRoot\": \"/opt/holoscan/app\",\n", - " \"modelRoot\": \"/opt/holoscan/models\",\n", - " \"models\": {\n", - " \"model\": \"/opt/holoscan/models/model\"\n", - " },\n", - " \"resources\": {\n", - " \"cpu\": 1,\n", - " \"gpu\": 1,\n", - " \"memory\": \"1Gi\",\n", - " \"gpuMemory\": \"6Gi\"\n", - " },\n", - " \"version\": 1,\n", - " \"platformConfig\": \"dgpu\"\n", - "}\n", - "\n", - "2024-04-10 22:05:37 [INFO] Copying application from /opt/holoscan/app to /var/run/holoscan/export/app\n", - "\n", - "2024-04-10 22:05:37 [INFO] Copying application manifest file from /etc/holoscan/app.json to /var/run/holoscan/export/config/app.json\n", - "2024-04-10 22:05:37 [INFO] Copying pkg manifest file from /etc/holoscan/pkg.json to /var/run/holoscan/export/config/pkg.json\n", - "2024-04-10 22:05:37 [INFO] Copying application configuration from /var/holoscan/app.yaml to /var/run/holoscan/export/config/app.yaml\n", - "\n", - "2024-04-10 22:05:37 [INFO] Copying models from /opt/holoscan/models to /var/run/holoscan/export/models\n", - "\n", - "2024-04-10 22:05:37 [INFO] Copying documentation from /opt/holoscan/docs/ to /var/run/holoscan/export/docs\n", - "2024-04-10 22:05:37 [INFO] '/opt/holoscan/docs/' cannot be found.\n", - "\n", - "app config models\n" - ] - } - ], - "source": [ - "!echo \"Display manifests and extract MAP contents to the host folder, ./export\"\n", - "!docker run --rm {tag_prefix}-x64-workstation-dgpu-linux-amd64:1.0 show\n", - "!rm -rf `pwd`/export && mkdir -p `pwd`/export\n", - "!docker run --rm -v `pwd`/export/:/var/run/holoscan/export/ {tag_prefix}-x64-workstation-dgpu-linux-amd64:1.0 extract\n", - "!ls `pwd`/export" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Executing packaged app locally\n", - "\n", - "The packaged app can be run locally through [MONAI Application Runner](/developing_with_sdk/executing_packaged_app_locally)." - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2024-04-10 15:05:39,448] [INFO] (runner) - Checking dependencies...\n", - "[2024-04-10 15:05:39,448] [INFO] (runner) - --> Verifying if \"docker\" is installed...\n", - "\n", - "[2024-04-10 15:05:39,449] [INFO] (runner) - --> Verifying if \"docker-buildx\" is installed...\n", - "\n", - "[2024-04-10 15:05:39,449] [INFO] (runner) - --> Verifying if \"my_app-x64-workstation-dgpu-linux-amd64:1.0\" is available...\n", - "\n", - "[2024-04-10 15:05:39,511] [INFO] (runner) - Reading HAP/MAP manifest...\n", - "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.56kB to /tmp/tmpba1clh6t/app.json\n", - "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.05kB to /tmp/tmpba1clh6t/pkg.json\n", - "[2024-04-10 15:05:39,743] [INFO] (runner) - --> Verifying if \"nvidia-ctk\" is installed...\n", - "\n", - "[2024-04-10 15:05:39,744] [INFO] (runner) - --> Verifying \"nvidia-ctk\" version...\n", - "\n", - "[2024-04-10 15:05:40,086] [INFO] (common) - Launching container (1d77a7676232) using image 'my_app-x64-workstation-dgpu-linux-amd64:1.0'...\n", - " container name: festive_hermann\n", - " host name: mingq-dt\n", - " network: host\n", - " user: 1000:1000\n", - " ulimits: memlock=-1:-1, stack=67108864:67108864\n", - " cap_add: CAP_SYS_PTRACE\n", - " ipc mode: host\n", - " shared memory size: 67108864\n", - " devices: \n", - " group_add: 44\n", - "2024-04-10 22:05:40 [INFO] Launching application python3 /opt/holoscan/app ...\n", - "\n", - "[2024-04-10 22:05:45,192] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['/opt/holoscan/app'])\n", - "\n", - "[2024-04-10 22:05:45,195] [INFO] (root) - AppContext object: AppContext(input_path=/var/holoscan/input, output_path=/var/holoscan/output, model_path=/opt/holoscan/models, workdir=/var/holoscan)\n", - "\n", - "[2024-04-10 22:05:45,197] [INFO] (root) - End compose\n", - "\n", - "[info] [app_driver.cpp:1161] Launching the driver/health checking service\n", - "\n", - "[info] [gxf_executor.cpp:211] Creating context\n", - "\n", - "[info] [server.cpp:87] Health checking server listening on 0.0.0.0:8777\n", - "\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", - "\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", - "\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", - "\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "\n", - "[info] [greedy_scheduler.cpp:190] Scheduling 8 entities\n", - "\n", - "[2024-04-10 22:05:45,297] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", - "\n", - "[2024-04-10 22:05:46,131] [INFO] (root) - Finding series for Selection named: CT Series\n", - "\n", - "[2024-04-10 22:05:46,131] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", - "\n", - " # of series: 1\n", - "\n", - "[2024-04-10 22:05:46,131] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "\n", - "[2024-04-10 22:05:46,131] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", - "\n", - "[2024-04-10 22:05:46,131] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", - "\n", - "[2024-04-10 22:05:46,131] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "\n", - "[2024-04-10 22:05:46,131] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", - "\n", - "[2024-04-10 22:05:46,131] [INFO] (root) - Series attribute Modality value: CT\n", - "\n", - "[2024-04-10 22:05:46,132] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "\n", - "[2024-04-10 22:05:46,132] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", - "\n", - "[2024-04-10 22:05:46,132] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", - "\n", - "[2024-04-10 22:05:46,132] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "\n", - "[2024-04-10 22:05:46,132] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "\n", - "[2024-04-10 22:05:46,349] [INFO] (root) - Parsing from bundle_path: /opt/holoscan/models/model/model.ts\n", - "\n", - "[2024-04-10 22:05:49,959] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConversionOperator) - Output will be saved in file /var/holoscan/output/stl/spleen.stl.\n", - "\n", - "[2024-04-10 22:05:51,433] [INFO] (monai.deploy.operators.stl_conversion_operator.SpatialImage) - 3D image\n", - "\n", - "[2024-04-10 22:05:51,433] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConverter) - Image ndarray shape:(204, 512, 512)\n", - "\n", - "Exception occurred in compute method of operator: 'stl_conversion_op'\n", - "\n", - "Traceback (most recent call last):\n", - "\n", - " File \"/home/holoscan/.local/lib/python3.10/site-packages/monai/deploy/operators/stl_conversion_operator.py\", line 118, in compute\n", - "\n", - " stl_bytes = self._convert(input_image, _output_file)\n", - "\n", - " File \"/home/holoscan/.local/lib/python3.10/site-packages/monai/deploy/operators/stl_conversion_operator.py\", line 135, in _convert\n", - "\n", - " return self._converter.convert(\n", - "\n", - " File \"/home/holoscan/.local/lib/python3.10/site-packages/monai/deploy/operators/stl_conversion_operator.py\", line 182, in convert\n", - "\n", - " nda = STLConverter.get_largest_cc(nda)\n", - "\n", - " File \"/home/holoscan/.local/lib/python3.10/site-packages/monai/deploy/operators/stl_conversion_operator.py\", line 255, in get_largest_cc\n", - "\n", - " labels = label(nda)\n", - "\n", - " File \"/home/holoscan/.local/lib/python3.10/site-packages/monai/deploy/utils/importutil.py\", line 274, in __call__\n", - "\n", - " raise self._exception\n", - "\n", - " File \"/home/holoscan/.local/lib/python3.10/site-packages/monai/deploy/utils/importutil.py\", line 226, in optional_import\n", - "\n", - " pkg = __import__(module) # top level module\n", - "\n", - "monai.deploy.utils.importutil.OptionalImportError: from skimage.measure import label (No module named 'skimage').\n", - "\n", - "\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - "\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n", - "/home/holoscan/.local/lib/python3.10/site-packages/highdicom/valuerep.py:54: UserWarning: The string \"C3N-00198\" is unlikely to represent the intended person name since it contains only a single component. Construct a person name according to the format in described in https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html#sect_6.2.1.2, or, in pydicom 2.2.0 or later, use the pydicom.valuerep.PersonName.from_named_components() method to construct the person name correctly. If a single-component name is really intended, add a trailing caret character to disambiguate the name.\n", - "\n", - " warnings.warn(\n", - "\n", - "[2024-04-10 22:05:52,708] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "\n", - "[2024-04-10 22:05:52,708] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", - "\n", - "[2024-04-10 22:05:52,708] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "\n", - "[2024-04-10 22:05:52,708] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", - "\n", - "[2024-04-10 22:05:52,709] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", - "\n", - "[2024-04-10 22:05:52,709] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "\n", - "[2024-04-10 22:05:52,709] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", - "\n", - "[2024-04-10 22:05:52,709] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", - "\n", - "[2024-04-10 22:05:52,709] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", - "\n", - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "\n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "\n", - "[2024-04-10 22:05:52,805] [INFO] (app.AISpleenSegApp) - End run\n", - "\n", - "[2024-04-10 15:05:54,069] [INFO] (common) - Container 'festive_hermann'(1d77a7676232) exited.\n" - ] - } - ], - "source": [ - "# Clear the output folder and run the MAP. The input is expected to be a folder.\n", - "!rm -rf $HOLOSCAN_OUTPUT_PATH\n", - "!monai-deploy run -i $HOLOSCAN_INPUT_PATH -o $HOLOSCAN_OUTPUT_PATH my_app-x64-workstation-dgpu-linux-amd64:1.0" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "1.2.826.0.1.3680043.10.511.3.33232544284800485207819891596585914.dcm stl\n" - ] - } - ], - "source": [ - "!ls $HOLOSCAN_OUTPUT_PATH" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3.8.10 ('.venv': venv)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.12" - }, - "vscode": { - "interpreter": { - "hash": "9b4ab1155d0cd1042497eb40fd55b2d15caf4b3c0f9fbfcc7ba4404045d40f12" - } - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/notebooks/tutorials/05_multi_model_app.ipynb b/notebooks/tutorials/05_multi_model_app.ipynb index 2b505888..bc9c152b 100644 --- a/notebooks/tutorials/05_multi_model_app.ipynb +++ b/notebooks/tutorials/05_multi_model_app.ipynb @@ -177,23 +177,20 @@ "text": [ "Requirement already satisfied: gdown in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (5.1.0)\n", "Requirement already satisfied: beautifulsoup4 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (4.12.3)\n", - "Requirement already satisfied: filelock in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (3.13.3)\n", - "Requirement already satisfied: requests[socks] in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (2.28.2)\n", + "Requirement already satisfied: filelock in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (3.13.4)\n", + "Requirement already satisfied: requests[socks] in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (2.31.0)\n", "Requirement already satisfied: tqdm in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from gdown) (4.66.2)\n", "Requirement already satisfied: soupsieve>1.2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from beautifulsoup4->gdown) (2.5)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.3.2)\n", - "Requirement already satisfied: idna<4,>=2.5 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.6)\n", - "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (1.26.18)\n", + "Requirement already satisfied: idna<4,>=2.5 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (3.7)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (2.2.1)\n", "Requirement already satisfied: certifi>=2017.4.17 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (2024.2.2)\n", "Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in /home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages (from requests[socks]->gdown) (1.7.1)\n", - "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.3.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.0\u001b[0m\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", "Downloading...\n", "From (original): https://drive.google.com/uc?id=1llJ4NGNTjY187RLX4MtlmHYhfGxBNWmd\n", - "From (redirected): https://drive.google.com/uc?id=1llJ4NGNTjY187RLX4MtlmHYhfGxBNWmd&confirm=t&uuid=63a55326-90b2-463a-9bdc-a115a7336f1c\n", + "From (redirected): https://drive.google.com/uc?id=1llJ4NGNTjY187RLX4MtlmHYhfGxBNWmd&confirm=t&uuid=ab4ce40d-d90b-4c62-a7e4-7187c04d0349\n", "To: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/ai_multi_model_bundle_data.zip\n", - "100%|█████████████████████████████████████████| 647M/647M [00:06<00:00, 105MB/s]\n", + "100%|████████████████████████████████████████| 647M/647M [00:08<00:00, 76.0MB/s]\n", "Archive: ai_multi_model_bundle_data.zip\n", " inflating: dcm/1-001.dcm \n", " inflating: dcm/1-002.dcm \n", @@ -747,59 +744,75 @@ "name": "stderr", "output_type": "stream", "text": [ - "[2024-04-10 15:07:47,589] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=[])\n", - "[2024-04-10 15:07:47,599] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=multi_models, workdir=)\n", - "[2024-04-10 15:07:47,604] [INFO] (root) - End compose\n", - "[info] [gxf_executor.cpp:211] Creating context\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[info] [greedy_scheduler.cpp:190] Scheduling 9 entities\n", - "[2024-04-10 15:07:47,665] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", - "[2024-04-10 15:07:48,220] [INFO] (root) - Finding series for Selection named: CT Series\n", - "[2024-04-10 15:07:48,221] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", + "[2024-04-22 15:53:34,724] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=[])\n", + "[2024-04-22 15:53:34,747] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=multi_models, workdir=)\n", + "[2024-04-22 15:53:34,755] [INFO] (root) - End compose\n", + "[info] [gxf_executor.cpp:247] Creating context\n", + "[info] [gxf_executor.cpp:1672] Loading extensions from configs...\n", + "[info] [gxf_executor.cpp:1842] Activating Graph...\n", + "[info] [gxf_executor.cpp:1874] Running Graph...\n", + "[info] [gxf_executor.cpp:1876] Waiting for completion...\n", + "[2024-04-22 15:53:34,798] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[0m2024-04-22 15:53:34.796 INFO gxf/std/greedy_scheduler.cpp@191: Scheduling 9 entities\u001b[0m\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[2024-04-22 15:53:35,338] [INFO] (root) - Finding series for Selection named: CT Series\n", + "[2024-04-22 15:53:35,339] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", " # of series: 1\n", - "[2024-04-10 15:07:48,222] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 15:07:48,223] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", - "[2024-04-10 15:07:48,224] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", - "[2024-04-10 15:07:48,227] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 15:07:48,228] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", - "[2024-04-10 15:07:48,228] [INFO] (root) - Series attribute Modality value: CT\n", - "[2024-04-10 15:07:48,229] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 15:07:48,230] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", - "[2024-04-10 15:07:48,231] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", - "[2024-04-10 15:07:48,232] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 15:07:48,233] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 15:07:48,452] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models/pancreas_ct_dints/model.ts\n", - "[2024-04-10 15:09:28,757] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models/spleen_ct/model.ts\n", + "[2024-04-22 15:53:35,340] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 15:53:35,340] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", + "[2024-04-22 15:53:35,341] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", + "[2024-04-22 15:53:35,342] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 15:53:35,344] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", + "[2024-04-22 15:53:35,346] [INFO] (root) - Series attribute Modality value: CT\n", + "[2024-04-22 15:53:35,347] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 15:53:35,348] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", + "[2024-04-22 15:53:35,349] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", + "[2024-04-22 15:53:35,350] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 15:53:35,351] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 15:53:35,588] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models/pancreas_ct_dints/model.ts\n", + "[2024-04-22 15:55:16,335] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models/spleen_ct/model.ts\n", "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/highdicom/valuerep.py:54: UserWarning: The string \"C3N-00198\" is unlikely to represent the intended person name since it contains only a single component. Construct a person name according to the format in described in https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html#sect_6.2.1.2, or, in pydicom 2.2.0 or later, use the pydicom.valuerep.PersonName.from_named_components() method to construct the person name correctly. If a single-component name is really intended, add a trailing caret character to disambiguate the name.\n", " warnings.warn(\n", - "[2024-04-10 15:09:34,244] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:09:34,246] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", - "[2024-04-10 15:09:34,247] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:09:34,248] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", - "[2024-04-10 15:09:34,249] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", - "[2024-04-10 15:09:34,250] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:09:34,251] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", - "[2024-04-10 15:09:34,252] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", - "[2024-04-10 15:09:34,253] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", - "[2024-04-10 15:09:35,375] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:09:35,377] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", - "[2024-04-10 15:09:35,377] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:09:35,378] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", - "[2024-04-10 15:09:35,380] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", - "[2024-04-10 15:09:35,381] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:09:35,382] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", - "[2024-04-10 15:09:35,383] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", - "[2024-04-10 15:09:35,384] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[2024-04-10 15:09:35,488] [INFO] (__main__.App) - End run\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n" + "[2024-04-22 15:55:21,912] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:55:21,914] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", + "[2024-04-22 15:55:21,915] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:55:21,916] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", + "[2024-04-22 15:55:21,917] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", + "[2024-04-22 15:55:21,918] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:55:21,919] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", + "[2024-04-22 15:55:21,920] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", + "[2024-04-22 15:55:21,921] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", + "[2024-04-22 15:55:23,044] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:55:23,045] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", + "[2024-04-22 15:55:23,046] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:55:23,046] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", + "[2024-04-22 15:55:23,047] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", + "[2024-04-22 15:55:23,048] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:55:23,049] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", + "[2024-04-22 15:55:23,050] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", + "[2024-04-22 15:55:23,051] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", + "[info] [gxf_executor.cpp:1879] Deactivating Graph...\n", + "[info] [gxf_executor.cpp:1887] Graph execution finished.\n", + "[2024-04-22 15:55:23,159] [INFO] (__main__.App) - End run\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[0m2024-04-22 15:55:23.157 INFO gxf/std/greedy_scheduler.cpp@372: Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\u001b[0m\n", + "\u001b[0m2024-04-22 15:55:23.158 INFO gxf/std/greedy_scheduler.cpp@401: Scheduler finished.\u001b[0m\n" ] } ], @@ -1171,59 +1184,57 @@ "name": "stdout", "output_type": "stream", "text": [ - "[2024-04-10 15:09:40,274] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['my_app'])\n", - "[2024-04-10 15:09:40,282] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=multi_models, workdir=)\n", - "[2024-04-10 15:09:40,284] [INFO] (root) - End compose\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:211] Creating context\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1674] Loading extensions from configs...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1864] Activating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1894] Running Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1896] Waiting for completion...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:190] Scheduling 9 entities\n", - "[2024-04-10 15:09:40,321] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - Finding series for Selection named: CT Series\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", + "[2024-04-22 15:55:29,138] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['my_app'])\n", + "[2024-04-22 15:55:29,147] [INFO] (root) - AppContext object: AppContext(input_path=dcm, output_path=output, model_path=multi_models, workdir=)\n", + "[2024-04-22 15:55:29,150] [INFO] (root) - End compose\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:247] Creating context\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1672] Loading extensions from configs...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1842] Activating Graph...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1874] Running Graph...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1876] Waiting for completion...\n", + "\u001b[0m2024-04-22 15:55:29.191 INFO gxf/std/greedy_scheduler.cpp@191: Scheduling 9 entities\u001b[0m\n", + "[2024-04-22 15:55:29,192] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", + "[2024-04-22 15:55:29,570] [INFO] (root) - Finding series for Selection named: CT Series\n", + "[2024-04-22 15:55:29,570] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", " # of series: 1\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - Series attribute Modality value: CT\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", - "[2024-04-10 15:09:40,657] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", - "[2024-04-10 15:09:41,061] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models/pancreas_ct_dints/model.ts\n", - "[2024-04-10 15:11:19,819] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models/spleen_ct/model.ts\n", + "[2024-04-22 15:55:29,570] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 15:55:29,570] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", + "[2024-04-22 15:55:29,570] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", + "[2024-04-22 15:55:29,571] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 15:55:29,571] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", + "[2024-04-22 15:55:29,571] [INFO] (root) - Series attribute Modality value: CT\n", + "[2024-04-22 15:55:29,571] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 15:55:29,571] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", + "[2024-04-22 15:55:29,571] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", + "[2024-04-22 15:55:29,571] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 15:55:29,571] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 15:55:29,799] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models/pancreas_ct_dints/model.ts\n", + "[2024-04-22 15:57:11,791] [INFO] (root) - Parsing from bundle_path: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models/spleen_ct/model.ts\n", "/home/mqin/src/monai-deploy-app-sdk/.venv/lib/python3.10/site-packages/highdicom/valuerep.py:54: UserWarning: The string \"C3N-00198\" is unlikely to represent the intended person name since it contains only a single component. Construct a person name according to the format in described in https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html#sect_6.2.1.2, or, in pydicom 2.2.0 or later, use the pydicom.valuerep.PersonName.from_named_components() method to construct the person name correctly. If a single-component name is really intended, add a trailing caret character to disambiguate the name.\n", " warnings.warn(\n", - "[2024-04-10 15:11:25,386] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:11:25,386] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", - "[2024-04-10 15:11:25,386] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:11:25,386] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", - "[2024-04-10 15:11:25,386] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", - "[2024-04-10 15:11:25,386] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:11:25,386] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", - "[2024-04-10 15:11:25,387] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", - "[2024-04-10 15:11:25,387] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", - "[2024-04-10 15:11:26,671] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:11:26,671] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", - "[2024-04-10 15:11:26,671] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:11:26,671] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", - "[2024-04-10 15:11:26,671] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", - "[2024-04-10 15:11:26,671] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "[2024-04-10 15:11:26,672] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", - "[2024-04-10 15:11:26,672] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", - "[2024-04-10 15:11:26,672] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", - "[\u001b[32minfo\u001b[m] [greedy_scheduler.cpp:398] Scheduler finished.\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1907] Deactivating Graph...\n", - "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", - "[2024-04-10 15:11:26,772] [INFO] (app.App) - End run\n" + "[2024-04-22 15:57:17,327] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:57:17,327] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", + "[2024-04-22 15:57:17,327] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:57:17,327] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", + "[2024-04-22 15:57:17,327] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", + "[2024-04-22 15:57:17,327] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:57:17,327] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", + "[2024-04-22 15:57:17,328] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", + "[2024-04-22 15:57:17,328] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", + "[2024-04-22 15:57:18,411] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:57:18,411] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", + "[2024-04-22 15:57:18,411] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:57:18,411] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", + "[2024-04-22 15:57:18,412] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", + "[2024-04-22 15:57:18,412] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 15:57:18,412] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", + "[2024-04-22 15:57:18,412] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", + "[2024-04-22 15:57:18,412] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", + "\u001b[0m2024-04-22 15:57:18.495 INFO gxf/std/greedy_scheduler.cpp@372: Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\u001b[0m\n", + "\u001b[0m2024-04-22 15:57:18.495 INFO gxf/std/greedy_scheduler.cpp@401: Scheduler finished.\u001b[0m\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1879] Deactivating Graph...\n", + "[\u001b[32minfo\u001b[m] [gxf_executor.cpp:1887] Graph execution finished.\n", + "[2024-04-22 15:57:18,496] [INFO] (app.App) - End run\n" ] } ], @@ -1241,8 +1252,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "1.2.826.0.1.3680043.10.511.3.15046048574363662193759299900270199.dcm\n", - "1.2.826.0.1.3680043.10.511.3.98214024482046978965335342071467925.dcm\n" + "1.2.826.0.1.3680043.10.511.3.36210709245442636857342073170254447.dcm\n", + "1.2.826.0.1.3680043.10.511.3.85203290647684787265567113056524656.dcm\n" ] } ], @@ -1342,15 +1353,17 @@ "name": "stdout", "output_type": "stream", "text": [ - "[2024-04-10 15:11:29,127] [INFO] (packager.parameters) - Application: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/my_app\n", - "[2024-04-10 15:11:29,127] [INFO] (packager.parameters) - Detected application type: Python Module\n", - "[2024-04-10 15:11:29,127] [INFO] (packager) - Scanning for models in /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models...\n", - "[2024-04-10 15:11:29,127] [DEBUG] (packager) - Model spleen_ct=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models/spleen_ct added.\n", - "[2024-04-10 15:11:29,127] [DEBUG] (packager) - Model pancreas_ct_dints=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models/pancreas_ct_dints added.\n", - "[2024-04-10 15:11:29,127] [INFO] (packager) - Reading application configuration from /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/my_app/app.yaml...\n", - "[2024-04-10 15:11:29,128] [INFO] (packager) - Generating app.json...\n", - "[2024-04-10 15:11:29,129] [INFO] (packager) - Generating pkg.json...\n", - "[2024-04-10 15:11:29,133] [DEBUG] (common) - \n", + "[2024-04-22 15:57:21,530] [INFO] (common) - Downloading CLI manifest file...\n", + "[2024-04-22 15:57:21,786] [DEBUG] (common) - Validating CLI manifest file...\n", + "[2024-04-22 15:57:21,789] [INFO] (packager.parameters) - Application: /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/my_app\n", + "[2024-04-22 15:57:21,790] [INFO] (packager.parameters) - Detected application type: Python Module\n", + "[2024-04-22 15:57:21,790] [INFO] (packager) - Scanning for models in /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models...\n", + "[2024-04-22 15:57:21,791] [DEBUG] (packager) - Model spleen_ct=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models/spleen_ct added.\n", + "[2024-04-22 15:57:21,791] [DEBUG] (packager) - Model pancreas_ct_dints=/home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/multi_models/pancreas_ct_dints added.\n", + "[2024-04-22 15:57:21,791] [INFO] (packager) - Reading application configuration from /home/mqin/src/monai-deploy-app-sdk/notebooks/tutorials/my_app/app.yaml...\n", + "[2024-04-22 15:57:21,796] [INFO] (packager) - Generating app.json...\n", + "[2024-04-22 15:57:21,796] [INFO] (packager) - Generating pkg.json...\n", + "[2024-04-22 15:57:21,808] [DEBUG] (common) - \n", "=============== Begin app.json ===============\n", "{\n", " \"apiVersion\": \"1.0.0\",\n", @@ -1385,7 +1398,7 @@ "}\n", "================ End app.json ================\n", " \n", - "[2024-04-10 15:11:29,134] [DEBUG] (common) - \n", + "[2024-04-22 15:57:21,809] [DEBUG] (common) - \n", "=============== Begin pkg.json ===============\n", "{\n", " \"apiVersion\": \"1.0.0\",\n", @@ -1406,11 +1419,11 @@ "}\n", "================ End pkg.json ================\n", " \n", - "[2024-04-10 15:11:29,632] [DEBUG] (packager.builder) - \n", + "[2024-04-22 15:57:22,305] [DEBUG] (packager.builder) - \n", "========== Begin Dockerfile ==========\n", "\n", "\n", - "FROM nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", + "FROM nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", "\n", "ENV DEBIAN_FRONTEND=noninteractive\n", "ENV TERM=xterm-256color\n", @@ -1426,11 +1439,11 @@ " && mkdir -p /var/holoscan/input \\\n", " && mkdir -p /var/holoscan/output\n", "\n", - "LABEL base=\"nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\"\n", + "LABEL base=\"nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\"\n", "LABEL tag=\"my_app:1.0\"\n", "LABEL org.opencontainers.image.title=\"MONAI Deploy App Package - Multi Model App\"\n", "LABEL org.opencontainers.image.version=\"1.0\"\n", - "LABEL org.nvidia.holoscan=\"1.0.3\"\n", + "LABEL org.nvidia.holoscan=\"2.0.0\"\n", "LABEL org.monai.deploy.app-sdk=\"0.5.1\"\n", "\n", "\n", @@ -1456,7 +1469,6 @@ "ENV PYTHONPATH=\"/opt/holoscan/app:$PYTHONPATH\"\n", "\n", "\n", - "\n", "RUN groupadd -f -g $GID $UNAME\n", "RUN useradd -rm -d /home/$UNAME -s /bin/bash -g $GID -G sudo -u $UID $UNAME\n", "RUN chown -R holoscan /var/holoscan \n", @@ -1482,14 +1494,12 @@ "RUN pip install --upgrade pip\n", "RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", "\n", - "# Install Holoscan from PyPI only when sdk_type is Holoscan. \n", - "# For MONAI Deploy, the APP SDK will install it unless user specifies the Holoscan SDK file.\n", + " \n", + "# MONAI Deploy\n", "\n", "# Copy user-specified MONAI Deploy SDK file\n", - "COPY ./monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", - "\n", - "\n", + "COPY ./monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz /tmp/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", + "RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", "\n", "\n", "COPY ./models /opt/holoscan/models\n", @@ -1503,31 +1513,31 @@ "ENTRYPOINT [\"/var/holoscan/tools\"]\n", "=========== End Dockerfile ===========\n", "\n", - "[2024-04-10 15:11:29,632] [INFO] (packager.builder) - \n", + "[2024-04-22 15:57:22,306] [INFO] (packager.builder) - \n", "===============================================================================\n", "Building image for: x64-workstation\n", " Architecture: linux/amd64\n", - " Base Image: nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", + " Base Image: nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", " Build Image: N/A\n", " Cache: Enabled\n", " Configuration: dgpu\n", " Holoscan SDK Package: pypi.org\n", - " MONAI Deploy App SDK Package: /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", + " MONAI Deploy App SDK Package: /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", " gRPC Health Probe: N/A\n", - " SDK Version: 1.0.3\n", + " SDK Version: 2.0.0\n", " SDK: monai-deploy\n", " Tag: my_app-x64-workstation-dgpu-linux-amd64:1.0\n", " \n", - "[2024-04-10 15:11:29,935] [INFO] (common) - Using existing Docker BuildKit builder `holoscan_app_builder`\n", - "[2024-04-10 15:11:29,936] [DEBUG] (packager.builder) - Building Holoscan Application Package: tag=my_app-x64-workstation-dgpu-linux-amd64:1.0\n", + "[2024-04-22 15:57:22,629] [INFO] (common) - Using existing Docker BuildKit builder `holoscan_app_builder`\n", + "[2024-04-22 15:57:22,630] [DEBUG] (packager.builder) - Building Holoscan Application Package: tag=my_app-x64-workstation-dgpu-linux-amd64:1.0\n", "#0 building with \"holoscan_app_builder\" instance using docker-container driver\n", "\n", "#1 [internal] load build definition from Dockerfile\n", - "#1 transferring dockerfile: 2.79kB done\n", + "#1 transferring dockerfile: 2.62kB done\n", "#1 DONE 0.1s\n", "\n", - "#2 [internal] load metadata for nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#2 DONE 0.1s\n", + "#2 [internal] load metadata for nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", + "#2 DONE 0.5s\n", "\n", "#3 [internal] load .dockerignore\n", "#3 transferring context: 1.79kB done\n", @@ -1536,69 +1546,69 @@ "#4 [internal] load build context\n", "#4 DONE 0.0s\n", "\n", - "#5 importing cache manifest from local:3229340695933661696\n", + "#5 importing cache manifest from local:9283280999769270877\n", "#5 inferred cache manifest type: application/vnd.oci.image.index.v1+json done\n", "#5 DONE 0.0s\n", "\n", - "#6 [ 1/21] FROM nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu@sha256:50343c616bf910e2a7651abb59db7833933e82cce64c3c4885f938d7e4af6155\n", - "#6 resolve nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu@sha256:50343c616bf910e2a7651abb59db7833933e82cce64c3c4885f938d7e4af6155 0.0s done\n", - "#6 DONE 0.1s\n", + "#6 importing cache manifest from nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu\n", + "#6 inferred cache manifest type: application/vnd.docker.distribution.manifest.list.v2+json done\n", + "#6 DONE 0.8s\n", "\n", - "#7 importing cache manifest from nvcr.io/nvidia/clara-holoscan/holoscan:v1.0.3-dgpu\n", - "#7 inferred cache manifest type: application/vnd.docker.distribution.manifest.list.v2+json done\n", - "#7 DONE 0.6s\n", + "#7 [ 1/21] FROM nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu@sha256:20adbccd2c7b12dfb1798f6953f071631c3b85cd337858a7506f8e420add6d4a\n", + "#7 resolve nvcr.io/nvidia/clara-holoscan/holoscan:v2.0.0-dgpu@sha256:20adbccd2c7b12dfb1798f6953f071631c3b85cd337858a7506f8e420add6d4a 0.1s done\n", + "#7 DONE 0.1s\n", "\n", "#4 [internal] load build context\n", - "#4 transferring context: 636.05MB 3.2s done\n", - "#4 DONE 3.2s\n", + "#4 transferring context: 636.03MB 3.8s done\n", + "#4 DONE 4.0s\n", "\n", - "#8 [ 2/21] RUN mkdir -p /etc/holoscan/ && mkdir -p /opt/holoscan/ && mkdir -p /var/holoscan && mkdir -p /opt/holoscan/app && mkdir -p /var/holoscan/input && mkdir -p /var/holoscan/output\n", + "#8 [12/21] COPY ./pip/requirements.txt /tmp/requirements.txt\n", "#8 CACHED\n", "\n", - "#9 [ 6/21] RUN chown -R holoscan /var/holoscan\n", + "#9 [ 9/21] WORKDIR /var/holoscan\n", "#9 CACHED\n", "\n", - "#10 [15/21] COPY ./monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", + "#10 [15/21] COPY ./monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz /tmp/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", "#10 CACHED\n", "\n", - "#11 [10/21] COPY ./tools /var/holoscan/tools\n", + "#11 [11/21] RUN chmod +x /var/holoscan/tools\n", "#11 CACHED\n", "\n", - "#12 [12/21] COPY ./pip/requirements.txt /tmp/requirements.txt\n", + "#12 [ 2/21] RUN mkdir -p /etc/holoscan/ && mkdir -p /opt/holoscan/ && mkdir -p /var/holoscan && mkdir -p /opt/holoscan/app && mkdir -p /var/holoscan/input && mkdir -p /var/holoscan/output\n", "#12 CACHED\n", "\n", - "#13 [ 9/21] WORKDIR /var/holoscan\n", + "#13 [ 6/21] RUN chown -R holoscan /var/holoscan\n", "#13 CACHED\n", "\n", - "#14 [13/21] RUN pip install --upgrade pip\n", + "#14 [10/21] COPY ./tools /var/holoscan/tools\n", "#14 CACHED\n", "\n", - "#15 [ 3/21] RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*\n", + "#15 [ 4/21] RUN groupadd -f -g 1000 holoscan\n", "#15 CACHED\n", "\n", - "#16 [ 4/21] RUN groupadd -f -g 1000 holoscan\n", + "#16 [ 8/21] RUN chown -R holoscan /var/holoscan/output\n", "#16 CACHED\n", "\n", "#17 [ 5/21] RUN useradd -rm -d /home/holoscan -s /bin/bash -g 1000 -G sudo -u 1000 holoscan\n", "#17 CACHED\n", "\n", - "#18 [ 7/21] RUN chown -R holoscan /var/holoscan/input\n", + "#18 [14/21] RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", "#18 CACHED\n", "\n", - "#19 [14/21] RUN pip install --no-cache-dir --user -r /tmp/requirements.txt\n", + "#19 [13/21] RUN pip install --upgrade pip\n", "#19 CACHED\n", "\n", - "#20 [11/21] RUN chmod +x /var/holoscan/tools\n", + "#20 [ 3/21] RUN apt-get update && apt-get install -y curl jq && rm -rf /var/lib/apt/lists/*\n", "#20 CACHED\n", "\n", - "#21 [ 8/21] RUN chown -R holoscan /var/holoscan/output\n", + "#21 [ 7/21] RUN chown -R holoscan /var/holoscan/input\n", "#21 CACHED\n", "\n", - "#22 [16/21] RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+25.g31e4165.dirty-py3-none-any.whl\n", + "#22 [16/21] RUN pip install /tmp/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz\n", "#22 CACHED\n", "\n", "#23 [17/21] COPY ./models /opt/holoscan/models\n", - "#23 DONE 6.7s\n", + "#23 DONE 6.9s\n", "\n", "#24 [18/21] COPY ./map/app.json /etc/holoscan/app.json\n", "#24 DONE 0.1s\n", @@ -1610,116 +1620,147 @@ "#26 DONE 0.1s\n", "\n", "#27 [21/21] COPY ./app /opt/holoscan/app\n", - "#27 DONE 0.2s\n", + "#27 DONE 0.1s\n", "\n", "#28 exporting to docker image format\n", "#28 exporting layers\n", - "#28 exporting layers 20.5s done\n", - "#28 exporting manifest sha256:e77308187dcf97394b99101aa895bea8c1e7dc92572bedddb310476c65f828ab 0.0s done\n", - "#28 exporting config sha256:f820210cdcfe0c41a2791dcced8072f2413aa1f6f2b1076134249d6abc400141 0.0s done\n", + "#28 exporting layers 21.4s done\n", + "#28 exporting manifest sha256:b321a6be80dd5f2e879549ef8282ee37d6dba901a3cc93ee113667f4038e879c 0.0s done\n", + "#28 exporting config sha256:193c665b7ae7e57236f4b09ea6a7b96ad58af71dc2bd13e98ba2315b4ec461a2 0.0s done\n", "#28 sending tarball\n", "#28 ...\n", "\n", "#29 importing to docker\n", - "#29 loading layer 0b7c827957f8 557.06kB / 584.49MB\n", - "#29 loading layer 0b7c827957f8 150.96MB / 584.49MB 2.1s\n", - "#29 loading layer 0b7c827957f8 305.82MB / 584.49MB 4.2s\n", - "#29 loading layer 0b7c827957f8 492.99MB / 584.49MB 6.3s\n", - "#29 loading layer 0f7d49f89e9c 492B / 492B\n", - "#29 loading layer 98aed7487fb0 312B / 312B\n", - "#29 loading layer 972f8aa128ec 322B / 322B\n", - "#29 loading layer db9d1b5a3f36 4.00kB / 4.00kB\n", - "#29 loading layer db9d1b5a3f36 4.00kB / 4.00kB 1.2s done\n", - "#29 loading layer 0b7c827957f8 492.99MB / 584.49MB 9.4s done\n", - "#29 loading layer 0f7d49f89e9c 492B / 492B 1.4s done\n", - "#29 loading layer 98aed7487fb0 312B / 312B 1.3s done\n", - "#29 loading layer 972f8aa128ec 322B / 322B 1.3s done\n", - "#29 DONE 9.4s\n", + "#29 loading layer 57a12d7f8667 253B / 253B\n", + "#29 loading layer 8dcccdc64d65 65.54kB / 5.86MB\n", + "#29 loading layer f06c13e07c07 557.06kB / 2.91GB\n", + "#29 loading layer f06c13e07c07 106.95MB / 2.91GB 6.2s\n", + "#29 loading layer f06c13e07c07 295.80MB / 2.91GB 10.2s\n", + "#29 loading layer f06c13e07c07 487.98MB / 2.91GB 14.3s\n", + "#29 loading layer f06c13e07c07 665.68MB / 2.91GB 18.4s\n", + "#29 loading layer f06c13e07c07 844.50MB / 2.91GB 22.5s\n", + "#29 loading layer f06c13e07c07 1.05GB / 2.91GB 26.6s\n", + "#29 loading layer f06c13e07c07 1.24GB / 2.91GB 30.7s\n", + "#29 loading layer f06c13e07c07 1.44GB / 2.91GB 34.8s\n", + "#29 loading layer f06c13e07c07 1.62GB / 2.91GB 39.0s\n", + "#29 loading layer f06c13e07c07 1.83GB / 2.91GB 43.0s\n", + "#29 loading layer f06c13e07c07 1.98GB / 2.91GB 49.3s\n", + "#29 loading layer f06c13e07c07 2.02GB / 2.91GB 54.8s\n", + "#29 loading layer f06c13e07c07 2.16GB / 2.91GB 61.0s\n", + "#29 loading layer f06c13e07c07 2.36GB / 2.91GB 65.1s\n", + "#29 loading layer f06c13e07c07 2.52GB / 2.91GB 69.2s\n", + "#29 loading layer f06c13e07c07 2.73GB / 2.91GB 73.3s\n", + "#29 loading layer f06c13e07c07 2.85GB / 2.91GB 79.5s\n", + "#29 loading layer d054c47a2401 32.77kB / 108.43kB\n", + "#29 loading layer 50075853a0dc 557.06kB / 68.61MB\n", + "#29 loading layer db723b63808d 557.06kB / 584.49MB\n", + "#29 loading layer db723b63808d 156.53MB / 584.49MB 2.1s\n", + "#29 loading layer db723b63808d 304.15MB / 584.49MB 4.2s\n", + "#29 loading layer db723b63808d 432.83MB / 584.49MB 6.2s\n", + "#29 loading layer db723b63808d 547.59MB / 584.49MB 8.2s\n", + "#29 loading layer f08d2f9338d7 491B / 491B\n", + "#29 loading layer a581c286c3e8 309B / 309B\n", + "#29 loading layer 68fdd13ce346 322B / 322B\n", + "#29 loading layer 1a9cbe5e7000 4.00kB / 4.00kB\n", + "#29 loading layer 50075853a0dc 557.06kB / 68.61MB 12.6s done\n", + "#29 loading layer 57a12d7f8667 253B / 253B 96.2s done\n", + "#29 loading layer 8dcccdc64d65 65.54kB / 5.86MB 96.1s done\n", + "#29 loading layer f06c13e07c07 2.89GB / 2.91GB 95.4s done\n", + "#29 loading layer d054c47a2401 32.77kB / 108.43kB 12.8s done\n", + "#29 loading layer db723b63808d 547.59MB / 584.49MB 10.7s done\n", + "#29 loading layer f08d2f9338d7 491B / 491B 1.2s done\n", + "#29 loading layer a581c286c3e8 309B / 309B 0.6s done\n", + "#29 loading layer 68fdd13ce346 322B / 322B 0.6s done\n", + "#29 loading layer 1a9cbe5e7000 4.00kB / 4.00kB 0.5s done\n", + "#29 DONE 96.2s\n", "\n", "#28 exporting to docker image format\n", - "#28 sending tarball 79.2s done\n", - "#28 DONE 99.9s\n", + "#28 sending tarball 170.7s done\n", + "#28 DONE 192.3s\n", "\n", "#30 exporting cache to client directory\n", "#30 preparing build cache for export\n", - "#30 writing layer sha256:00bb4c1319ba1a33ac3edcb3aa1240d8abcb8d0383c6267ed8028d3b6228a8a4\n", - "#30 writing layer sha256:00bb4c1319ba1a33ac3edcb3aa1240d8abcb8d0383c6267ed8028d3b6228a8a4 done\n", + "#30 writing layer sha256:014cff740c9ec6e9a30d0b859219a700ae880eb385d62095d348f5ea136d6015\n", "#30 writing layer sha256:014cff740c9ec6e9a30d0b859219a700ae880eb385d62095d348f5ea136d6015 done\n", - "#30 writing layer sha256:021b9bc7b766e946a42d4bf0d3f88658998d36cf2fa5f182af98d925b3d44f4f 0.0s done\n", + "#30 writing layer sha256:0487800842442c7a031a39e1e1857bc6dae4b4f7e5daf3d625f7a8a4833fb364 done\n", + "#30 writing layer sha256:06c6aee94862daf0603783db4e1de6f8524b30ac9fbe0374ab3f1d85b2f76f7f done\n", "#30 writing layer sha256:0a1756432df4a4350712d8ae5c003f1526bd2180800b3ae6301cfc9ccf370254 done\n", "#30 writing layer sha256:0a77dcbd0e648ddc4f8e5230ade8fdb781d99e24fa4f13ca96a360c7f7e6751f done\n", - "#30 writing layer sha256:0bf3a16e4f3f9ec99796b99e331a5c62472bc9377925e1fdc05f64709ed09895 done\n", "#30 writing layer sha256:0ec682bf99715a9f88631226f3749e2271b8b9f254528ef61f65ed829984821c done\n", - "#30 writing layer sha256:1133dfcee0e851b490d17b3567f50c4b25ba5750da02ba4b3f3630655d0b1a7b done\n", - "#30 writing layer sha256:1294b2835667d633f938174d9fecb18a60bbbebb6fb49788a1f939893a25d1af done\n", - "#30 writing layer sha256:16a03c6e0373b62f9713416da0229bb7ce2585183141081d3ea8427ad2e84408 done\n", + "#30 writing layer sha256:1c5c3aa9c2c8bfd1b9eb36248f5b6d67b3db73ef43440f9dd897615771974b39 done\n", + "#30 writing layer sha256:1f4a978bb76db2d138cfe7c7c9e76db4096247b06e34d349a2ed504bcd6a7ead done\n", + "#30 writing layer sha256:1f73278b7f17492ce1a8b28b139d54596961596d6790dc20046fa6d5909f3e9c done\n", + "#30 writing layer sha256:208f9576d3ed11b2828415baa9531d1ad9c7d92432ba3b076f3b23b0308608f1 0.0s done\n", "#30 writing layer sha256:20d331454f5fb557f2692dfbdbe092c718fd2cb55d5db9d661b62228dacca5c2 done\n", - "#30 writing layer sha256:2232aeb26b5b7ea57227e9a5b84da4fb229624d7bc976a5f7ce86d9c8653d277 done\n", "#30 writing layer sha256:238f69a43816e481f0295995fcf5fe74d59facf0f9f99734c8d0a2fb140630e0 done\n", + "#30 writing layer sha256:255cc51d2e47738a5db3059cbe9f403785cf9496c7df8a28a3c9f0c46a0b3b58 done\n", "#30 writing layer sha256:2ad84487f9d4d31cd1e0a92697a5447dd241935253d036b272ef16d31620c1e7 done\n", - "#30 writing layer sha256:2bb73464628bd4a136c4937f42d522c847bea86b2215ae734949e24c1caf450e done\n", - "#30 writing layer sha256:3a663fdf00962d807df49af4b54ad7382e7d0b0c65355a78d706ee221758e691\n", - "#30 writing layer sha256:3a663fdf00962d807df49af4b54ad7382e7d0b0c65355a78d706ee221758e691 11.2s done\n", - "#30 writing layer sha256:3e3e04011ebdba380ab129f0ee390626cb2a600623815ca756340c18bedb9517\n", + "#30 writing layer sha256:2f65750928993b5b31fe572d9e085b53853c5a344feeb0e8615898e285a8c256 done\n", + "#30 writing layer sha256:3777c6498f08c0400339c243e827d465075b7296eb2526e38d9b01c84f8764d8 done\n", "#30 writing layer sha256:3e3e04011ebdba380ab129f0ee390626cb2a600623815ca756340c18bedb9517 done\n", "#30 writing layer sha256:42619ce4a0c9e54cfd0ee41a8e5f27d58b3f51becabd1ac6de725fbe6c42b14a done\n", - "#30 writing layer sha256:43a21fb6c76bd2b3715cc09d9f8c3865dc61c51dd9e2327b429f5bec8fff85d1 done\n", "#30 writing layer sha256:49bdc9abf8a437ccff67cc11490ba52c976577992909856a86be872a34d3b950 done\n", + "#30 writing layer sha256:4b1d808274b455e32b3ef8f2daaebe427281249eb39c30570c027b66df592568 0.0s done\n", "#30 writing layer sha256:4b691ba9f48b41eaa0c754feba8366f1c030464fcbc55eeffa6c86675990933a done\n", "#30 writing layer sha256:4d04a8db404f16c2704fa10739cb6745a0187713a21a6ef0deb34b48629b54c1 done\n", "#30 writing layer sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 done\n", - "#30 writing layer sha256:5275a41be8f6691a490c0a15589e0910c73bf971169ad33a850ef570d37f63dd done\n", - "#30 writing layer sha256:52fbfeaf78318d843054ce2bfb5bfc9f71278939a815f6035ab5b14573ad017b done\n", - "#30 writing layer sha256:5792b18b6f162bae61ff5840cdb9e8567e6847a56ac886f940b47e7271c529a7 done\n", + "#30 writing layer sha256:542bc8c8d18fbc95e6794122c3593a4a693f8ab6dda4460406f4d7b1ae64a2bc done\n", + "#30 writing layer sha256:57f244836ad318f9bbb3b29856ae1a5b31038bfbb9b43d2466d51c199eb55041\n", "#30 writing layer sha256:57f244836ad318f9bbb3b29856ae1a5b31038bfbb9b43d2466d51c199eb55041 done\n", "#30 writing layer sha256:5b5b131e0f20db4cb8e568b623a95f8fc16ed1c6b322a9366df70b59a881f24f done\n", - "#30 writing layer sha256:5ccb787d371fd3697122101438ddd0f55b537832e9756d2c51ab1d8158710ac5 done\n", - "#30 writing layer sha256:5ea668ffc2fc267d241dbf17ca283bc879643a189be4f7e3d9034a82fc64a1ea done\n", + "#30 writing layer sha256:5b90d17b5048adcadefd0b1e4dba9a99247a8827a887e1ca042df375c85b518d done\n", + "#30 writing layer sha256:5dfce19028ece113c2f29dc269c27e66882396fd47dd4ec37e5d350e54f7e2a9 0.0s done\n", "#30 writing layer sha256:62452179df7c18e292f141d4aec29e6aba9ff8270c893731169fc6f41dc07631 done\n", - "#30 writing layer sha256:6399aeba5e066098b3fac85e23e402cd10f0c5d0f06107595840b9f7259f9b40 0.0s done\n", "#30 writing layer sha256:6630c387f5f2115bca2e646fd0c2f64e1f3d5431c2e050abe607633883eda230 done\n", - "#30 writing layer sha256:69af4b756272a77f683a8d118fd5ca55c03ad5f1bacc673b463f54d16b833da5 done\n", - "#30 writing layer sha256:6ae1f1fb92c0cb2b6e219f687b08c8e511501a7af696c943ca20d119eba7cd02 done\n", - "#30 writing layer sha256:6deb3d550b15a5e099c0b3d0cbc242e351722ca16c058d3a6c28ba1a02824d0f done\n", - "#30 writing layer sha256:6e80a527af94a864094c4f9116c2d29d3d7548ec8388579d9cf3f8a39a4b8178 done\n", - "#30 writing layer sha256:7386814d57100e2c7389fbf4e16f140f5c549d31434c62c3884a85a3ee5cd2a7 done\n", + "#30 writing layer sha256:6661e0146e77a8bcb03edbfda95bf7780c8bb4c4f98bc03a398c88f4b2403d12 done\n", + "#30 writing layer sha256:717ebf8c9c66ae393ad01e50dbac4413d7b026b9c97d4d348b22ad17052a1a35 done\n", + "#30 writing layer sha256:773c6815e5e7d6855a62f8c5e2fabce3d939ded36c5420f15b54dd7908cdbcfa done\n", "#30 writing layer sha256:7852b73ea931e3a8d3287ee7ef3cf4bad068e44f046583bfc2b81336fb299284 done\n", - "#30 writing layer sha256:7e73869c74822e4539e104a3d2aff853f4622cd0bb873576db1db53c9e91f621 done\n", - "#30 writing layer sha256:7eae142b38745fe88962874372374deb672998600264a17e638c010b79e6b535 done\n", - "#30 writing layer sha256:7f2e5ab2c599fa36698918d3e73c991d8616fff9037077cd230529e7cd1c5e0e done\n", + "#30 writing layer sha256:7f8ec130348bcdac81c295e37fe82b4a6e5e9a3ca980a6343809c561020d82d7 done\n", + "#30 writing layer sha256:80885adcad6b5d021bb9f68b6c952018085bb4ce72011bdc0cf7fe8178b5960b done\n", "#30 writing layer sha256:82a3436133b2b17bb407c7fe488932aa0ca55411f23ab55c34a6134b287c6a27 done\n", + "#30 writing layer sha256:8371d15eb4d69b1d98174dd098b8ddd5c4f19ec6f8d8b67e72dfa9891dc454b4 done\n", + "#30 writing layer sha256:85713f9b166b5add777c524ee807f6265d88b967cbeb9f961d6b09bf220c9a65 done\n", + "#30 writing layer sha256:8fe00505006a09966e763918147ef6ed55bb6695b26e4940c780ee430dc5da8e done\n", "#30 writing layer sha256:90eae6faa5cc5ba62f12c25915cdfb1a7a51abfba0d05cb5818c3f908f4e345f done\n", + "#30 writing layer sha256:9205d97d9d3e906698bcc6c42d45727c2fa6ec2622abf953d46778c3b8c78edc done\n", + "#30 writing layer sha256:993369dbcc13162a6654d2a3e990b8d8b5f37963564d25710e12764337261ae3 done\n", + "#30 writing layer sha256:99e42a4adebadb39bf55bf94bbd9fb8034230ee19b6b0a42e6ff96f2e7794f30 done\n", "#30 writing layer sha256:9ac855545fa90ed2bf3b388fdff9ef06ac9427b0c0fca07c9e59161983d8827e done\n", + "#30 writing layer sha256:9c13274ae528c2cd204641c325096f57a6f8a953075a71bc4cb1ee23710d0540\n", + "#30 writing layer sha256:9c13274ae528c2cd204641c325096f57a6f8a953075a71bc4cb1ee23710d0540 11.3s done\n", + "#30 writing layer sha256:9d19ee268e0d7bcf6716e6658ee1b0384a71d6f2f9aa1ae2085610cf7c7b316f\n", + "#30 preparing build cache for export 12.1s done\n", "#30 writing layer sha256:9d19ee268e0d7bcf6716e6658ee1b0384a71d6f2f9aa1ae2085610cf7c7b316f done\n", - "#30 writing layer sha256:a10c8d7d2714eabf661d1f43a1ccb87a51748cbb9094d5bc0b713e2481b5d329 done\n", + "#30 writing layer sha256:9fafbd4203c4fefe007a462e0d2cd4c1c7c41db2cfdc58d212279e1b9b4b230c done\n", "#30 writing layer sha256:a1748eee9d376f97bd19225ba61dfada9986f063f4fc429e435f157abb629fc6 done\n", + "#30 writing layer sha256:a251fe5ae6c6d2d5034e4ca88b5dfe5d4827ff90b18e9b143a073232a32bb18d done\n", "#30 writing layer sha256:a68f4e0ec09ec3b78cb4cf8e4511d658e34e7b6f676d7806ad9703194ff17604 done\n", "#30 writing layer sha256:a8e4decc8f7289623b8fd7b9ba1ca555b5a755ebdbf81328d68209f148d9e602 done\n", "#30 writing layer sha256:afde1c269453ce68a0f2b54c1ba8c5ecddeb18a19e5618a4acdef1f0fe3921af done\n", + "#30 writing layer sha256:b406feb20a37b8c87ef4f5ef814039e3adc90473d50c366b7d9bb6ded4e94a2e done\n", "#30 writing layer sha256:b48a5fafcaba74eb5d7e7665601509e2889285b50a04b5b639a23f8adc818157 done\n", - "#30 writing layer sha256:b49326ff73acef905ddca0e7c2734fb9fa6d21d55c9b25feb30dd3a4aa99a9d9 0.0s done\n", + "#30 writing layer sha256:ba6934334fdc7d0dbd60d7c66b145810eaf926b8a9fce464006dba78cd0d0894 done\n", "#30 writing layer sha256:ba9f7c75e4dd7942b944679995365aab766d3677da2e69e1d74472f471a484dd done\n", - "#30 writing layer sha256:bc42865e1c27a9b1bee751f3c99ad2c12a906d32aca396ace7a07231c9cafbd1 done\n", - "#30 writing layer sha256:bdfc73b2a0fa11b4086677e117a2f9feb6b4ffeccb23a3d58a30543339607e31 done\n", - "#30 writing layer sha256:c175bb235295e50de2961fa1e1a2235c57e6eba723a914287dfc26d3be0eac11 done\n", + "#30 writing layer sha256:bc2d533b8f32b8e5e96a78bd827ddc230d6c7d97e96eb98964c7c0cb45d3ebb4 done\n", + "#30 writing layer sha256:bd496b74c1d3de6b6d51dd72612975194db7795126e5ee1043d65ab9e3b4140c 0.0s done\n", + "#30 writing layer sha256:bdc13166216ae226fa6976f9ce91f4f259d43972f1e0a9b723e436919534b2f4 done\n", + "#30 writing layer sha256:c815f0be64eded102822d81e029bd23b0d8d9a0fbfeb492ec0b4b0bc4ee777bf done\n", + "#30 writing layer sha256:c97f7fb19e2e0b8ee3e1065f4dee369e35029cc620cafb7fe3dec2e9e06a3ae0 done\n", "#30 writing layer sha256:c98533d2908f36a5e9b52faae83809b3b6865b50e90e2817308acfc64cd3655f done\n", - "#30 writing layer sha256:cb6c95b33bc30dd285c5b3cf99a05281b8f12decae1c932ab64bd58f56354021 done\n", - "#30 writing layer sha256:d57848e1e8b61049c64df4a786ec67b44ae3ffc2554b13b92ea4ce57b8686ab9 0.0s done\n", - "#30 writing layer sha256:d6b5d6e098aacb316146a428c6b5aef9692011c6dce0932e3bbfbf27a514b7ed done\n", "#30 writing layer sha256:d7da5c5e9a40c476c4b3188a845e3276dedfd752e015ea5113df5af64d4d43f7 done\n", - "#30 writing layer sha256:e4aedc686433c0ec5e676e6cc54a164345f7016aa0eb714f00c07e11664a1168\n", - "#30 preparing build cache for export 11.8s done\n", - "#30 writing layer sha256:e4aedc686433c0ec5e676e6cc54a164345f7016aa0eb714f00c07e11664a1168 done\n", + "#30 writing layer sha256:db20521a869adda8244cb64b783c65e1a911efaae0e73ae00e4a34ea6213d6ce done\n", + "#30 writing layer sha256:df4fd0ac710d7af949afbc6d25b5b4daf3f0596dabf3dec36fa7ca8fa6e1d049 done\n", + "#30 writing layer sha256:e291ddecfbe16b95ee9e90b5e90b1a3d0cfd53dc5e720d6b0f3d28e4a47cf5ac done\n", "#30 writing layer sha256:e8acb678f16bc0c369d5cf9c184f2d3a1c773986816526e5e3e9c0354f7e757f done\n", "#30 writing layer sha256:e9225f7ab6606813ec9acba98a064826ebfd6713a9645a58cd068538af1ecddb done\n", - "#30 writing layer sha256:f33546e75bf1a7d9dc9e21b9a2c54c9d09b24790ad7a4192a8509002ceb14688 done\n", + "#30 writing layer sha256:f249faf9663a96b0911a903f8803b11a553c59b698013fb8343492fefdaaea90 done\n", "#30 writing layer sha256:f608e2fbff86e98627b7e462057e7d2416522096d73fe4664b82fe6ce8a4047d done\n", - "#30 writing layer sha256:f7702077ced42a1ee35e7f5e45f72634328ff3bcfe3f57735ba80baa5ec45daf done\n", - "#30 writing layer sha256:fa66a49172c6e821a1bace57c007c01da10cbc61507c44f8cdfeed8c4e5febab done\n", - "#30 writing config sha256:7d69b41abed153db28e437a954cc449f6c78804af5fd43d91d5b0b2b7d7e2b64 0.0s done\n", - "#30 writing cache manifest sha256:bf627b702e1d3cfae1b53eb29f8b0367eca39a3a4e756a966b4b5ee9054360fe 0.0s done\n", - "#30 DONE 11.8s\n", - "[2024-04-10 15:13:34,407] [INFO] (packager) - Build Summary:\n", + "#30 writing layer sha256:f65d191416580d6c38e3d95eee12377b75a4df548be1492618ce2a8c3c41b99e done\n", + "#30 writing config sha256:6869bef7abe0a24237b1d84d2576b7f4366f3095b2c61df4abe133737202a34e 0.0s done\n", + "#30 writing cache manifest sha256:d961439b444068d8910f75c4e18f0103f8974945d01523555ca69ba7a779eab7 0.0s done\n", + "#30 DONE 12.1s\n", + "[2024-04-22 16:01:01,464] [INFO] (packager) - Build Summary:\n", "\n", "Platform: x64-workstation/dgpu\n", " Status: Succeeded\n", @@ -1731,7 +1772,7 @@ "source": [ "tag_prefix = \"my_app\"\n", "\n", - "!monai-deploy package my_app -m {models_folder} -c my_app/app.yaml -t {tag_prefix}:1.0 --platform x64-workstation -l DEBUG" + "!monai-deploy package my_app -m {models_folder} -c my_app/app.yaml -t {tag_prefix}:1.0 --platform x64-workstation -l DEBUG --monai-deploy-sdk-file /home/mqin/src/monai-deploy-app-sdk/dist/monai_deploy_app_sdk-0.5.1+18.gea0c032.dirty.tar.gz" ] }, { @@ -1750,7 +1791,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "my_app-x64-workstation-dgpu-linux-amd64 1.0 f820210cdcfe About a minute ago 18.1GB\n" + "my_app-x64-workstation-dgpu-linux-amd64 1.0 193c665b7ae7 3 minutes ago 18.3GB\n" ] } ], @@ -1833,16 +1874,16 @@ " \"platformConfig\": \"dgpu\"\n", "}\n", "\n", - "2024-04-10 22:13:38 [INFO] Copying application from /opt/holoscan/app to /var/run/holoscan/export/app\n", + "2024-04-22 23:01:04 [INFO] Copying application from /opt/holoscan/app to /var/run/holoscan/export/app\n", "\n", - "2024-04-10 22:13:38 [INFO] Copying application manifest file from /etc/holoscan/app.json to /var/run/holoscan/export/config/app.json\n", - "2024-04-10 22:13:38 [INFO] Copying pkg manifest file from /etc/holoscan/pkg.json to /var/run/holoscan/export/config/pkg.json\n", - "2024-04-10 22:13:38 [INFO] Copying application configuration from /var/holoscan/app.yaml to /var/run/holoscan/export/config/app.yaml\n", + "2024-04-22 23:01:04 [INFO] Copying application manifest file from /etc/holoscan/app.json to /var/run/holoscan/export/config/app.json\n", + "2024-04-22 23:01:04 [INFO] Copying pkg manifest file from /etc/holoscan/pkg.json to /var/run/holoscan/export/config/pkg.json\n", + "2024-04-22 23:01:04 [INFO] Copying application configuration from /var/holoscan/app.yaml to /var/run/holoscan/export/config/app.yaml\n", "\n", - "2024-04-10 22:13:38 [INFO] Copying models from /opt/holoscan/models to /var/run/holoscan/export/models\n", + "2024-04-22 23:01:04 [INFO] Copying models from /opt/holoscan/models to /var/run/holoscan/export/models\n", "\n", - "2024-04-10 22:13:39 [INFO] Copying documentation from /opt/holoscan/docs/ to /var/run/holoscan/export/docs\n", - "2024-04-10 22:13:39 [INFO] '/opt/holoscan/docs/' cannot be found.\n", + "2024-04-22 23:01:05 [INFO] Copying documentation from /opt/holoscan/docs/ to /var/run/holoscan/export/docs\n", + "2024-04-22 23:01:05 [INFO] '/opt/holoscan/docs/' cannot be found.\n", "\n", "app config models\n" ] @@ -1874,22 +1915,22 @@ "name": "stdout", "output_type": "stream", "text": [ - "[2024-04-10 15:13:42,036] [INFO] (runner) - Checking dependencies...\n", - "[2024-04-10 15:13:42,036] [INFO] (runner) - --> Verifying if \"docker\" is installed...\n", + "[2024-04-22 16:01:10,991] [INFO] (runner) - Checking dependencies...\n", + "[2024-04-22 16:01:10,991] [INFO] (runner) - --> Verifying if \"docker\" is installed...\n", "\n", - "[2024-04-10 15:13:42,036] [INFO] (runner) - --> Verifying if \"docker-buildx\" is installed...\n", + "[2024-04-22 16:01:10,991] [INFO] (runner) - --> Verifying if \"docker-buildx\" is installed...\n", "\n", - "[2024-04-10 15:13:42,036] [INFO] (runner) - --> Verifying if \"my_app-x64-workstation-dgpu-linux-amd64:1.0\" is available...\n", + "[2024-04-22 16:01:10,991] [INFO] (runner) - --> Verifying if \"my_app-x64-workstation-dgpu-linux-amd64:1.0\" is available...\n", "\n", - "[2024-04-10 15:13:42,107] [INFO] (runner) - Reading HAP/MAP manifest...\n", - "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.56kB to /tmp/tmpor1kfks8/app.json\n", - "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.05kB to /tmp/tmpor1kfks8/pkg.json\n", - "[2024-04-10 15:13:42,350] [INFO] (runner) - --> Verifying if \"nvidia-ctk\" is installed...\n", + "[2024-04-22 16:01:11,066] [INFO] (runner) - Reading HAP/MAP manifest...\n", + "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.56kB to /tmp/tmpbist4mqe/app.json\n", + "\u001b[sPreparing to copy...\u001b[?25l\u001b[u\u001b[2KCopying from container - 0B\u001b[?25h\u001b[u\u001b[2KSuccessfully copied 2.05kB to /tmp/tmpbist4mqe/pkg.json\n", + "[2024-04-22 16:01:11,304] [INFO] (runner) - --> Verifying if \"nvidia-ctk\" is installed...\n", "\n", - "[2024-04-10 15:13:42,351] [INFO] (runner) - --> Verifying \"nvidia-ctk\" version...\n", + "[2024-04-22 16:01:11,305] [INFO] (runner) - --> Verifying \"nvidia-ctk\" version...\n", "\n", - "[2024-04-10 15:13:42,710] [INFO] (common) - Launching container (60a9bd0111e6) using image 'my_app-x64-workstation-dgpu-linux-amd64:1.0'...\n", - " container name: hungry_bassi\n", + "[2024-04-22 16:01:11,538] [INFO] (common) - Launching container (a5b5a728df6c) using image 'my_app-x64-workstation-dgpu-linux-amd64:1.0'...\n", + " container name: inspiring_blackwell\n", " host name: mingq-dt\n", " network: host\n", " user: 1000:1000\n", @@ -1899,119 +1940,115 @@ " shared memory size: 67108864\n", " devices: \n", " group_add: 44\n", - "2024-04-10 22:13:43 [INFO] Launching application python3 /opt/holoscan/app ...\n", + "2024-04-22 23:01:12 [INFO] Launching application python3 /opt/holoscan/app ...\n", "\n", - "[2024-04-10 22:13:46,276] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['/opt/holoscan/app'])\n", + "[2024-04-22 23:01:16,746] [INFO] (root) - Parsed args: Namespace(log_level=None, input=None, output=None, model=None, workdir=None, argv=['/opt/holoscan/app'])\n", "\n", - "[2024-04-10 22:13:46,382] [INFO] (root) - AppContext object: AppContext(input_path=/var/holoscan/input, output_path=/var/holoscan/output, model_path=/opt/holoscan/models, workdir=/var/holoscan)\n", + "[2024-04-22 23:01:16,752] [INFO] (root) - AppContext object: AppContext(input_path=/var/holoscan/input, output_path=/var/holoscan/output, model_path=/opt/holoscan/models, workdir=/var/holoscan)\n", "\n", - "[2024-04-10 22:13:46,384] [INFO] (root) - End compose\n", + "[2024-04-22 23:01:16,755] [INFO] (root) - End compose\n", "\n", "[info] [app_driver.cpp:1161] Launching the driver/health checking service\n", "\n", - "[info] [gxf_executor.cpp:211] Creating context\n", + "[info] [gxf_executor.cpp:247] Creating context\n", "\n", "[info] [server.cpp:87] Health checking server listening on 0.0.0.0:8777\n", "\n", - "[info] [gxf_executor.cpp:1674] Loading extensions from configs...\n", + "[info] [gxf_executor.cpp:1672] Loading extensions from configs...\n", "\n", - "[info] [gxf_executor.cpp:1864] Activating Graph...\n", + "[info] [gxf_executor.cpp:1842] Activating Graph...\n", "\n", - "[info] [gxf_executor.cpp:1894] Running Graph...\n", + "[info] [gxf_executor.cpp:1874] Running Graph...\n", "\n", - "[info] [gxf_executor.cpp:1896] Waiting for completion...\n", + "[info] [gxf_executor.cpp:1876] Waiting for completion...\n", "\n", - "[info] [gxf_executor.cpp:1897] Graph execution waiting. Fragment: \n", + "\u001b[0m2024-04-22 23:01:16.833 INFO gxf/std/greedy_scheduler.cpp@191: Scheduling 9 entities\u001b[0m\n", "\n", - "[info] [greedy_scheduler.cpp:190] Scheduling 9 entities\n", + "[2024-04-22 23:01:16,834] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", "\n", - "[2024-04-10 22:13:46,439] [INFO] (monai.deploy.operators.dicom_data_loader_operator.DICOMDataLoaderOperator) - No or invalid input path from the optional input port: None\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - Finding series for Selection named: CT Series\n", "\n", - "[2024-04-10 22:13:47,210] [INFO] (root) - Finding series for Selection named: CT Series\n", - "\n", - "[2024-04-10 22:13:47,211] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - Searching study, : 1.3.6.1.4.1.14519.5.2.1.7085.2626.822645453932810382886582736291\n", "\n", " # of series: 1\n", "\n", - "[2024-04-10 22:13:47,211] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - Working on series, instance UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", "\n", - "[2024-04-10 22:13:47,211] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - On attribute: 'StudyDescription' to match value: '(.*?)'\n", "\n", - "[2024-04-10 22:13:47,211] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - Series attribute StudyDescription value: CT ABDOMEN W IV CONTRAST\n", "\n", - "[2024-04-10 22:13:47,211] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", "\n", - "[2024-04-10 22:13:47,211] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'\n", "\n", - "[2024-04-10 22:13:47,211] [INFO] (root) - Series attribute Modality value: CT\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - Series attribute Modality value: CT\n", "\n", - "[2024-04-10 22:13:47,211] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", "\n", - "[2024-04-10 22:13:47,211] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - On attribute: 'SeriesDescription' to match value: '(.*?)'\n", "\n", - "[2024-04-10 22:13:47,211] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - Series attribute SeriesDescription value: ABD/PANC 3.0 B31f\n", "\n", - "[2024-04-10 22:13:47,211] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - Series attribute string value did not match. Try regEx.\n", "\n", - "[2024-04-10 22:13:47,211] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", + "[2024-04-22 23:01:17,616] [INFO] (root) - Selected Series, UID: 1.3.6.1.4.1.14519.5.2.1.7085.2626.119403521930927333027265674239\n", "\n", - "[2024-04-10 22:13:47,444] [INFO] (root) - Parsing from bundle_path: /opt/holoscan/models/pancreas_ct_dints/model.ts\n", + "[2024-04-22 23:01:18,036] [INFO] (root) - Parsing from bundle_path: /opt/holoscan/models/pancreas_ct_dints/model.ts\n", "\n", - "[2024-04-10 22:15:33,613] [INFO] (root) - Parsing from bundle_path: /opt/holoscan/models/spleen_ct/model.ts\n", + "[2024-04-22 23:03:11,169] [INFO] (root) - Parsing from bundle_path: /opt/holoscan/models/spleen_ct/model.ts\n", "\n", "/home/holoscan/.local/lib/python3.10/site-packages/highdicom/valuerep.py:54: UserWarning: The string \"C3N-00198\" is unlikely to represent the intended person name since it contains only a single component. Construct a person name according to the format in described in https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html#sect_6.2.1.2, or, in pydicom 2.2.0 or later, use the pydicom.valuerep.PersonName.from_named_components() method to construct the person name correctly. If a single-component name is really intended, add a trailing caret character to disambiguate the name.\n", "\n", " warnings.warn(\n", "\n", - "[2024-04-10 22:15:37,078] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", - "\n", - "[2024-04-10 22:15:37,078] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", + "[2024-04-22 23:03:14,993] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", "\n", - "[2024-04-10 22:15:37,078] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 23:03:14,993] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", "\n", - "[2024-04-10 22:15:37,078] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", + "[2024-04-22 23:03:14,994] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", "\n", - "[2024-04-10 22:15:37,079] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", + "[2024-04-22 23:03:14,994] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", "\n", - "[2024-04-10 22:15:37,079] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 23:03:14,994] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", "\n", - "[2024-04-10 22:15:37,079] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", + "[2024-04-22 23:03:14,994] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", "\n", - "[2024-04-10 22:15:37,079] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", + "[2024-04-22 23:03:14,994] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", "\n", - "[2024-04-10 22:15:37,079] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", + "[2024-04-22 23:03:14,995] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", "\n", - "[2024-04-10 22:15:38,307] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 23:03:14,995] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", "\n", - "[2024-04-10 22:15:38,307] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", + "[2024-04-22 23:03:16,308] [INFO] (highdicom.base) - copy Image-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", "\n", - "[2024-04-10 22:15:38,307] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 23:03:16,309] [INFO] (highdicom.base) - copy attributes of module \"Specimen\"\n", "\n", - "[2024-04-10 22:15:38,307] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", + "[2024-04-22 23:03:16,309] [INFO] (highdicom.base) - copy Patient-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", "\n", - "[2024-04-10 22:15:38,308] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", + "[2024-04-22 23:03:16,309] [INFO] (highdicom.base) - copy attributes of module \"Patient\"\n", "\n", - "[2024-04-10 22:15:38,308] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", + "[2024-04-22 23:03:16,309] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Subject\"\n", "\n", - "[2024-04-10 22:15:38,308] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", + "[2024-04-22 23:03:16,309] [INFO] (highdicom.base) - copy Study-related attributes from dataset \"1.3.6.1.4.1.14519.5.2.1.7085.2626.936983343951485811186213470191\"\n", "\n", - "[2024-04-10 22:15:38,308] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", + "[2024-04-22 23:03:16,309] [INFO] (highdicom.base) - copy attributes of module \"General Study\"\n", "\n", - "[2024-04-10 22:15:38,308] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", + "[2024-04-22 23:03:16,310] [INFO] (highdicom.base) - copy attributes of module \"Patient Study\"\n", "\n", - "[info] [greedy_scheduler.cpp:369] Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\n", + "[2024-04-22 23:03:16,310] [INFO] (highdicom.base) - copy attributes of module \"Clinical Trial Study\"\n", "\n", - "[info] [greedy_scheduler.cpp:398] Scheduler finished.\n", + "\u001b[0m2024-04-22 23:03:16.406 INFO gxf/std/greedy_scheduler.cpp@372: Scheduler stopped: Some entities are waiting for execution, but there are no periodic or async entities to get out of the deadlock.\u001b[0m\n", "\n", - "[info] [gxf_executor.cpp:1906] Graph execution deactivating. Fragment: \n", + "[info] [gxf_executor.cpp:1879] Deactivating Graph...\n", "\n", - "[info] [gxf_executor.cpp:1907] Deactivating Graph...\n", + "\u001b[0m2024-04-22 23:03:16.411 INFO gxf/std/greedy_scheduler.cpp@401: Scheduler finished.\u001b[0m\n", "\n", - "[info] [gxf_executor.cpp:1910] Graph execution finished. Fragment: \n", + "[info] [gxf_executor.cpp:1887] Graph execution finished.\n", "\n", - "[2024-04-10 22:15:38,401] [INFO] (app.App) - End run\n", + "[2024-04-22 23:03:16,418] [INFO] (app.App) - End run\n", "\n", - "[2024-04-10 15:15:39,461] [INFO] (common) - Container 'hungry_bassi'(60a9bd0111e6) exited.\n" + "[2024-04-22 16:03:17,806] [INFO] (common) - Container 'inspiring_blackwell'(a5b5a728df6c) exited.\n" ] } ], @@ -2037,8 +2074,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "1.2.826.0.1.3680043.10.511.3.77817234108119246236647417839296398.dcm\n", - "1.2.826.0.1.3680043.10.511.3.83680469536583357494244170492806366.dcm\n" + "1.2.826.0.1.3680043.10.511.3.12529676536891329606949918082726009.dcm\n", + "1.2.826.0.1.3680043.10.511.3.12761154769880317542705867366586269.dcm\n" ] } ], diff --git a/requirements-dev.txt b/requirements-dev.txt index 81ac93f5..86c1f983 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -35,4 +35,4 @@ scikit-image>=0.17.2 nibabel>=3.2.1 numpy-stl>=2.12.0 trimesh>=3.8.11 -torch~=2.0.1 +torch>=2.0.1 diff --git a/requirements-examples.txt b/requirements-examples.txt index 1490e6fa..335e94ad 100644 --- a/requirements-examples.txt +++ b/requirements-examples.txt @@ -4,10 +4,9 @@ PyPDF2>=2.11.1 highdicom>=0.18.2 SimpleITK>=2.0.0 Pillow>=8.4.0 -numpy-stl>=2.12.0 trimesh>=3.8.11 nibabel>=3.2.1 numpy-stl>=2.12.0 trimesh>=3.8.11 -torch~=2.0.1 +torch>=2.0.1 monai>=1.0.0 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 9034567c..73a56030 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -holoscan~=1.0 +holoscan~=2.0 numpy>=1.21.6 colorama>=0.4.1 typeguard>=3.0.0 diff --git a/setup.cfg b/setup.cfg index c7e5e227..cb195eb7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,7 @@ python_requires = >= 3.8 # cucim install_requires = numpy>=1.21.6 - holoscan~=1.0 + holoscan~=2.0 colorama>=0.4.1 typeguard>=3.0.0