class_docstr: gym.Env wrapper for resizing frame to (width, height).
  
  Only works with gym.spaces.Box environment with 2D single channel frames.
  
  Example:
      | env = gym.make('Env')
      | # env.observation_space = (100, 100)
      | env_wrapped = Resize(gym.make('Env'), width=64, height=64)
      | # env.observation_space = (64, 64)
  
  Args:
      env: gym.Env to wrap.
      width: resized frame width.
      height: resized frame height.
  
  Raises:
      ValueError: If observation space shape is not 2
          or environment is not gym.spaces.Box.
code: def __init__(self, env, width, height):
      if not isinstance(env.observation_space, gym.spaces.Box):
          raise ValueError("Resize only works with Box environment.")
  
      if len(env.observation_space.shape) != 2:
          raise ValueError(
              "Resize only works with 2D single channel image."
          )
  
      super().__init__(env)
  
      _low = env.observation_space.low.flatten()[0]
      _high = env.observation_space.high.flatten()[0]
      self._dtype = env.observation_space.dtype
      self._observation_space = gym.spaces.Box(
          _low, _high, shape=[width, height], dtype=self._dtype
      )
  
      self._width = width
      self._height = height
  
file_path: garage/src/garage/envs/wrappers/resize.py
imports: import warnings
  import gym
  import gym.spaces
  import numpy
  from skimage import img_as_ubyte
  from skimage.transform import resize
label_desc: Use image node_id 1 to create a new Resize object from inherited base classes: gym with example: obj = Resize(env, width, height)