From 15c3658cc95331c88e6127f7f536630379a73ae2 Mon Sep 17 00:00:00 2001 From: Fabian Isensee Date: Tue, 5 Dec 2023 14:04:40 +0100 Subject: [PATCH] remove num_predictons variable --- nnunetv2/inference/predict_from_raw_data.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nnunetv2/inference/predict_from_raw_data.py b/nnunetv2/inference/predict_from_raw_data.py index 90cbeba45..b5901c80a 100644 --- a/nnunetv2/inference/predict_from_raw_data.py +++ b/nnunetv2/inference/predict_from_raw_data.py @@ -549,13 +549,12 @@ def _internal_maybe_mirror_and_predict(self, x: torch.Tensor) -> torch.Tensor: # x should be 5d for 3d images and 4d for 2d. so the max value of mirror_axes cannot exceed len(x.shape) - 3 assert max(mirror_axes) <= x.ndim - 3, 'mirror_axes does not match the dimension of the input!' - num_predictons = 2 ** len(mirror_axes) axes_combinations = [ c for i in range(len(mirror_axes)) for c in itertools.combinations([m + 2 for m in mirror_axes], i + 1) ] for axes in axes_combinations: prediction += torch.flip(self.network(torch.flip(x, (*axes,))), (*axes,)) - prediction /= num_predictons + prediction /= (len(axes_combinations) + 1) return prediction def predict_sliding_window_return_logits(self, input_image: torch.Tensor) \