From d46c68d2dbac4bf696bf5e6202246e62fce6a301 Mon Sep 17 00:00:00 2001 From: YunLiu <55491388+KumoLiu@users.noreply.github.com> Date: Tue, 17 Oct 2023 04:44:37 +0800 Subject: [PATCH] Update spleen bundle to use MONAI v1.3 (#527) ### Description Update the spleen bundle to use MONAI v1.3 and test it. ### Status **Ready** ### Please ensure all the checkboxes: - [x] Codeformat tests passed locally by running `./runtests.sh --codeformat`. - [ ] In-line docstrings updated. - [x] Update `version` and `changelog` in `metadata.json` if changing an existing bundle. - [ ] Please ensure the naming rules in config files meet our requirements (please refer to: `CONTRIBUTING.md`). - [x] Ensure versions of packages such as `monai`, `pytorch` and `numpy` are correct in `metadata.json`. - [ ] Descriptions should be consistent with the content, such as `eval_metrics` of the provided weights and TorchScript modules. - [ ] Files larger than 25MB are excluded and replaced by providing download links in `large_file.yml`. - [ ] Avoid using path that contains personal information within config files (such as use `/home/your_name/` for `"bundle_root"`). --------- Signed-off-by: KumoLiu --- models/spleen_ct_segmentation/configs/evaluate.json | 4 +--- models/spleen_ct_segmentation/configs/inference.json | 2 -- models/spleen_ct_segmentation/configs/metadata.json | 5 +++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/models/spleen_ct_segmentation/configs/evaluate.json b/models/spleen_ct_segmentation/configs/evaluate.json index dd0fa811..f874330a 100644 --- a/models/spleen_ct_segmentation/configs/evaluate.json +++ b/models/spleen_ct_segmentation/configs/evaluate.json @@ -16,7 +16,6 @@ ], "transform": "@validate#preprocessing", "orig_keys": "image", - "meta_key_postfix": "meta_dict", "nearest_interp": [ false, true @@ -39,7 +38,6 @@ "_target_": "SaveImaged", "_disabled_": true, "keys": "pred", - "meta_keys": "pred_meta_dict", "output_dir": "@output_dir", "resample": false, "squeeze_end_dims": true @@ -68,7 +66,7 @@ "metric_details": [ "val_mean_dice" ], - "batch_transform": "$monai.handlers.from_engine(['image_meta_dict'])", + "batch_transform": "$lambda x: [xx['image'].meta for xx in x]", "summary_ops": "*" } ], diff --git a/models/spleen_ct_segmentation/configs/inference.json b/models/spleen_ct_segmentation/configs/inference.json index fa338af4..e82996d2 100644 --- a/models/spleen_ct_segmentation/configs/inference.json +++ b/models/spleen_ct_segmentation/configs/inference.json @@ -106,7 +106,6 @@ "keys": "pred", "transform": "@preprocessing", "orig_keys": "image", - "meta_key_postfix": "meta_dict", "nearest_interp": false, "to_tensor": true }, @@ -118,7 +117,6 @@ { "_target_": "SaveImaged", "keys": "pred", - "meta_keys": "pred_meta_dict", "output_dir": "@output_dir" } ] diff --git a/models/spleen_ct_segmentation/configs/metadata.json b/models/spleen_ct_segmentation/configs/metadata.json index c461b0a8..2cea6a99 100644 --- a/models/spleen_ct_segmentation/configs/metadata.json +++ b/models/spleen_ct_segmentation/configs/metadata.json @@ -1,7 +1,8 @@ { "schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20220324.json", - "version": "0.5.3", + "version": "0.5.4", "changelog": { + "0.5.4": "update to use monai 1.3.0", "0.5.3": "fix the wrong GPU index issue of multi-node", "0.5.2": "remove error dollar symbol in readme", "0.5.1": "add RAM warning", @@ -31,7 +32,7 @@ "0.1.0": "complete the model package", "0.0.1": "initialize the model package structure" }, - "monai_version": "1.2.0", + "monai_version": "1.3.0", "pytorch_version": "1.13.1", "numpy_version": "1.22.2", "optional_packages_version": {