Skip to content

Commit b76a371

Browse files
Update requirements and fix data shape handling in Monai nUNet Bundle Inference Operator
Signed-off-by: Simone Bendazzoli <[email protected]>
1 parent 0f0e8ce commit b76a371

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

examples/apps/ai_spleen_nnunet_seg_app/requirements.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ numpy-stl>=2.12.0
77
trimesh>=3.8.11
88
nibabel>=3.2.1
99
torch>=1.12.0
10-
<<<<<<< HEAD
11-
nvflare
1210
git+https://github.com/SimoneBendazzoli93/dynamic-network-architectures.git
1311
git+https://github.com/SimoneBendazzoli93/MONAI.git@dev
1412
git+https://github.com/SimoneBendazzoli93/nnUNet.git
15-
=======
16-
monai>=1.0.0
17-
nnunetv2>=2.5.1
18-
>>>>>>> dacfaa9 (Add nnUNet segmentation application and dependencies)

monai/deploy/operators/monai_nnunet_bundle_inference_operator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def _init_config(self, config_names):
7575

7676
super()._init_config(config_names)
7777
parser = get_bundle_config(str(self._bundle_path), config_names)
78-
parser['bundle_root'] = str(Path(self._bundle_path).parent.parent.parent)
7978
self._parser = parser
8079

8180
self._nnunet_predictor = parser.get_parsed_content("network_def")
@@ -85,4 +84,6 @@ def predict(self, data: Any, *args, **kwargs) -> Union[Image, Any, Tuple[Any, ..
8584

8685
self._nnunet_predictor.predictor.network = self._model_network
8786
#os.environ['nnUNet_def_n_proc'] = "1"
88-
return self._nnunet_predictor(torch.unsqueeze(data, 0))
87+
if len(data.shape) == 4:
88+
data = data[None]
89+
return self._nnunet_predictor(data)

0 commit comments

Comments
 (0)