code: def convert_seg_image_to_one_hot_encoding_batched(
      image, classes=None
  ):
      if classes is None:
          classes = np.unique(image)
      output_shape = (
          [image.shape[0]] + [len(classes)] + list(image.shape[1:])
      )
      out_image = np.zeros(output_shape, dtype=image.dtype)
      for b in range(image.shape[0]):
          for i, c in enumerate(classes):
              out_image[b, i][image[b] == c] = 1
      return out_image
  
imports: import random
  import numpy
  import paddle
  from paddle.nn.functional import avg_pool2d, avg_pool3d
  from typing import List, Tuple, Union, Callable
  from copy import deepcopy
  from scipy.ndimage import map_coordinates, fourier_gaussian
  from scipy.ndimage.filters import gaussian_filter, gaussian_gradient_magnitude
  from scipy.ndimage.morphology import grey_dilation
  from skimage.transform import resize
  from scipy.ndimage.measurements import label
label_desc: Use image node_id 3 for calling a global function with example usage: convert_seg_image_to_one_hot_encoding_batched(image, classes) and returns: out_image