class_docstr: Rescales an image observation to a given size. The target size does not
  necessarily keep the aspect ratio of the original observation.
  Warning: this requires the input observation to be of type uint8 due to scipy requirements!
code: def filter(
      self,
      observation: ObservationType,
      update_internal_state: bool = True,
  ) -> ObservationType:
      observation = observation.astype("uint8")
  
      # rescale
      if isinstance(
          self.output_observation_space, ImageObservationSpace
      ):
          observation = resize(
              observation,
              tuple(self.output_observation_space.shape),
              anti_aliasing=False,
              preserve_range=True,
          ).astype("uint8")
  
      else:
          new_observation = []
          for i in range(
              self.output_observation_space.shape[
                  self.output_observation_space.channels_axis
              ]
          ):
              new_observation.append(
                  resize(
                      observation.take(
                          i, self.output_observation_space.channels_axis
                      ),
                      tuple(self.planar_map_output_shape),
                      preserve_range=True,
                  ).astype("uint8")
              )
          new_observation = np.array(new_observation)
          observation = new_observation.swapaxes(
              0, self.output_observation_space.channels_axis
          )
  
      return observation
  
file_path: coach/rl_coach/filters/observation/observation_rescale_to_size_filter.py
imports: import copy
  from skimage.transform import resize
  import numpy
  from rl_coach.core_types import ObservationType
  from rl_coach.filters.observation.observation_filter import ObservationFilter
  from rl_coach.spaces import ObservationSpace, PlanarMapsObservationSpace, ImageObservationSpace
label_desc: Use image node_id 3 for calling the ObservationRescaleToSizeFilter obj's underlying member method code with example usage: obj.filter(observation, update_internal_state) and returns: observation