class_docstr: An image resizing pre-processor.
  
  :param observation_space: The observation space to pre-process.
  :param target_size: Target size of resized image.
  :param transpose: Transpose rgb channel is required (should be last dimension such as [96, 96, 3]).
class_docstr_tok: ["An","image","resizing","pre-processor",".",":","param","observation_space",":","The","observation","space","to","pre-process",".",":","param","target_size",":","Target","size","of","resized","image",".",":","param","transpose",":","Transpose","rgb","channel","is","required","(","should","be","last","dimension","such","as","[","96",",","96",",","3","]",")","."]
docstr: implementation of :class:`~maze.core.wrappers.observation_preprocessing.preprocessors.base.PreProcessor` interface
          
docstr_tok: ["implementation","of",":","class",":","`","~maze.core.wrappers.observation_preprocessing.preprocessors.base.PreProcessor","`","interface"]
code: def process(self, observation: np.ndarray) -> np.ndarray:
      """implementation of :class:`~maze.core.wrappers.observation_preprocessing.preprocessors.base.PreProcessor` interface"""
  
      # check if dtype conversion is necessary
      if observation.ndim == 3:
          observation = observation.astype(np.uint8)
  
      # color channel transposition is necessary
      if self.transpose:
          observation = np.transpose(observation, (1, 2, 0))
  
      # convert array to image and resize
      img = Image.fromarray(observation)
      img = img.resize(size=self.target_size)
  
      # convert back to array and transpose back
      observation = np.asarray(img, dtype=np.float32)
      if self.transpose:
          observation = np.transpose(observation, (2, 0, 1))
  
      return observation
  
file_path: maze/maze/core/wrappers/observation_preprocessing/preprocessors/resize_img.py
imports: from typing import Tuple, Sequence
  import numpy
  from gym import spaces
  from PIL import Image
  from maze.core.wrappers.observation_preprocessing.preprocessors.base import PreProcessor
  from maze.core.annotations import override
label_desc: Use image node_id 4 for calling the ResizeImgPreProcessor obj's underlying member method code with example usage: obj.process(observation) and returns: observation