class_docstr: Static predictor for nnunet.
class_docstr_tok: ["Static","predictor","for","nnunet","."]
code: def _internal_predict_2D_2Dconv(
      self,
      x: np.ndarray,
      min_size: Tuple[int, int],
      do_mirroring: bool,
      mirror_axes: tuple = (0, 1, 2),
      regions_class_order: tuple = None,
      pad_border_mode: str = "constant",
      pad_kwargs: dict = None,
      verbose: bool = True,
  ) -> Tuple[np.ndarray, np.ndarray]:
      assert (
          len(x.shape) == 3
      ), "x must be (c, x, y), but got {}.".format(x.shape)
  
      assert (
          self.input_shape_must_be_divisible_by is not None
      ), "input_shape_must_be_divisible_by must be set but got None"
      if verbose:
          print("do mirror:", do_mirroring)
  
      data, slicer = pad_nd_image(
          x,
          min_size,
          pad_border_mode,
          pad_kwargs,
          True,
          self.input_shape_must_be_divisible_by,
      )
      predicted_probabilities = self._internal_maybe_mirror_and_pred_2D(
          data[None], mirror_axes, do_mirroring, None
      )[0]
  
      slicer = tuple(
          [
              slice(0, predicted_probabilities.shape[i])
              for i in range(
                  len(predicted_probabilities.shape) - (len(slicer) - 1)
              )
          ]
          + slicer[1:]
      )
      predicted_probabilities = predicted_probabilities[slicer]
  
      if regions_class_order is None:
          predicted_segmentation = predicted_probabilities.argmax(0)
          predicted_segmentation = predicted_segmentation
          predicted_probabilities = predicted_probabilities
      else:
          predicted_probabilities = predicted_probabilities
          predicted_segmentation = np.zeros(
              predicted_probabilities.shape[1:], dtype=np.float32
          )
          for i, c in enumerate(regions_class_order):
              predicted_segmentation[
                  predicted_probabilities[i] > 0.5
              ] = c
  
      return predicted_segmentation, predicted_probabilities
  
imports: import pickle
  import numpy
  from functools import partial
  from typing import Tuple, List, Union
  from scipy.ndimage.filters import gaussian_filter
  from paddle.inference import create_predictor, PrecisionType
  from paddle.inference import Config
  from tools.preprocess_utils import GenericPreprocessor, PreprocessorFor2D
  from nnunet.utils.utils import no_op, pad_nd_image
  from nnunet.transforms import default_2D_augmentation_params, default_3D_augmentation_params
label_desc: Use image node_id 7 for calling the StaticBasePredictor obj's underlying member method code with example usage: obj._internal_predict_2D_2Dconv(x, min_size, do_mirroring, mirror_axes, regions_class_order, pad_border_mode, pad_kwargs, verbose) and returns: predicted_segmentation,  predicted_probabilities